News for hackers. Stuff that matters.
Re:The rev.ng decompiler goes open source by saagarjha on Friday March 29, 2024 @05:28AM (#39862105)
Curious what you do when you encounter an instruction you don't model
Re:The rev.ng decompiler goes open source by aleclm on Friday March 29, 2024 @05:35AM (#39862136)
That's unlikely, since we use QEMU as a lifter, which sometimes supports new instructions before they hit silicon.

However, I think we'll emit a call to some `noreturn` function. Basically we emit a call to `abort`.

Re:The rev.ng decompiler goes open source by saagarjha on Friday March 29, 2024 @05:46AM (#39862205)
Right but you do see how this means that you need to lift code that has semantics that cannot be modeled in C?
Re:The rev.ng decompiler goes open source by aleclm on Friday March 29, 2024 @06:13AM (#39862357)
Sure, in those cases we emit calls to C functions. The only thing we need to know is what registers are taken as input, what registers are output and what registers are preserved.

In QEMU parlance, these are helper functions, and they have actual implementations. But for decompilation purposes, you don't need to implement them. You just need to know how they interact with the registers.