Open hushenwei2000 opened 3 weeks ago
I'm sorry. I found the problem because I didn't follow the newest tutorial : https://docs.rev.ng/user-manual/analyses/. That works on the new tutorial site.
But I found another 2 problems.
1) When I use revng translate -o example.gen.out example
and ./example.gen.out
it has error :
[orchestra] (base) bash-4.2$ ./example.gen.out
Exception: __libc_start_main ({ 0x0, 0x0, 0x0, 0x0 }
-> { 0x0, 0x0, 0x0, 0x0 }
)
Aborted (core dumped)
2) Besides, when I try revng lift example example.gen.ll
and /llvm-16.0.1/bin/clang example.gen.ll
, it has lots of undefined error:
[orchestra] (base) bash-4.2$ llvm-16.0.1/bin/clang example.gen.ll
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot open Scrt1.o: No such file or directory
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot open crti.o: No such file or directory
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot open crtbeginS.o: No such file or directory
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot open crtendS.o: No such file or directory
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot open crtn.o: No such file or directory
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot find -lgcc
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot find -lgcc_s
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot find -lc
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot find -lgcc
/opt/BinaryTranslation/bt-tools/revng/root/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39/ld: error: cannot find -lgcc_s
/tmp/quicksort-6e1460.o:null:function rcu_init: error: undefined reference to 'pthread_atfork'
/tmp/quicksort-6e1460.o:null:function qemu_mutex_init: error: undefined reference to 'pthread_mutex_init'
/tmp/quicksort-6e1460.o:null:function rcu_register_thread: error: undefined reference to '__assert_fail'
/tmp/quicksort-6e1460.o:null:function error_exit: error: undefined reference to 'stderr'
When I use revng translate -o example.gen.out example and ./example.gen.out it has error :
Please attach the binary you're translating. Please consider that we no longer focus that much on static binary translation, but simple examples should work.
Besides, when I try revng lift example example.gen.ll and /llvm-16.0.1/bin/clang example.gen.ll
You can't directly compile the output of lift. revng translate
or revng artifact --analyze recompile
is the right workflow.
For the first problem, I just translated the example from the tutorial. The source code is:
int main(int argc, char *argv[]) {
return argc * 3;
}
I think the translation result is correct, but I don't know what's wrong with my machine. If you haven't met this problem before, that's fine, I will try to figure it out by myself; thanks a lot.
Bug reports must always attach the binary, explaining how to rebuild the binary is problematic.
Please attach the binary.
OK here are the binaries. The example
is I compile the source code by gcc example.c
and theexample.gen.out
is the rev.ng translated result. When I run example.gen.out
it will cause Exception.
https://drive.google.com/drive/folders/1dLoAXYtwchly7k3tx18tW9TmRzSH_tXK?usp=sharing
I followed the tutorial for installation in https://rev.ng/blog/open-sourcing-renvg-decompiler-ui-closed-beta. After installation, in this site has an example that says:
I follow this, and there is no error, but my
decompiled.c
is: