3 ms·
Man oh man. That would take a long time to figure out. Is this really the best a C decompiler can do?
by scotth 16y ago
Man oh man. That would take a long time to figure out. Is this really the best a C decompiler can do?
- viraptor 16y agoDepends how much you want to spend on it. Hex-Rays for example is pretty decent and not even comparable to the mess on github.
- updog 16y agoActually, the mess on github is hex-rays.
- viraptor 16y agoNot likely, unless it's some ancient version. See http://img715.imageshack.us/img715/1051/hexraysstx.png 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.
- updog 16y agoYep, you're right. I was accidentally talking out of my ass. Sorry :)
- mukyu 16y agohttps://github.com/Laurelai/decompile-dump/blob/master/output/log 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%3AappendTypeIdent%3A&btnG=Search+Code&hl=en&as_package=&as_lang=&as_filename=&as_class=&as_function=&as_license=&as_case= http://www.google.com/codesearch?as_q=WARNING%3A+CHLLCode%3A... http://boomerang.sf.net/ http://boomerang.sf.net/ is clearly what was used.
- DCoder 16y agoThis 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/ http://www.hex-rays.com/ [2] http://img824.imageshack.us/img824/1188/hexrayscpp.png http://img824.imageshack.us/img824/1188/hexrayscpp.png [3] https://github.com/Laurelai/decompile-dump/blob/master/output/1E17D81979271CFA44D471430FE123A5/1E17D81979271CFA44D471430FE123A5.c#L496 https://github.com/Laurelai/decompile-dump/blob/master/outpu...
- viraptor 16y agoIf 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 http://tuts4you.com/request.php?3011 (pass tuts4you)
- DCoder 16y agoThanks for the link! You were correct, the quality is noticeably better: https://github.com/Laurelai/decompile-dump/blob/master/output/016169EBEBF1CEC2AAD6C7F0D0EE9026/016169EBEBF1CEC2AAD6C7F0D0EE9026.c https://github.com/Laurelai/decompile-dump/blob/master/outpu... vs http://img715.imageshack.us/img715/1051/hexraysstx.png http://img715.imageshack.us/img715/1051/hexraysstx.png