Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Modify strings of executable file (Windows)

I need to increase the length of a string inside a binary, but I keep running into issues. Here’s what I’ve tried so far:
1. Replacing the string while keeping the same length - it works fine as long as the new string is the same size as the old one.
2. Shortening the string - it also works if I replace unused space with 00.

Heres what i tried:
I wrote simple hello world in C.
The target string was "Hello, World!" (in hex 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21)

I changed it via HxD to:
48 65 6C 6C 6F 2C 20 57 6F 00 00 00 00
It resulted in "Hello, Wo" (since \0 terminates it).
The program printed "Hello, Wo", which I expected

The problem comes when I increase the string length. If I change original string to this:
48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 21
(added an extra "!"), the program just refuses to run.

It seems like I’m overwriting something critical, or the binary expects a fixed size.

How do I properly increase a string’s length in an executable without breaking it? Is this even possible?


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Arnau97Oct 2, 2024 11:12 AM 4 292 Oct 2, 2024 11:12 AM
Last Post: SovietBastard
by typhoonMar 8, 2024 01:50 AM 6 328 Mar 8, 2024 01:50 AM
Last Post: notagh0st
by GlassWallSep 19, 2023 02:18 PM 0 221 Sep 19, 2023 02:18 PM
Last Post: GlassWall