News for hackers. Stuff that matters.
Re:Movfuscator: A single-instruction C compiler by userbinator on Friday August 07, 2015 @09:57AM (#10022475)
I also remember seeing a "forest of MOVs" obfuscation technique attempting to crack a protection back in the very late 80s, and I remember it so well because it caused me to change my analysis strategy completely. The fun part was that the "interesting" MOVs were hidden amongst other instructions that seemed to perform useful computation, although the results of that were just thrown away and the MOVs were doing all the work. At the time I was fond of printing out code and inspecting/annotating it manually, so I think it took several days and lots of careful documenting of the algorithm before I realised that it was all useless; and upon tracing back the source of the actual value used in the decision and crossing out the irrelevant instructions, imagine my surprise when almost all that was left were MOVs...!

That one taught me it was far better to start by working backward from the result, although self-modifying code tends to be more difficult that way.

Re:Movfuscator: A single-instruction C compiler by thesz on Friday August 07, 2015 @10:01AM (#10022507)
And this is exactly why traces are better than assembly. You see instructions that were executed, not the code. You can restore the decision tree (and then the graph, most probaly) and figure out what is going on.
Re:Movfuscator: A single-instruction C compiler by _pmf_ on Friday August 07, 2015 @10:43AM (#10022752)
> And this is exactly why traces are better than assembly. You see instructions that were executed, not the code. You can restore the decision tree (and then the graph, most probaly) and figure out what is going on.

Do you have some illustrative example?

Re:Movfuscator: A single-instruction C compiler by nialo on Friday August 07, 2015 @11:31AM (#10023029)
I think a good example is the last level (Hollywood) from www.microcorruption.com, which has self modifying code and is set up such that the actual execution jumps into the middle of what the disassembler thinks are actual instructions. Reading the code is pretty useless, but with a trace of instructions executed and register state at each instruction it's easy to start at the end and follow backwards to the interesting part of the program.

Getting the trace is the tricky bit, I had to write an msp430 emulator.

(Actually seeing this example requires completing the rest of the levels, but you should do that anyway, especially if this is the sort of thing you're interested in)

Re:Movfuscator: A single-instruction C compiler by thesz on Friday August 07, 2015 @10:52AM (#10022787)
Not right now.

Let me hypothetically apply movfuscator to some not too complex program and look at the assembly. I believe I'll get nothing useful from it, which is fair. But if I trace the program, I can get some useful results - like filling some array with data (increase of the addresses accessed), looping over indices (accesses within some range), see through generated code (table lookups here and there are identical), etc.