Joined: 09 Jun 2021 Posts: 1 Location: United States
Posted: Wed Jun 09, 2021 9:08 am Post subject: Increasing length of array of byte string corrupts memory
I've been trying to figure this out for quite a while now.
There's a certain string I want to change in a game's memory. I can make it shorter, as long as I add null bytes (00) to keep it the same length. The problem occurs when I want to make it larger. The reason I can't do this because the next string starts right after the first one, so increasing the length of the first would overwrite part of the second and corrupt the game memory.
It's very important that I find out how to increase this string's length without breaking the game, anyone have any thoughts?
Best thing you can do is change pointers to that string to your own allocated memory. This might crash the game if it tries to free your memory, so you might need to do a code injection instead. The instructions that access the string's characters are probably generic and access many strings: a better injection point might lie up the callstack. _________________
I don't know where I'm going, but I'll figure it out when I get there.
Joined: 09 May 2003 Posts: 25835 Location: The netherlands
Posted: Wed Jun 09, 2021 11:13 am Post subject:
find all references to the start of that string.
then allocate memory, write the string you like there, and then uodate all those references to point to your string
Note though that some stringlist references are indirect so you may have to do some debugging/disassembling to point it to the correct new address _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
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