Can angr ignore function calls?
See original GitHub issueExample:
push eax
push ebx
call some_func
test eax, eax
jne 0xxxxx
I do not want angr to execute the some_func
body, so angr can skip it?
thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Handle function calls during static analysis in angr
On the research project I work on at SEFCOM, I use angr to statically analyse binary programs.
Read more >Analyzing Functions - Breaking Bits - GitBook
Calling functions to trace or find bugs angr provides a callable interface to either concretely or concolically run functions. The current documentation on...
Read more >Gotchas - angr Documentation
1. Disable the SimProcedure (you can exclude specific SimProcedures by passing options to the angr.Project class) ...
Read more >Program State - angr Documentation
This method will perform one step of symbolic execution and return an object called ... SimFile) # ignore that argument for now -...
Read more >Analysis and Coordination — angr 9.2.30 documentation
ignore_functions – A list of function names that, when imported from shared libraries, should never be stepped into in analysis (calls will return...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Obligatory warning that may not apply in your case: Depending on the calling convention, skipping function calls can result in the stack pointer becoming corrupted.
For example, in your example there are two
push
es before thecall
. If the callee is responsible for cleaning up the stack (e.g.,ret 8
) then simply NOPing out the call instruction with an empty hook will cause the stack to become corrupt. The correct thing to do in that case is to stub the function with a SimProcedure while specifying the calling convention.@rhelmot has some code that can help to automatically detect calling conventions. In particular it will attempt to determine the size of the stack that the callee will cleanup before returning. It is mostly helpful when stubbing functions in a Windows binary. It works very well. The only discrepancy I have had was for a function in a dll that takes one of two paths: It either returns to the caller, or calls a function that does not return. This is more of a CFG problem though.
would you provide an example code?