Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Man oh man. That would take a long time to figure out. Is this really the best a C decompiler can do?


This looks like the output of HexRays [1], which is the best C decompiler I've seen. Defining some structures and typing the variables would make it a lot more readable in some cases. I've used HexRays to make sense of C++ games several times, after investing enough time to define and use data types, the result looks [2] much better, but then again, that's unobfuscated and not optimized C++, not old-school "I know what I'm doing and I don't need the compiler second-guessing me" C.

Unfortunately there's still a lot decompilers can't do, mostly compiler tricks (e.g. storing a pointer to the middle of a structure instead of its beginning, and using negative offsets to access other struct members [3] - this is usually obvious when looking at it, but HexRays can't make sense of it so it falls back to raw pointer math).

[1] http://www.hex-rays.com/ [2] http://img824.imageshack.us/img824/1188/hexrayscpp.png [3] https://github.com/Laurelai/decompile-dump/blob/master/outpu...


If you have it installed at the moment (I don't unfortunately), you can always give it a go for comparison... The binary is apparently available from http://tuts4you.com/request.php?3011 (pass tuts4you)



Depends how much you want to spend on it. Hex-Rays for example is pretty decent and not even comparable to the mess on github.


Actually, the mess on github is hex-rays.


https://github.com/Laurelai/decompile-dump/blob/master/outpu...

"WARNING: CHLLCode::appendTypeIdent: declaring type void as int for param2"

http://www.google.com/codesearch?as_q=WARNING%3A+CHLLCode%3A...

http://boomerang.sf.net/ is clearly what was used.


Not likely, unless it's some ancient version. See http://img715.imageshack.us/img715/1051/hexraysstx.png posted above - that's hex rays. Not sure which one was used, but 1.1 gives similar output.


Yep, you're right. I was accidentally talking out of my ass. Sorry :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: