Clean up more Cemuhook leftovers (#253)

This commit is contained in:
Francesco Saltori 2022-09-16 13:34:41 +02:00 committed by GitHub
parent cebdccfdf5
commit 664d7ee902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 48 deletions

View file

@ -217,7 +217,6 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
// setup RPL info struct
RPLModule* rplLoaderContext = new RPLModule();
rplLoaderContext->RPLRawData = std::span<uint8>(rplData, rplSize);
rplLoaderContext->rplData_depr = rplData;
rplLoaderContext->heapTrampolineArea.setBaseAllocator(&rplLoaderHeap_lowerAreaCodeMem2);
// load section table
if ((uint32)rplHeader->sectionTableEntrySize != sizeof(rplSectionEntryNew_t))
@ -282,12 +281,6 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
// convert modulename to lower-case
for(auto& c : rplLoaderContext->moduleName2)
c = _ansiToLower(c);
// cemuhook compatibility
rplLoaderContext->moduleNamePtr__depr = rplLoaderContext->moduleName2.data();
rplLoaderContext->moduleNameLength__depr = rplLoaderContext->moduleName2.size();
rplLoaderContext->moduleNameSize = 0;
rplLoaderContext->sectionAddressTable__depr = rplLoaderContext->sectionAddressTable2.data();
rplLoaderContext->sectionAddressTableSize__depr = rplLoaderContext->sectionAddressTable2.size() * sizeof(rplSectionAddressEntry_t);
// load CRC section
uint32 crcTableExpectedSize = sectionCount * sizeof(uint32be);

View file

@ -144,25 +144,13 @@ struct RPLModule
{
uint32 ukn00; // pointer to shared memory region? (0xEFE01000)
uint32 ukn04; // related to text region size?
char* moduleNamePtr__depr; // converted to lower case
uint32 moduleNameLength__depr; // length of module name
uint32 moduleNameSize; // aligned alloc size, not the same as actual length
uint32 padding14;
uint32 padding18;
rplHeaderNew_t rplHeader;
rplSectionEntryNew_t* sectionTablePtr; // copy of section table
RPLFileInfoData* fileInfoPtr__depr{}; // copy of fileinfo section
uint32 fileInfoSize__depr{}; // size of fileInfo section
uint32 fileInfoAllocSize__depr{}; // aligned alloc size
uint32be* crcTablePtr_depr{}; // copy of CRC section
uint32 crcTableAllocSize_depr{};
uint32 entrypoint;
uint8* rplData_depr; // Cemuhook might still read this
MPTR textRegionTemp; // temporary memory for text section?
MEMPTR<void> regionMappingBase_text; // base destination address for text region
@ -171,15 +159,11 @@ struct RPLModule
uint8* tempRegionPtr;
uint32 tempRegionAllocSize;
rplSectionAddressEntry_t* sectionAddressTable__depr;
uint32 sectionAddressTableSize__depr;
uint32 exportDCount;
rplExportTableEntry_t* exportDDataPtr;
uint32 exportFCount;
rplExportTableEntry_t* exportFDataPtr;
/* above are hardcoded in Cemuhook */
std::string moduleName2;
std::vector<rplSectionAddressEntry_t> sectionAddressTable2;

View file

@ -105,15 +105,12 @@ namespace coreinit
return 0;
}
uint32 OSDynLoad_Release(uint32 moduleHandle)
void OSDynLoad_Release(uint32 moduleHandle)
{
if (moduleHandle == RPL_INVALID_HANDLE)
return 0;
return;
RPLLoader_RemoveDependency(moduleHandle);
RPLLoader_UpdateDependencies();
// this function isn't supposed to return anything, but early versions of Cemu did and Cemuhook (up to 0.5.7.6) now relies on it. We still keep the return value around for compatibility
return 0;
}
uint32 OSDynLoad_FindExport(uint32 moduleHandle, uint32 isData, const char* exportName, betype<MPTR>* addrOut)

View file

@ -11,7 +11,7 @@ namespace coreinit
void OSDynLoad_AllocatorFree(void* mem);
uint32 OSDynLoad_Acquire(const char* libName, uint32be* moduleHandleOut);
uint32 OSDynLoad_Release(uint32 moduleHandle);
void OSDynLoad_Release(uint32 moduleHandle);
uint32 OSDynLoad_FindExport(uint32 moduleHandle, uint32 isData, const char* exportName, betype<MPTR>* addrOut);
void InitializeDynLoad();