Posted: Fri Dec 09, 2022 12:23 am Post subject: Finding the address of and changing a static value
I have a unit, this unit takes damage from fire. I want to find out where in the executable is this value stored, so that I can use a hex editor to change it later.
From searching for a bit, I understand that I need to find the unit's health address, attach a debugger to it, damage it using fire, add the instructions which come up to my codelist and analyse them... but this is where I get stuck, I somewhat understand what the code is doing, but I have no idea what to look for.
I want to find out where in the executable is this value stored
That's not how it works. Most values are located in dynamically allocated memory, and even if this is a rare exception, modifying mutable static memory on disk probably won't do what you think it will in this case.
If you know how to read and write assembly, you can change it to do what you want. Be weary of instructions that access multiple values (right click in disassembler -> "Find out what addresses this instruction accesses"). Assuming the code that writes to the value is in the exe (not always the case) and the exe isn't packed with some kind of protection, then sure, you can modify the exe to permanently reflect those changes. _________________
I don't know where I'm going, but I'll figure it out when I get there.
I see this done on the same game, just a single value that is changed using what's essentially an automated hex editor to change unit stats, in this case I would want to change their fire resistance but the addresses for it (if it's actually this simple, but I don't see why wouldn't it be) aren't known.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum