mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Module: Save ELFs by name and fix when compressed.
Causes confusion for people using this feature.
This commit is contained in:
parent
1faa4031e6
commit
e7ebb03103
1 changed files with 6 additions and 5 deletions
|
@ -884,7 +884,7 @@ void PSPModule::Cleanup() {
|
|||
}
|
||||
}
|
||||
|
||||
static void __SaveDecryptedEbootToStorageMedia(const u8 *decryptedEbootDataPtr, const u32 length) {
|
||||
static void SaveDecryptedEbootToStorageMedia(const u8 *decryptedEbootDataPtr, const u32 length, const char *name) {
|
||||
if (!decryptedEbootDataPtr) {
|
||||
ERROR_LOG(SCEMODULE, "Error saving decrypted EBOOT.BIN: invalid pointer");
|
||||
return;
|
||||
|
@ -895,7 +895,7 @@ static void __SaveDecryptedEbootToStorageMedia(const u8 *decryptedEbootDataPtr,
|
|||
return;
|
||||
}
|
||||
|
||||
const std::string filenameToDumpTo = g_paramSFO.GetDiscID() + ".BIN";
|
||||
const std::string filenameToDumpTo = StringFromFormat("%s_%s.BIN", g_paramSFO.GetDiscID().c_str(), name);
|
||||
const Path dumpDirectory = GetSysDirectory(DIRECTORY_DUMP);
|
||||
const Path fullPath = dumpDirectory / filenameToDumpTo;
|
||||
|
||||
|
@ -1264,9 +1264,10 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
|||
|
||||
// If we've made it this far, it should be safe to dump.
|
||||
if (g_Config.bDumpDecryptedEboot) {
|
||||
INFO_LOG(SCEMODULE, "Dumping decrypted EBOOT.BIN to file.");
|
||||
const u32 dumpLength = ret;
|
||||
__SaveDecryptedEbootToStorageMedia(ptr, dumpLength);
|
||||
// Copy the name to ensure it's null terminated.
|
||||
char name[32]{};
|
||||
strncpy(name, head->modname, ARRAY_SIZE(head->modname));
|
||||
SaveDecryptedEbootToStorageMedia(ptr, elfSize, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue