This project focus'd C, but usimg LLVM.
So, can we use movfuscator when if we create LLVM frontend for Rust?
Rustc uses LLVM as backend by default. There are other backends, but they can't be used on stable yet.
You could try compiling your code with -Clto=yes --emit llvm-bc
and then pass the resulting LLVM bitcode to llc
to convert to C. Make sure to use a version of llc
at least as new as the version of LLVM used by rustc, which is currently LLVM 15. In addition there are a couple of symbols which are defined in the so called allocator shim, which --emit llvm-bc
omits, so you may get an error about missing symbols. In particular the following functions: rust/alloc.rs at 151a070afe09c0c844e8d9af98a20fee56a5a7f2 · rust-lang/rust · GitHub They need to be forwarded to the same function except with __rdl_
instead of __rust_
as prefix, unless you use #[global_allocator]
, in which case the prefix to use is __rg_
. In addition __rust_alloc_error_handler
should forward to __rdl_oom
and __rust_alloc_error_handler_should_panic
should be a single byte static with the value 0. Note that all of this is unstable implementation details. It can and will change between versions, but it is fine for toy projects.
Thank you for your replay.
I will try it.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.