hexeditorbuffer-overflow

Changing values in hex-editor properly


I want to change a file (.ULNC) and successfully did so in the past when the decoded texts i change have the same length or when the value I want to replace is bigger then the one i want to replace it with by filling the blanks with 00

Now I have the issue, that the opposite is the case and my "new" encoded text is a bigger length than the original one.

To be more clear: I want to replace 53 61 6D 48 51 5F 41 with 53 61 6D 44 69 76 69 6E 67 5F 41

what I want to change

Any help or hint would be greatly appreciated!

I tried just copying the value in like you see in the screenshot.

my attempt

HxD Hex Editor warns me, it will change the filesize. When I confirm, start the program and load the changed file, it causes a bufferoverflow and crashes.

I also tried... deleting some 00 00 00 00 in a place I thought they were not needed, the program then also crashed, this time without bufferoverflow warning.


Solution

  • I did it by shortening 53 61 6D 44 69 76 69 6E 67 5F 41 in the file it got originally referenced to 53 61 6D 44 69 76 69 and so kept the same byte size as 53 61 6D 48 51 5F 41. Works now.