diff --git a/TitanEngineEmulator/Emulator.h b/TitanEngineEmulator/Emulator.h index 67d08ff..9ed8ac9 100644 --- a/TitanEngineEmulator/Emulator.h +++ b/TitanEngineEmulator/Emulator.h @@ -590,7 +590,10 @@ public: __debugbreak(); //return 0; if(!found->second.pe->IsValidPe()) __debugbreak(); //return 0; - return found->second.pe->ConvertRvaToOffset(uint32(AddressToConvert)); + auto offset = found->second.pe->ConvertRvaToOffset(uint32(AddressToConvert)); + if (offset == INVALID_VALUE) + return 0; + return ReturnType ? FileMapVA + offset : offset; } template @@ -1200,4 +1203,4 @@ private: //variables STEPCALLBACK mCbATTACHBREAKPOINT = nullptr; PROCESS_INFORMATION* mAttachProcessInfo = nullptr; wchar_t szDebuggeeName[MAX_PATH] = L""; -}; \ No newline at end of file +};