How to increase letters in a file without harming it

Help on how to use HxD.
Post Reply
Morph
Posts: 1
Joined: 18 Oct 2010 06:03

How to increase letters in a file without harming it

Post by Morph » 18 Oct 2010 06:05

What I'm asking is how do you increase the amount of characters you can use when Hex Editing something, IE an Executable type file without harming it. Everytime I add more it doesn't launch correctly. I can't replace the limit inside the Executable, because it's too little for what I'm trying to replace it with. Please tell me if there is a solution, thanks.

Maël
Site Admin
Posts: 1124
Joined: 12 Mar 2005 14:15

Re: How to increase letters in a file without harming it

Post by Maël » 20 Oct 2010 19:36

Morph wrote:What I'm asking is how do you increase the amount of characters you can use when Hex Editing something, IE an Executable type file without harming it.
An executable has an internal structure, where parts refer to other parts. Those references are based on distances, like part B is 100 bytes apart from part A. So if you delete or insert bytes, and don't adapt the distances the references point to wrong locations, and the executable gets corrupted.

If you know where those references are you can adapt them to account for the inserted bytes, but that's pretty tricky with executables without some support of the tool to locate those references. If the strings are stored as resource strings you can use a resource editor to change the executable without breaking it. That assumes though, the executable isn't protected against such changes.

So the general answer is, you have to know the file structure to be able to extend/shrink it without breaking it, or you need a tool that knows the file structure. For executables this would be a resource editor, for files an imaging program etc.

Post Reply