decomp-permuter
decomp-permuter copied to clipboard
Randomly permute C files to better match a target binary
Is this out of scope? Surely we can at least have some way of dealing with c++ features like casts and classes and certain c99 inherited features.
Possibly by adapting it for capstone in order to generalize other targets like ARM (GBA decomp, etc).
2 vs 2U vs 2.0f vs 2.0 can give similar but slightly different codegen. Should be done in a random region, ideally
Using randomization passes made especially for the purpose. E.g. ones that throw away unnecessary `if(1) {}` and expand vars with name `new_var*`.
Combining improvements would be a later step.
The latter does not obey the triangle inequality -- making a function match worse can improve the score by breaking parts that are accidentally the same between source/target and thus...
Currently in the randomization code we track node locations by traversing the AST in preorder, and giving every node an index. We should extend that to record every node's start...