avast / retdec

RetDec is a retargetable machine-code decompiler based on LLVM.
https://retdec.com/
MIT License
8k stars 946 forks source link

Can't decompile "cheatengine-i386.exe" due to segmentation fault in "signed/unsigned types fixing" #80

Closed MerovingianByte closed 6 years ago

MerovingianByte commented 6 years ago

So I was trying to decompile some open source programs with retdec, in the hopes to find some it couldn't decompile and report it here. Cheat Engine is one of them. But this time it didn't run out of memory, everything was going fine until a segfault happened:

Running phase: removing functions prefixed with [__decompiler_undefined_function_] ( 1301.73s )
Running phase: removing functions from standard libraries ( 1347.88s )
Running phase: removing code that is not reachable in a CFG ( 1347.89s )
Warning: [NonRecursiveCFGBuilder] there is no node for an edge to `break` -> skipping this edge
Warning: [NonRecursiveCFGBuilder] there is no node for an edge to `v3_4f6a61 = *(v2_4f67a7)` -> skipping this edge
Running phase: signed/unsigned types fixing ( 1361.01s )
./decompile.sh: line 947:  6476 Segmentation fault      $LLVMIR2HLL "${LLVMIR2HLL_PARAMS[@]}"
Error: Decompilation of file '/c/Users/kasdas/Downloads/retdec2/bin/cheatengine-i386.c.backend.bc' failed
s3rvac commented 6 years ago

Thank you for the report. This is the same problem as in #47 and #64. Currently, there are two workarounds available. They are both described here.

We will need to investigate whether the binary file is too big to be decompiled, or whether there was a decoding error, or try to reduce memory requirements of the decompilation process. For now, I am closing this as a duplicate of #47 and #64.