Open 0xricksanchez opened 3 months ago
I have a similar issue with symbols containing debug information. Particularly with C++ functions that are non-static. For example, the following is supposed to have a this
pointer, but because the symbol has no arguments, it assumes no arguments. I'm not sure if this is a different issue, I think it's the same underlying problem. I think the analyser should use this as a guide and not as definitive information.
Recovering function arguments is a fundamentally undecidable problem so there are bound to be errors especially in regard to un-typed external calls. That said there are likely ways we can improve our analysis to provide more accurate parameter recovery. We are unlikely to address this in the short term.
Version and Platform (required):
Bug Description: Analysis of the mentioned aarch64 binary fails to properly resolve the correct amount of function arguments for certain functions
Steps To Reproduce:
libckteec.so
from the linked issueckteec_invoke_ta
TEEC_InvokeCommand
and observe the function call in MLIL and higher lifted variants → (compare 1st screenshot)Another instance where there are too many function arguments:
ckteec_invoke_init
TEEC_InvokeCommand
again → (compare 2nd screenshot)Expected Behavior:
Based on the OPTEE client impl the function should look like this:
Screenshots/Video Recording:
Additional Information: Related issue that contains the binary that I was testing with: #5809
The linked issue (also reported by me) was dealing with some functions not properly propagating function arguments even if the registers are clearly setting them up, esp, for external functions as it seemed. After the merged fix, this new behavior was observed on the same binary.