I don't think that the code went through a compilation stage as otherwise all those constants would have been folded before any decompilation. Even with the -O0 gcc/g++ option in play, I'd guess.bob wrote:It also looks like one compiled the preprocessor output, took the resulting assembly code, and decompiled it to produce C again. Most likely many of those "constants" were #defined in the source, but replaced by the resulting values during the preprocessing stage.sje wrote:That looks like someone ran some C/C++ source through the preprocessor and then placed the output into a new source file. There is no reason to do this other than to obfuscate the code. But why?bob wrote:Obviously not. Structure is one thing. The rather simple names and constants are a dead giveaway. For example, who dimensions arrays using hex subscripts? Who does this:That is one big constant. why 0x1440<<8 and not 0x144000??Code: Select all
UINT32 otsMAT[16] = { 0, ((0 & 0xff) | (0x1440 << 8)), ((1 & 0xff) | (0x240 << 8)), 0, ((1 & 0xff) | (0x24 << 8)), ((1 & 0xff) | (0x48 << 8)), ((3 & 0xff) | (0x04 << 8)), ((6 & 0xff) | (0x1 << 8)), 0, ((0 & 0xff) | (0xb640 << 8)), ((1 & 0xff) | (0x6c0 << 8)), 0, ((1 & 0xff) | (0x90 << 8)), ((1 & 0xff) | (0x120 << 8)), ((3 & 0xff) | (0xc << 8)), ((6 & 0xff) | (0x2 << 8)) };
Nobody writes source like that, as I said.
Of course, you're right in that no one codes like this. Again, why the obscuration? I just can't think of a legitimate reason.
