Re:Reverse Engineering Snapchat: Obfuscation Techniques
by q3k on Thursday June 18, 2020 @07:01AM
(#23561897)
We cannot have _the_ source, but we can have a good enough approximation of it, especially if a human is in the loop (see: commercial decompilation software like the Hex-Rays decompiler, Binary Ninja, and even Ghidra).
[ Parent
| on HN ]
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by pfundstein on Thursday June 18, 2020 @07:19AM
(#23561989)
The point is that we cannot automate reversing these obfuscation mechanisms the same way we cannot automate reversing a binary file to a higher level than assembly.
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by Andoryuuta on Thursday June 18, 2020 @07:37AM
(#23562083)
This not quite true, especially with current state-of-the-art tools like Ghidra, IDA pro (with Hex-rays), etc.
In fact, Rolf Rolles wrote a wonderful guest post[1] for the Hex-Rays blog about automating the reversal of this exact obfusactor, though he wasnt aware of it's origins at the time.
[1]: https://www.hex-rays.com/blog/hex-rays-microcode-api-vs-obfu...
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by 3eed on Thursday June 18, 2020 @08:01AM
(#23562230)
All these are great programs, but none of them can understand that level of obfuscation so far. As stated in the post, both Ghidra and IDA interpret the very first block in any of the obfuscated functions, which ends with an indirect branch, as a complete function in and of its own. Because this is the usual case, indirect branches AKA tail calls terminate a function to start another, all with the same stack frame.
EDIT: also keep in mind the CFG isn't flattened here.
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by underdeserver on Thursday June 18, 2020 @09:46AM
(#23563034)
I think the idea is that Ghidra's and IDA's plugin systems allow for manipulation of binaries at a level that allows writing deobfuscators over them.
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by QuickReply on Thursday June 18, 2020 @10:02AM
(#23563190)
inside developer console:
Array.from(document.images).forEach(img => console.log(img.src= img.src.replace("http://hexblog.com", "https://hex-rays.com")));
to make the blog readable
Re:Reverse Engineering Snapchat: Obfuscation Techniques
by underdeserver on Thursday June 18, 2020 @07:50AM
(#23562166)
Exactly. Such tools are definitely possible, even if they rely on Ghidra or IDA's plugin systems.
What I like is the economics of the idea that one company can build an obfuscator, and then another company can build an anti-obfuscator which completely nullifies the value proposition of the first company.