4 ms·
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
by DCoder 16y ago
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/ 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