Skip to content

Commit

Permalink
Fix remaining case sensitivity issues
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
VitaSmith committed Jan 4, 2021
1 parent dc16822 commit 35794da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .vs/cdecrypt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;AES_ROM_TABLES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4200;4201</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4201;6384</DisableSpecificWarnings>
<UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
Expand All @@ -154,7 +154,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;AES_ROM_TABLES;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4200;4201</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4201;6384</DisableSpecificWarnings>
<UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
Expand All @@ -178,7 +178,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;AES_ROM_TABLES;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>4200;4201</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4201;6384</DisableSpecificWarnings>
<UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
Expand All @@ -204,7 +204,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;AES_ROM_TABLES;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DisableSpecificWarnings>4200;4201</DisableSpecificWarnings>
<DisableSpecificWarnings>4200;4201;6384</DisableSpecificWarnings>
<UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>
</ClCompile>
<Link>
Expand Down
16 changes: 11 additions & 5 deletions cdecrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,22 @@ int main_utf8(int argc, char** argv)
uint8_t iv[16];
memset(iv, 0, sizeof(iv));

sprintf(str, "%s%c%08X.app", argv[1], PATH_SEP, getbe32(&tmd->Contents[0].ID));
for (uint32_t k = 0; k < (array_size(pattern) / 2); k++) {
sprintf(str, pattern[k], argv[1], PATH_SEP, getbe32(&tmd->Contents[0].ID));
if (is_file(str))
break;
}

uint32_t cnt_len = read_file(str, &cnt);
if (cnt_len == 0) {
sprintf(str, "%s%c%08X", argv[1], PATH_SEP, getbe32(&tmd->Contents[0].ID));
for (uint32_t k = (array_size(pattern) / 2); k < array_size(pattern); k++) {
sprintf(str, pattern[k], argv[1], PATH_SEP, getbe32(&tmd->Contents[0].ID));
if (is_file(str))
break;
}
cnt_len = read_file(str, &cnt);
if (cnt_len == 0) {
fprintf(stderr, "ERROR: Failed to open content: %02X\n", getbe32(&tmd->Contents[0].ID));
if (cnt_len == 0)
goto out;
}
}

if (getbe64(&tmd->Contents[0].Size) != (uint64_t)cnt_len) {
Expand Down

0 comments on commit 35794da

Please sign in to comment.