From 1fc0b0d8de2985e69bbf706b020ee6cbfbbd929b Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 29 Dec 2021 16:48:29 +0100 Subject: [PATCH] Fix setting the startAddress of modules --- source/module/ModuleDataFactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/module/ModuleDataFactory.cpp b/source/module/ModuleDataFactory.cpp index 5436d81..f97842e 100644 --- a/source/module/ModuleDataFactory.cpp +++ b/source/module/ModuleDataFactory.cpp @@ -56,6 +56,7 @@ ModuleDataFactory::load(const std::string &path, uint32_t destination_address_en } uint32_t baseOffset = (destination_address_end - sizeOfModule) & 0xFFFFFF00; + uint32_t startAddress = baseOffset; uint32_t offset_text = baseOffset; uint32_t offset_data = offset_text; @@ -152,7 +153,7 @@ ModuleDataFactory::load(const std::string &path, uint32_t destination_address_en free(destinations); - moduleData->setStartAddress(baseOffset); + moduleData->setStartAddress(startAddress); moduleData->setEndAddress(endAddress); moduleData->setEntrypoint(entrypoint); DEBUG_FUNCTION_LINE("Saved entrypoint as %08X", entrypoint);