This was usually done to overcome some performance bottleneck but with today's hardware you might not need that at all.
Disassembly is a much easier task than decompilation, since it's a mostly mechanical process. Decompilation requires you to undo the optimizations/transformations the compiler did as it generated the binary, which is much harder.
That said radare2 is still cool, and a GUI (Cutter) is in the works.
They refused to sell it to me, unless I bought the standard version and used that for a year (which in retrospect, I perhaps should have done)
I can't be the only one!
Nobody comes along and points out that in Spanish the "g" works differently, and it bugs them to see words with "g" in them.
It's one thing to do faux-Cyrillic and get the letters wrong. It's quite another to do something silly to a latin letter, and get complaints that it resembles a non-latin letter.
https://software.intel.com/en-us/articles/intel-tamper-prote...
Contemporary obfuscators _rewrite_ the protected code as a series of instructions executed on a virtual machine whose bytecode (and bytecode semantics!) are randomly generated at build time. The solution (AIUI) is symbolic execution of the instructions to determine their underlying architectural effect, synthesize some compiler IR that is equivalent to those effects, run an optimization pass (like a regular compiler) over that IR, and finally generate x86 from the result.
The optimization passes are necessary to remove side effects that do not impact the state of the program ("noise"), which modern obfuscators like Themida insert a ton of into the instruction stream
In other words, rather than attempt to dump some particular part of the program, the binary as a whole is statically analysed to determine, regardless of the indirections inserted by any obfuscation pass, what machine instructions are ultimately executed for a given program input. The abstract representation is then compiled to an equivalent new program which is much easier to read, because all of the indirections and noise have been optimized away.
When I was reading about Rolles' work initially, I couldn't help but imagine this is the kind of approach Geordi La Forge would have come up with if cracking an encrypted binary were ever the plot for an episode of Star Trek :)
Like the one built into Windows: https://github.com/airbus-seclab/warbirdvm
Breaking it involved monitoring the memory for the decrypted instructions, and dumping them right before they were executed. I don't remember if there were any additional complications with stuff like conditional jumps.
These slides linked in the above looks like this was a really fascinating talk.
Does anybody know when or if this presentation was recorded or if it will be made available? I would love to watch this.
It looks like some conference presentations from years past have made it to youtube.
Most malicious code is still written in 32-bit since 64-bit Windows supports running 32-bit code.
Write something in 32-bit - target 100% of devices. Write something in 64-bit - target ~50% of devices.
https://www.reddit.com/r/programming/comments/7jhk6p/avast_o...
x86, ARM, MIPS, PIC32, PowerPC, but not x86-64. Impressive list, but an odd choice.
Although, there's no way an AV company doesn't have its own disassembler, but those are almost always treated as trade secrets (especially the stuff that isn't in the spec / the spec is wrong). They'll probably hook it up to that before doing any real work with it themselves.
They've been working on this for 7 years they said so I don't think it counts as just a PoC.
[wild speculation here] I suspect they're using llvm to go from an ast to c(++) code since they have tooling for stuff like that.
Now I have to find me a binary-blob kernel module that manufactures like to put out and see what the C code it spits out looks like -- another wasted day methinks...
Capstone would probably be the best open-source choice for something like this though.
$ loc .
--------------------------------------------------------------------------------
Language Files Lines Blank Comment Code
--------------------------------------------------------------------------------
C++ 587 202592 23441 43727 135424
C/C++ Header 450 34934 6371 11733 16830
Bourne Shell 10 2363 247 518 1598
Plain Text 16 827 46 0 781
Autoconf 1 2507 551 1635 321
Python 1 195 32 22 141
Markdown 2 162 45 0 117
ASP.NET 2 2 0 0 2
--------------------------------------------------------------------------------
Total 1069 243582 30733 57635 155214
--------------------------------------------------------------------------------I don't understand what you're trying to say. The usual... what?
Maybe in the form of a forum badge or certificate like pdf.