diff --git a/StaticEngine/Emulator.h b/StaticEngine/Emulator.h index eacf715..d410924 100644 --- a/StaticEngine/Emulator.h +++ b/StaticEngine/Emulator.h @@ -523,9 +523,12 @@ public: if (!found->second.pe->IsValidPe()) __debugbreak(); //return 0; + if (AddressToConvert < FileMapVA) + __debugbreak(); + // convert: FileOffset -> VA auto offset = found->second.pe->ConvertOffsetToRva( - uint32( AddressToConvert ) + uint32( AddressToConvert - FileMapVA ) ); if (offset == INVALID_VALUE) diff --git a/TitanEngineEmulator/Emulator.h b/TitanEngineEmulator/Emulator.h index a13c8be..7d80fa1 100644 --- a/TitanEngineEmulator/Emulator.h +++ b/TitanEngineEmulator/Emulator.h @@ -595,9 +595,12 @@ public: if(!found->second.pe->IsValidPe()) __debugbreak(); //return 0; + if (AddressToConvert < FileMapVA) + __debugbreak(); + // convert: FileOffset -> VA auto offset = found->second.pe->ConvertOffsetToRva( - uint32( AddressToConvert ) + uint32( AddressToConvert - FileMapVA ) ); if (offset == INVALID_VALUE)