in reply to how do I swap 2 strings in a file?

This may be a total red herring, but it worked when I debugged command.com to say goofy things, so it's probably got some grain of truth to it.

In some executables under dos, before a string, will come a byte which describes the length of the string. e.g. before "hello" will be 0x05. If you swap out "this program doesn't do DOS, baby!" for "hello", the dll may think the string is only 5 chars wide -- "this " -- and take "p" to mean 0x70, for a string 112 chars wide, allowing the DLL to mistranslate the remnant of the string, and possibly various other strings, code and whatnot as part of a string that shouldn't exist.

Replies are listed 'Best First'.
Re: (Boo)Re: how do I swap 2 strings in a file?
by converter (Priest) on May 08, 2001 at 23:24 UTC
    If I remember correctly, most executables compiled with Pascal will have this length byte at the head of each string.