-
Notifications
You must be signed in to change notification settings - Fork 288
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
[Bug][JNI] Parse JNI functions in native layer #4923
Comments
You need to give c2cpg the path to the included files ( |
But joern can resolve JNI functions whose return value is JNI type without giving c2cpg any path to the included files:
Result:
So I suppose maybe it isn't an issue with the include-path? |
We simply use Eclipse CDT as a parser. If CDT is not able to parse it there is nothing we can do unfortunately. |
I tried a c2cpg standalone run with --log-problems and found the following issue:
It is too general to locate the bug. And I try to find information on 'CASTProblem' in joern's document but fail. I apologize for any inconvenience, but I would greatly appreciate it if you can provide some guidance. |
I am pretty sure the parser can't find the definitions for JNIEXPORT and JNICALL. |
Describe the bug
Fail to parse C code when a JNI function returns a non-JNI type
To Reproduce
The C Code:
Steps to reproduce the behavior:
./joern
importCode("path/to/c","name")
cpg.method.name.l
Expected behavior
Joern should correctly recognize the function
Java_com_termux_x11_XrActivity_init
and list it in the output ofcpg.method.name.l
.Output
joern cannot recognize function:
Java_com_termux_x11_XrActivity_init()
Desktop (please complete the following information):
Additional context
Other non-JNI type such as primitive data types will get similar results
The text was updated successfully, but these errors were encountered: