1
0
mirror of https://github.com/angr/angr synced 2026-06-08 13:09:39 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
Fish e13adc02cd Function.prototype: Automatically set arg names when missing. (#6050)
* Function.prototype: Automatically set arg names when missing.

* Support setting None to Function.prototype.
2026-01-26 06:04:57 -05:00
Fish a31f3df8f7 FunctionManager: Spill to external storage. (#5976)
* FunctionManager: Spill to external storage.

* Remove atexit registration. Reduce map size.

* Introduce FuncNode in function graphs; Fix multiple issues with SpillingFunctionDict.

* Implement Function.dirty.

* A bit more optimization.

* FunctionManager loads only meta data for functions when graphs are not accessed; Save .info for functions.

* Only load meta data for Functions in more places.

* Remove FunctionManager.block_map because it's never really used.

* Retire blockaddr_to_function and replace it with blockaddr_to_funcaddr.

* More optimizations and fixes.

* More refactor and fixes.

* More optimizations.

* Fix the bug in lmdb spilling after raising MapFullError.

* Introduce RuntimeDb in KB. Migrate SpillingFunctionsDict to use RuntimeDb.

* Prioritize the basedir of the main executable for the runtime db path.

* Cache non-returning function addrs, unknown-returning function addrs, and function block count in FunctionManager.

* Bug fixes.

* Fix a bug in FunctionParser.

* CFGBase.make_functions: Copy over function metadata when creating functions in the first place.

* Update MockFunctionManager.

* Type check codenode.py and fix an RDA test case.

* Fix serialization tests; Introduce KnowledgeBasePlugin.set_kb(); SpillingFunctionDict now derives from UserDict; Fix KB.name stored in KB._plugins; Fix FunctionDict.__setstate__ swapping Function objects and function addresses.

* Update FactCollector to support FuncNode.

* FunctionInfo: Update Function.dirty and perform type checks on keys and values.

* Make function cache limit configurable.

* Adjust FunctionInfo type check.

* More fixes.

* More updates to account for FuncNode in function graphs.

* Update a test case.

* Fix another test case (do not use the size of FuncNodes).

* Fix Reassembler.

* CFGBase.make_functions: Add a missing insertion to _updated_nonreturning_functions.

* Update FunctionManager.rebuild_callgraph.

* FunctionParser: Call destinations must be FuncNodes.

* Serialize Function.is_default_name.

* Minor fixes.

* Fix CFunctionCall._is_target_ambiguous.

* Mark evicted Function instances as evicted.

* HashLookupAPIDeobfuscator: Take a list of function addresses instead of Function instances as arg.

* CC_NAMES: Fix the bug of missing SimCCCdecl.

* FunctionParser: Fix missing syscall function nodes.

* HookNode: Take a SimProcedure instance instead of the class as the sim_procedure argument.

* FunctionParser: Consider return-type edges when deserializing.

* SimTypeCppFunction: Fix to_json() serialization crash.

* FunctionParser: Fix missing return sites.

* Function.is_{syscall,simprocedure,alignment,plt} settings should mark the function dirty.

* RDA: Do not create blocks for FuncNodes or HookNodes.

* Update a test case.

* Fix issues with SimCppClass.to_json.

* HookNode: Fix HookNode.__eq__.

* Fix SootFunction.

* Lint function_manager.py.

* Lint and type check.

* More docs; Spill Function.ran_cca.

* RuntimeDb: Support specifying base dir using an environment variable.

* Lint and fix test cases.
2026-01-12 19:58:18 -07:00
Kevin Phoenix ee464d0338 Adopt from __future__ import annotations (#4790) 2024-08-28 18:31:43 -07:00
Yan Shoshitaishvili 6222a6cd44 Support inlining of callees during decompilation (#4595)
* rename functions_callable to functions_reachable

rename functions_callable to functions_reachable

* fix operator for Constant.__sub__

* print hex address of Function

* support multiple blocks with the same address in StackCanarySimplifier. This happens when doing inlined decompilation

* support specifying initial register values in the StackPointerTracker for inlining functions onto stacks of other functions

* add a StackPointerTracker method to retrieve all offsets of a register

* move stack pointer analysis later, in preparation of pre-inlining refactor

* split decompilation process in preparation for inlining logic

* inlined decompilation!

* testcase for inlined decompiler

* support spilled (e.g., callee-saved) register simplification in the inlined callees

* fix variable reference issue due to duplicated blocks (triggered via inlining)

* Fix more type annotations in clinic.py.

Co-authored-by: Fish <fishw@asu.edu>
2024-05-24 15:31:33 -07:00
Matt Borgerson 883f08fcd8 tests: Fixup shebangs, main functions, and mark tests executable 2023-09-07 18:46:00 -07:00
zwimer 346b2d883d black 2023-01-12 16:43:51 -07:00
Zachary Wimer 74e8f34ceb prefer builtin constructors (#3675) 2022-12-20 16:02:02 -07:00
simplevuln 3bbe1bb56d Fix the infinite recursion bug in functions_called (#2377)
* Fix functions_called

Infinite recursion bug in functions_called

* Add test for functions_called

Check cyclic dependencies of functions_called

* `Function.functions_called` split tests

  * make the two cases explicitely separated

Signed-off-by: Pamplemousse <xav.maso@gmail.com>

Co-authored-by: Pamplemousse <xav.maso@gmail.com>
2020-11-07 16:31:23 -07:00
Pamplemousse 8811adb6c7 Function: Add feature to get dependencies (#2318)
Dependencies as in "the list of other functions it -transitively-
calls".

Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2020-09-09 02:05:38 -07:00