joern
joern copied to clipboard
ghidra2cpg - argument Index issue
I'm working with an ARM binary, and with the Joern version 1.1.385
I encounter the following issue. As you can see from the screenshots I have a sprintf
call where the second (2) argument is a Literal but if I try to access it in where clause nothing is returned (screenshot n°2). I think the issue is related on the number of arguments Joern identified, and subsequntialy this affect the argument index (screenshot n° 3).
Argument index is set to -1
and those result are obtained only if I access the first argument in the where clause.
The behaviour is completely different if you import some C code, the following two screenshot for comparison.
From binary (all arguments index are 1):
From source code:
Hi @zi0Black,
thanks for the issue. Can you share your binary or something that i can test against?
I guess it is an ARM 32bit binary?
I can't share the binary :(
If you can't reproduce it with a generic ARM binary, we can figure out how to share something useful.
Yes, it's ARM 32bit.
I'll try to reproduce the behavior with a random 32bit ARM binary.
This is not a complete fix but a step into the right direction: https://github.com/joernio/joern/commit/c6471d473c853238dde535ab1c66c4cef8ce2380