News for hackers. Stuff that matters.
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by kubb on Friday April 22, 2022 @06:04AM (#31119885)
How about this for an idea: a decompiler that uses Machine Learning to name the decompiled variables and functions. Would be nice even if it worked only sometimes.
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by kuroguro on Friday April 22, 2022 @07:32AM (#31120366)
For an AI-less solution there is IDA's Lumina which works pretty well. There's also a reverse engineered server for it [0] so you could build plugins for other disasemblers/decompilers to use with non-official servers.

It basically hashes machine code (with address parts removed) [1], then when reverse engineers label and push symbols to the server (or get them from some debug build), others can pull and see what the functions are called in completely unrelated projects, that use the same libraries / have the same functions.

[0] https://abda.nl/lumen/ [1] https://github.com/naim94a/lumen/issues/2

Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by Andoryuuta on Friday April 22, 2022 @05:16PM (#31128257)
I'm surprised nobody has mentioned DIRE[0] yet. They did exactly this and got some very impressive results.

[0]: https://arxiv.org/abs/1909.09029 / J. Lacomis et al., "DIRE: A Neural Approach to Decompiled Identifier Naming," 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE), 2019, pp. 628-639, doi: 10.1109/ASE.2019.00064.

[1]: https://github.com/pcyin/dire

Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by efferifick on Saturday April 23, 2022 @02:02AM (#31131821)
This is awesome! Thanks for sharing!
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by glouwbug on Friday April 22, 2022 @01:55PM (#31125465)
It's certainly possible - Compile all the C projects on github with `gcc -O0`. Map statements, blocks, or functions to ASM output. Put everything in a giant SQL. Repeat for all of gcc's compiler flags.

Wait, did I say it was possible? I'm curious what a neural netted compiler would produce. Probably your average CRUD software.

Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by azinman2 on Friday April 22, 2022 @01:59PM (#31125533)
The thing is a classifier is going to classify. So it’ll create _some_ name… but will it be correct? Useful? Or just completely misleading? I think the misleading bits can be worse than no name at all.

Better would be a high level description of what’s happening. I have a feeling that would be easier to achieve.

Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by efferifick on Friday April 22, 2022 @11:33AM (#31122887)
Something very similar: a "decompiler" that decompiles minified javascript and guesses variables and functions: http://www.jsnice.org/
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by planede on Friday April 22, 2022 @06:30AM (#31120015)
It's also something that could be somewhat easy to get a lot of learning material for.
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM by efferifick on Friday April 22, 2022 @11:36AM (#31122925)
Yes, but the problem is learning through the graph data. I.e., it is not a well-structured problem like an image which will always have a certain size in pixels. Coming from a compiler background I am genuinely excited about the research on learning how to label nodes and edges in graphs, but I know little about the challenges in the ML side to bring this kind of technology into reality.