Can exe or dll written by Rust be decompiled?


#1

Is it possible to decompile and get source code of programs written in Rust?
Thanks.


#2

It can in the same way that C can be decompiled.

Compilation loses information so you can never recover the original source code.

EDIT as @AndrewGaspar says, rust uses the same binary format as C, and by the time you get to LLVM bytecode, you in theory can’t tell if you’ve come from Rust or C.


#3

I don’t think there are any existing decompilers to Rust, but you should be able to use any C decompiler and still get usable results.