Closed bannsec closed 4 years ago
As you use GCC 7 (mentioned in #11) the reason why you are getting runtime error is that the filesystem library was not linked during compilation (-lstdc++fs
) and therefore standard function was not found. I dug into the changes between the GCC versions and found out that the requirement to explicitly link the stdc++fs
library was removed only last year since version 9 (link to changes). This, however, means that anyone with GCC 8 (with support for C++17/filesystem) will get the same error as mentioned in here and this is surely not wanted. I think that the solution will be to link the library in the CMakeLists.txt anyway so that it won't cause the problem.
The reason why it crashed the r2 is that this is not a runtime treatable error and because this plugin is natively included in r2 it crashes the whole r2.
I was able to test and fix this issue with GCC 8. Can you please rebase onto the latest master
and test whether you are able to use pdz
command successfully?
It compiles and runs now. Thanks!
Great! So as this is solved in https://github.com/avast/retdec-r2plugin/commit/4219cd5526b830b6c1698335fce84f10472a3832 I am closing this issue.
I provided an addition for the commit https://github.com/avast/retdec-r2plugin/commit/4219cd5526b830b6c1698335fce84f10472a3832 (https://github.com/avast/retdec-r2plugin/commit/58a5389985391474f1c5eff90431301db66b62ba) because I have found out that the existence of the library (stdc++fs) is not enforced by the standard and newer clang
/GCC
might not have such library.
The result is that the cmake
will try to locate the library and if found then link it to the resulting binary.
When I attempt to use
pdz
to decompile a function, it immediately crashes radare2.Here's the bin:
challenge.zip