New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues running cwe_checker #141
Comments
I ran into this issue very recently myself. The problem is that Ghidra generates a P-Code instruction Edit: Just to emphasize: The firmware image where I encountered this contained a lot of binaries with this problem, while other firmware images that I tested the cwe_checker on did not contain a single binary with this problem. So while it may seem like an issue with the execution environment, it is not! You can check that by running the cwe_checker on some regular x86-binaries. Oh, I am also interested in your experience in running the cwe_checker on Mac OSX. Since I don't have a Mac to experiment with I don't know whether a local installation of the cwe_checker would actually work at all. Have you tried that and want to share the results? |
sure, the ROUND pcode instruction gets generated for the ARM vcvt.s32.f64 function, which converts from signed 32 bit int to floating point 64 bit. In this particular case, socat is parsing a command line argument Running locally on Mac OSx I definitely ran into some quirks. For example, when trying to run cwe_checker, I kept getting errors about files not being found. I hacked up the source code to see what file it was expecting and it was looking for the config file in a strange location - I couldn't just symlink
but then I ran into the same issue when it came time to run the PCodeExtractor, more issues about a file not being found. So I just copied the whole directory to where cwe_checker was looking and that fixed it
Not a great solution but at least it worked |
Thanks for sharing your MacOS experiences! :-) I have opened a new issue in #142 for the incorrect lookup of the location of configuration files on MacOS. No promises on when I will have time to work on it though. |
Issue should be fixed now thanks to #143. My initial assessment was wrong, the Coincidentally, the P-Code generated by Ghidra still seems wrong to me, since your assembly instruction should convert fp64 to signed 32-bit integer, not the other way around. If I am correct, then the ROUND should be a TRUNC instruction. But this won't affect the cwe_checker in any case, we don't have analyses for floating point variables yet. Edit: I am closing the issue, but feel free to reopen if you still experience problems with the cwe_checker. |
Hi, I ran into a similar issue, but this time with FLOOR / FLOAT_FLOOR. (Probably happens with more of the FLOAT_* P-Codes)
|
Thanks for reporting it! We obviously do not have enough floating point arithmetics in our test cases... I will check all the floating point P-Code instructions this time, fix should be ready by monday. Edit: Fix is in the master branch. I checked all the P-Code instructions and it did also occur for CEIL / FLOAT_CEIL. But now it should finally be fixed for all P-Code instructions. |
Hi there,
I am very interested in this tool but am having some problems running it. I started off using the docker method and I get the following error:
The file type is a 32-bit Linux ELF for ARM:
I also tried building cwe_checker locally and running from there, but I get the same error. I tried digging in to see what was happening under the hood, and I see cwe_checker is calling the PCodeExtractor.java file. So I create a new project in Ghidra and run the PCodeExtractor.java file directly but I get the following error:
I get the same error using Mac OSX and Linux Mint. Any clue why I can't run cwe_checker?
The text was updated successfully, but these errors were encountered: