Emulator: fix offset to VA calculation

This commit is contained in:
Matthijs Lavrijsen 2020-12-24 15:47:30 +01:00
parent 0356726f20
commit 7fca84f656
No known key found for this signature in database
GPG Key ID: D40D1DBE299B83EA
2 changed files with 8 additions and 2 deletions

View File

@ -523,9 +523,12 @@ public:
if (!found->second.pe->IsValidPe()) if (!found->second.pe->IsValidPe())
__debugbreak(); //return 0; __debugbreak(); //return 0;
if (AddressToConvert < FileMapVA)
__debugbreak();
// convert: FileOffset -> VA // convert: FileOffset -> VA
auto offset = found->second.pe->ConvertOffsetToRva( auto offset = found->second.pe->ConvertOffsetToRva(
uint32( AddressToConvert ) uint32( AddressToConvert - FileMapVA )
); );
if (offset == INVALID_VALUE) if (offset == INVALID_VALUE)

View File

@ -595,9 +595,12 @@ public:
if(!found->second.pe->IsValidPe()) if(!found->second.pe->IsValidPe())
__debugbreak(); //return 0; __debugbreak(); //return 0;
if (AddressToConvert < FileMapVA)
__debugbreak();
// convert: FileOffset -> VA // convert: FileOffset -> VA
auto offset = found->second.pe->ConvertOffsetToRva( auto offset = found->second.pe->ConvertOffsetToRva(
uint32( AddressToConvert ) uint32( AddressToConvert - FileMapVA )
); );
if (offset == INVALID_VALUE) if (offset == INVALID_VALUE)