Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM
by vnorilo on Friday April 22, 2022 @06:16AM
(#31119943)
Some architectural/program assumptions may not be encoded in assembly or preserved in the asm -> C -> asm roundtrip, especially if the assemblers are for different architectures. The obvious example is pointer word size and memory model.
[ Parent
| on HN ]
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM
by josephg on Friday April 22, 2022 @06:28AM
(#31120011)
Rust might work reasonably well though, given its compiled with llvm. If not, I'm sure whatever asm structures llvm outputs for rust all have C equivalents.
I'd be curious to see the output! It'd be funny decompiling the rust compiler to C, then running it on another platform that way. (Though it would still be, for example, an x86 rust compiler running on arm).
Re:Snowman native code to C/C++ decompiler for x86/x86_64/ARM
by vnorilo on Sunday April 24, 2022 @08:40AM
(#31143425)
Strictly speaking all x86 MOVs would have to decompile to some level of atomic load/stores, because of the ordering guarantees on x86.
That's an example of "lost in translation" as we don't know if the original source required ordering or not. x86 cannot express the weakest memory model supported by C.