xoreaxeaxeax / movfuscator

The single instruction C compiler
Other
9.53k stars 398 forks source link

rand.py does not include all available post processing steps #12

Closed kitlith closed 5 years ago

kitlith commented 7 years ago

rand.py only reimplements adc, add, andor, rrrrr, sub, sbb, and xadd. This is missing xor, push/pop, cmpxchg/xchg, etc. To be fair, though, I don't expect every post processing step to be usable in such a random matter, such as xor, due to it manipulating state in a way that other instructions wouldn't be able to immediately compensate for. If one could preform a sequence of operations to bring it back to a usable state by other post-processing steps, though, then it could be added. (don't take my word for it, please, I'm just thinking out loud)

The other possibility would be modifying the existing compiler to keep track of ways to compensate for mixing these instructions. Going to rule that out for now, as that would be a new compiler, not a modification of a post-processing step.

Idealy, there would be no duplication of these implementations, either. This could be accomplished by turning each possible post-processing step into a module, which does the expected thing when run as a program, and exports a function implementing the post-processing step afterwards. Possibly adds it to a global array, if it exists.

Though, I don't expect this to happen. Just thinking too hard, too loud.