> I had to find names that would allow the variables to appear in the correct order. So after some trial and error, I wrote a small throw-away program that generated a bunch of variables with random names and ran that list of variables through the Turbo C++ compiler. Disassembling the generated .OBJ file showed me which order these variable names would produce
Nice puzzle!
Is the ordering the only thing that can be recovered from the binary? If the hash is available anywhere, it should be possible to brute force the exact original names.
If you throw away the debug info, and don't use any generated introspection magic, there's nothing preserved normally. Compiled C code doesn't need to know the names after all. There are various leaks though - for example asserts and other debug macros/prints often end up revealing the names.