That said... I wonder how useful would github be as a collaborative decompilation space - grab a file, annotate / simplify as much as possible, send pull request, repeat...
Does anybody have a good reference for how decompilers work? When converting assembly to C by hand I always went through multiple passes (not necessarily in this order): first a literal pass that looked a lot like this dump with gotos and variables named after registers, then I'd identify if/else and switch blocks, then I'd convert any reverse gotos into a while loop, convert while loops into for loops, identify data structures, duplicate lines that had been optimized to a single reference with jmps, etc.
Also, you have specific idioms for popular compilers (vc, gcc, icc, borland) and value propagation. You could even include an SMT solver to identify constraints and propagate the range to child basic blocks.
http://www.zynamics.com/bincrowd.html
The plugin is open source and the community server is free.
if (*(int*)(local2 + global0) == 0x4550) {
local5 = *(unsigned short*)(local2 + global0 + 20);
Either local2 or global0 are pointers to a structure. Neither is detected. Most sensible decompilers would change the names and just make it `local5 = global0[local2].blah` instead. Advanced decompilers also can avoid gotos in almost any case. It also uses function calls without parameters or output, assuming some stack layout probably.It's a really really bad output, not a result of obscured compilation.
Stating the function type explicitly also helps it display the right arguments given to it. This output could be significantly improved if the assembly version were available as well.
Truly obfuscated code will just plain cause the Hex-Rays decompiler to crash, producing absolutely no output at all.
You can certainly get Hex-rays to output confusing information on purpose without actually targeting it. If this was obfuscated, you'd expect that would be much more likely.
The idea works well enough if you just want get optimized asm though. http://events.ccc.de/congress/2010/Fahrplan/events/4096.en.h...
*(int*)local6 = *(int*)local5;
local5++;
local6++;
Either the memcpy code is strangely broken, or the decompiler is putting int * where it means char *.[¹] See full code at https://github.com/Laurelai/decompile-dump/blob/master/outpu... and same for proc20: https://github.com/Laurelai/decompile-dump/blob/master/outpu...
what does that even mean? nonsensical.
"Here are some emails that show this company was planning to use Stuxnet"
Stuxnet is a distributed bot. It can be commanded. The post is saying this company planned to do that.
I don't know whether that's true or not but it seems easy to understand.
Unfortunately, the decompiler output doesn't convey much as it stands, unless you like sorting through pages and pages of
That being one of the more interesting sections; there are stretches with dozens of lines in a row of the form "localfoo = localbar".It does seem to suggest, at least, that this dump didn't have the actual source.
[1] http://crowdleaks.org/hbgary-wanted-to-suppress-stuxnet-rese...