Skip to content

Commit ec72f51

Browse files
committed
removed AMS DRM
1 parent 65be511 commit ec72f51

File tree

8 files changed

+22
-45
lines changed

8 files changed

+22
-45
lines changed

creport/source/creport_crash_report.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ bool CrashReport::GetCurrentTime(u64 *out) {
204204

205205
voidCrashReport::EnsureReportDirectories() {
206206
char path[FS_MAX_PATH];
207-
strcpy(path, "sdmc:/atmosphere");
207+
strcpy(path, "sdmc:/ReiNX");
208208
mkdir(path, S_IRWXU);
209209
strcat(path, "/crash reports");
210210
mkdir(path, S_IRWXU);
@@ -226,7 +226,7 @@ void CrashReport::SaveReport() {
226226
}
227227

228228
/* Open report file. */
229-
snprintf(report_path, sizeof(report_path) - 1, "sdmc:/atmosphere/crash reports/%011lu_%016lx.log", timestamp, process_info.title_id);
229+
snprintf(report_path, sizeof(report_path) - 1, "sdmc:/ReiNX/crash reports/%011lu_%016lx.log", timestamp, process_info.title_id);
230230
FILE *f_report = fopen(report_path, "w");
231231
if (f_report == NULL) {
232232
return;
@@ -235,7 +235,7 @@ void CrashReport::SaveReport() {
235235
fclose(f_report);
236236

237237
/* Dump threads. */
238-
snprintf(report_path, sizeof(report_path) - 1, "sdmc:/atmosphere/crash reports/dumps/%011lu_%016lx_thread_info.bin", timestamp, process_info.title_id);
238+
snprintf(report_path, sizeof(report_path) - 1, "sdmc:/ReiNX/crash reports/dumps/%011lu_%016lx_thread_info.bin", timestamp, process_info.title_id);
239239
f_report = fopen(report_path, "wb");
240240
this->thread_list.DumpBinary(f_report, this->crashed_thread_info.GetId());
241241
fclose(f_report);

fs_mitm/source/fsmitm_main.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ void __appInit(void) {
6565
if (R_FAILED(rc)) {
6666
fatalSimple(0xCAFE << 4 | 3);
6767
}
68-
69-
/* Check for exosphere API compatibility. */
70-
u64 exosphere_cfg;
71-
if (R_SUCCEEDED(splGetConfig((SplConfigItem)65000, &exosphere_cfg))) {
72-
/* MitM requires Atmosphere API 0.1. */
73-
u16 api_version = (exosphere_cfg >> 16) & 0xFFFF;
74-
if (api_version < 0x0001) {
75-
fatalSimple(0xCAFE << 4 | 0xFE);
76-
}
77-
} else {
78-
fatalSimple(0xCAFE << 4 | 0xFF);
79-
}
80-
81-
//splExit();
8268
}
8369

8470
void__appExit(void) {

fs_mitm/source/fsmitm_utils.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ void Utils::InitializeSdThreadFunc(void *args) {
4343

4444
/* Check for MitM flags. */
4545
FsDir titles_dir;
46-
if (R_SUCCEEDED(fsFsOpenDirectory(&g_sd_filesystem, "/atmosphere/titles", FS_DIROPEN_DIRECTORY, &titles_dir))) {
46+
if (R_SUCCEEDED(fsFsOpenDirectory(&g_sd_filesystem, "/ReiNX/titles", FS_DIROPEN_DIRECTORY, &titles_dir))) {
4747
FsDirectoryEntry dir_entry;
4848
FsFile f;
4949
u64 read_entries;
5050
while (R_SUCCEEDED((fsDirRead(&titles_dir, 0, &read_entries, 1, &dir_entry))) && read_entries == 1) {
5151
if (strlen(dir_entry.name) == 0x10 && IsHexadecimal(dir_entry.name)) {
5252
u64 title_id = strtoul(dir_entry.name, NULL, 16);
5353
char title_path[FS_MAX_PATH] = {0};
54-
strcpy(title_path, "/atmosphere/titles/");
54+
strcpy(title_path, "/ReiNX/titles/");
5555
strcat(title_path, dir_entry.name);
5656
strcat(title_path, "/fsmitm.flag");
5757
if (R_SUCCEEDED(fsFsOpenFile(&g_sd_filesystem, title_path, FS_OPEN_READ, &f))) {
@@ -87,9 +87,9 @@ Result Utils::OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, F
8787

8888
char path[FS_MAX_PATH];
8989
if (*fn == '/') {
90-
snprintf(path, sizeof(path), "/atmosphere/titles/%016lx%s", title_id, fn);
90+
snprintf(path, sizeof(path), "/ReiNX/titles/%016lx%s", title_id, fn);
9191
} else {
92-
snprintf(path, sizeof(path), "/atmosphere/titles/%016lx/%s", title_id, fn);
92+
snprintf(path, sizeof(path), "/ReiNX/titles/%016lx/%s", title_id, fn);
9393
}
9494
returnfsFsOpenFile(&g_sd_filesystem, path, flags, out);
9595
}
@@ -117,9 +117,9 @@ Result Utils::OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out)
117117

118118
char safe_path[FS_MAX_PATH];
119119
if (*path == '/') {
120-
snprintf(safe_path, sizeof(safe_path), "/atmosphere/titles/%016lx%s", title_id, path);
120+
snprintf(safe_path, sizeof(safe_path), "/ReiNX/titles/%016lx%s", title_id, path);
121121
} else {
122-
snprintf(safe_path, sizeof(safe_path), "/atmosphere/titles/%016lx/%s", title_id, path);
122+
snprintf(safe_path, sizeof(safe_path), "/ReiNX/titles/%016lx/%s", title_id, path);
123123
}
124124
returnfsFsOpenDirectory(&g_sd_filesystem, safe_path, FS_DIROPEN_DIRECTORY | FS_DIROPEN_FILE, out);
125125
}
@@ -136,19 +136,19 @@ Result Utils::OpenRomFSSdDir(u64 title_id, const char *path, FsDir *out) {
136136
Result Utils::OpenRomFSFile(FsFileSystem *fs, u64 title_id, constchar *fn, int flags, FsFile *out) {
137137
char path[FS_MAX_PATH];
138138
if (*fn == '/') {
139-
snprintf(path, sizeof(path), "/atmosphere/titles/%016lx/romfs%s", title_id, fn);
139+
snprintf(path, sizeof(path), "/ReiNX/titles/%016lx/romfs%s", title_id, fn);
140140
} else {
141-
snprintf(path, sizeof(path), "/atmosphere/titles/%016lx/romfs/%s", title_id, fn);
141+
snprintf(path, sizeof(path), "/ReiNX/titles/%016lx/romfs/%s", title_id, fn);
142142
}
143143
returnfsFsOpenFile(fs, path, flags, out);
144144
}
145145

146146
Result Utils::OpenRomFSDir(FsFileSystem *fs, u64 title_id, constchar *path, FsDir *out) {
147147
char safe_path[FS_MAX_PATH];
148148
if (*path == '/') {
149-
snprintf(safe_path, sizeof(safe_path), "/atmosphere/titles/%016lx/romfs%s", title_id, path);
149+
snprintf(safe_path, sizeof(safe_path), "/ReiNX/titles/%016lx/romfs%s", title_id, path);
150150
} else {
151-
snprintf(safe_path, sizeof(safe_path), "/atmosphere/titles/%016lx/romfs/%s", title_id, path);
151+
snprintf(safe_path, sizeof(safe_path), "/ReiNX/titles/%016lx/romfs/%s", title_id, path);
152152
}
153153
returnfsFsOpenDirectory(fs, safe_path, FS_DIROPEN_DIRECTORY | FS_DIROPEN_FILE, out);
154154
}

loader/source/ldr_main.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ void __appInit(void) {
6868
if (R_FAILED(rc)) {
6969
fatalSimple(0xCAFE << 4 | 3);
7070
}
71-
72-
/* Check for exosphere API compatibility. */
73-
u64 exosphere_cfg;
74-
if (R_FAILED(splGetConfig((SplConfigItem)65000, &exosphere_cfg))) {
75-
//fatalSimple(0xCAFE << 4 | 0xFF);
76-
/* TODO: Does Loader need to know about target firmware/master key revision? If so, extract from exosphere_cfg. */
77-
}
78-
79-
//splExit();
8071
}
8172

8273
void__appExit(void) {

loader/source/ldr_npdm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FILE *NpdmUtils::OpenNpdmFromExeFS() {
2323

2424
FILE *NpdmUtils::OpenNpdmFromSdCard(u64 title_id) {
2525
std::fill(g_npdm_path, g_npdm_path + FS_MAX_PATH, 0);
26-
snprintf(g_npdm_path, FS_MAX_PATH, "sdmc:/atmosphere/titles/%016lx/exefs/main.npdm", title_id);
26+
snprintf(g_npdm_path, FS_MAX_PATH, "sdmc:/ReiNX/titles/%016lx/exefs/main.npdm", title_id);
2727
returnfopen(g_npdm_path, "rb");
2828
}
2929

loader/source/ldr_nso.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ FILE *NsoUtils::OpenNsoFromExeFS(unsigned int index) {
2222

2323
FILE *NsoUtils::OpenNsoFromSdCard(unsignedint index, u64 title_id) {
2424
std::fill(g_nso_path, g_nso_path + FS_MAX_PATH, 0);
25-
snprintf(g_nso_path, FS_MAX_PATH, "sdmc:/atmosphere/titles/%016lx/exefs/%s", title_id, NsoUtils::GetNsoFileName(index));
25+
snprintf(g_nso_path, FS_MAX_PATH, "sdmc:/ReiNX/titles/%016lx/exefs/%s", title_id, NsoUtils::GetNsoFileName(index));
2626
returnfopen(g_nso_path, "rb");
2727
}
2828

2929
boolNsoUtils::CheckNsoStubbed(unsignedint index, u64 title_id) {
3030
std::fill(g_nso_path, g_nso_path + FS_MAX_PATH, 0);
31-
snprintf(g_nso_path, FS_MAX_PATH, "sdmc:/atmosphere/titles/%016lx/exefs/%s.stub", title_id, NsoUtils::GetNsoFileName(index));
31+
snprintf(g_nso_path, FS_MAX_PATH, "sdmc:/ReiNX/titles/%016lx/exefs/%s.stub", title_id, NsoUtils::GetNsoFileName(index));
3232
FILE *f = fopen(g_nso_path, "rb");
3333
bool ret = (f != NULL);
3434
if (ret) {

loader/source/ldr_patcher.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ static void ApplyIpsPatch(u8 *mapped_nso, size_t mapped_size, bool is_ips32, FIL
127127
}
128128

129129
voidPatchUtils::ApplyPatches(const NsoUtils::NsoHeader *header, u8 *mapped_nso, size_t mapped_size) {
130-
/* Inspect all patches from /atmosphere/exefs_patches/<*>/<*>.ips */
130+
/* Inspect all patches from /ReiNX/exefs_patches/<*>/<*>.ips */
131131
char path[FS_MAX_PATH+1] = {0};
132-
snprintf(path, sizeof(path) - 1, "sdmc:/atmosphere/exefs_patches");
132+
snprintf(path, sizeof(path) - 1, "sdmc:/ReiNX/exefs_patches");
133133
DIR *patches_dir = opendir(path);
134134
structdirent *pdir_ent;
135135
if (patches_dir != NULL) {
@@ -138,7 +138,7 @@ void PatchUtils::ApplyPatches(const NsoUtils::NsoHeader *header, u8 *mapped_nso,
138138
if (strcmp(pdir_ent->d_name, ".") == 0 || strcmp(pdir_ent->d_name, "..") == 0) {
139139
continue;
140140
}
141-
snprintf(path, sizeof(path) - 1, "sdmc:/atmosphere/exefs_patches/%s", pdir_ent->d_name);
141+
snprintf(path, sizeof(path) - 1, "sdmc:/ReiNX/exefs_patches/%s", pdir_ent->d_name);
142142
DIR *patch_dir = opendir(path);
143143
structdirent *ent;
144144
if (patch_dir != NULL) {
@@ -149,7 +149,7 @@ void PatchUtils::ApplyPatches(const NsoUtils::NsoHeader *header, u8 *mapped_nso,
149149
}
150150
size_t name_len = strlen(ent->d_name);
151151
if ((4 < name_len && name_len <= 0x44) && ((name_len & 1) == 0) && strcmp(ent->d_name + name_len - 4, ".ips") == 0 && MatchesBuildId(ent->d_name, name_len, header->build_id)) {
152-
snprintf(path, sizeof(path) - 1, "sdmc:/atmosphere/exefs_patches/%s/%s", pdir_ent->d_name, ent->d_name);
152+
snprintf(path, sizeof(path) - 1, "sdmc:/ReiNX/exefs_patches/%s/%s", pdir_ent->d_name, ent->d_name);
153153
FILE *f_ips = fopen(path, "rb");
154154
if (f_ips != NULL) {
155155
u8 header[5];

pm/source/pm_boot2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ void EmbeddedBoot2::Main() {
139139
}
140140

141141
/* Allow for user-customizable programs. */
142-
DIR *titles_dir = opendir("sdmc:/atmosphere/titles");
142+
DIR *titles_dir = opendir("sdmc:/ReiNX/titles");
143143
structdirent *ent;
144144
if (titles_dir != NULL) {
145145
while ((ent = readdir(titles_dir)) != NULL) {
146146
if (strlen(ent->d_name) == 0x10 && IsHexadecimal(ent->d_name)) {
147147
u64 title_id = strtoul(ent->d_name, NULL, 16);
148148
char title_path[FS_MAX_PATH] = {0};
149-
strcpy(title_path, "sdmc:/atmosphere/titles/");
149+
strcpy(title_path, "sdmc:/ReiNX/titles/");
150150
strcat(title_path, ent->d_name);
151151
strcat(title_path, "/boot2.flag");
152152
FILE *f_flag = fopen(title_path, "rb");

0 commit comments

Comments
 (0)
close