angr 9.2.131__py3-none-macosx_11_0_arm64.whl → 9.2.133__py3-none-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of angr might be problematic. Click here for more details.

Files changed (265) hide show
  1. angr/__init__.py +128 -128
  2. angr/analyses/__init__.py +38 -38
  3. angr/analyses/analysis.py +6 -2
  4. angr/analyses/backward_slice.py +3 -4
  5. angr/analyses/binary_optimizer.py +5 -12
  6. angr/analyses/bindiff.py +3 -6
  7. angr/analyses/calling_convention.py +3 -4
  8. angr/analyses/cfg/__init__.py +3 -3
  9. angr/analyses/cfg/cfg_base.py +1 -1
  10. angr/analyses/cfg/cfg_emulated.py +5 -5
  11. angr/analyses/cfg/cfg_fast.py +19 -17
  12. angr/analyses/cfg/indirect_jump_resolvers/__init__.py +5 -5
  13. angr/analyses/cfg/indirect_jump_resolvers/amd64_elf_got.py +1 -1
  14. angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +148 -101
  15. angr/analyses/cfg/indirect_jump_resolvers/x86_elf_pic_plt.py +1 -1
  16. angr/analyses/data_dep/__init__.py +4 -4
  17. angr/analyses/datagraph_meta.py +1 -1
  18. angr/analyses/ddg.py +16 -17
  19. angr/analyses/decompiler/__init__.py +12 -12
  20. angr/analyses/decompiler/ail_simplifier.py +24 -12
  21. angr/analyses/decompiler/block_similarity.py +2 -4
  22. angr/analyses/decompiler/block_simplifier.py +10 -21
  23. angr/analyses/decompiler/callsite_maker.py +1 -1
  24. angr/analyses/decompiler/ccall_rewriters/rewriter_base.py +1 -1
  25. angr/analyses/decompiler/clinic.py +122 -41
  26. angr/analyses/decompiler/condition_processor.py +57 -39
  27. angr/analyses/decompiler/counters/__init__.py +3 -3
  28. angr/analyses/decompiler/decompilation_cache.py +7 -7
  29. angr/analyses/decompiler/dephication/__init__.py +1 -1
  30. angr/analyses/decompiler/dephication/graph_rewriting.py +1 -1
  31. angr/analyses/decompiler/dephication/graph_vvar_mapping.py +11 -3
  32. angr/analyses/decompiler/dephication/rewriting_engine.py +169 -45
  33. angr/analyses/decompiler/dephication/seqnode_dephication.py +5 -4
  34. angr/analyses/decompiler/expression_narrower.py +1 -1
  35. angr/analyses/decompiler/graph_region.py +8 -8
  36. angr/analyses/decompiler/optimization_passes/__init__.py +20 -20
  37. angr/analyses/decompiler/optimization_passes/const_derefs.py +1 -0
  38. angr/analyses/decompiler/optimization_passes/deadblock_remover.py +1 -2
  39. angr/analyses/decompiler/optimization_passes/div_simplifier.py +41 -16
  40. angr/analyses/decompiler/optimization_passes/duplication_reverter/duplication_reverter.py +8 -7
  41. angr/analyses/decompiler/optimization_passes/duplication_reverter/utils.py +1 -3
  42. angr/analyses/decompiler/optimization_passes/engine_base.py +262 -84
  43. angr/analyses/decompiler/optimization_passes/inlined_string_transformation_simplifier.py +175 -39
  44. angr/analyses/decompiler/optimization_passes/ite_region_converter.py +2 -5
  45. angr/analyses/decompiler/optimization_passes/lowered_switch_simplifier.py +5 -5
  46. angr/analyses/decompiler/optimization_passes/mod_simplifier.py +12 -3
  47. angr/analyses/decompiler/optimization_passes/optimization_pass.py +42 -19
  48. angr/analyses/decompiler/optimization_passes/stack_canary_simplifier.py +9 -5
  49. angr/analyses/decompiler/peephole_optimizations/__init__.py +1 -1
  50. angr/analyses/decompiler/peephole_optimizations/base.py +6 -6
  51. angr/analyses/decompiler/peephole_optimizations/remove_noop_conversions.py +2 -0
  52. angr/analyses/decompiler/peephole_optimizations/rewrite_bit_extractions.py +1 -1
  53. angr/analyses/decompiler/presets/__init__.py +1 -1
  54. angr/analyses/decompiler/region_simplifiers/expr_folding.py +3 -3
  55. angr/analyses/decompiler/region_simplifiers/switch_cluster_simplifier.py +8 -12
  56. angr/analyses/decompiler/ssailification/rewriting.py +1 -2
  57. angr/analyses/decompiler/ssailification/rewriting_engine.py +139 -56
  58. angr/analyses/decompiler/ssailification/ssailification.py +2 -1
  59. angr/analyses/decompiler/ssailification/traversal.py +4 -6
  60. angr/analyses/decompiler/ssailification/traversal_engine.py +125 -42
  61. angr/analyses/decompiler/structured_codegen/__init__.py +5 -5
  62. angr/analyses/decompiler/structured_codegen/base.py +3 -3
  63. angr/analyses/decompiler/structured_codegen/c.py +39 -40
  64. angr/analyses/decompiler/structuring/__init__.py +3 -3
  65. angr/analyses/decompiler/structuring/phoenix.py +45 -29
  66. angr/analyses/decompiler/structuring/structurer_base.py +2 -2
  67. angr/analyses/decompiler/structuring/structurer_nodes.py +23 -14
  68. angr/analyses/deobfuscator/__init__.py +3 -3
  69. angr/analyses/deobfuscator/irsb_reg_collector.py +29 -60
  70. angr/analyses/deobfuscator/string_obf_finder.py +2 -2
  71. angr/analyses/deobfuscator/string_obf_opt_passes.py +1 -1
  72. angr/analyses/disassembly.py +4 -4
  73. angr/analyses/forward_analysis/__init__.py +1 -1
  74. angr/analyses/forward_analysis/visitors/graph.py +6 -6
  75. angr/analyses/init_finder.py +47 -22
  76. angr/analyses/loop_analysis.py +1 -1
  77. angr/analyses/loopfinder.py +1 -1
  78. angr/analyses/propagator/engine_base.py +21 -14
  79. angr/analyses/propagator/engine_vex.py +149 -179
  80. angr/analyses/propagator/outdated_definition_walker.py +12 -6
  81. angr/analyses/propagator/propagator.py +10 -28
  82. angr/analyses/propagator/top_checker_mixin.py +211 -5
  83. angr/analyses/propagator/vex_vars.py +4 -4
  84. angr/analyses/reaching_definitions/__init__.py +9 -9
  85. angr/analyses/reaching_definitions/call_trace.py +2 -2
  86. angr/analyses/reaching_definitions/dep_graph.py +1 -1
  87. angr/analyses/reaching_definitions/engine_ail.py +304 -329
  88. angr/analyses/reaching_definitions/engine_vex.py +243 -229
  89. angr/analyses/reaching_definitions/function_handler.py +3 -3
  90. angr/analyses/reaching_definitions/function_handler_library/__init__.py +1 -1
  91. angr/analyses/reaching_definitions/rd_state.py +47 -42
  92. angr/analyses/reassembler.py +26 -31
  93. angr/analyses/s_liveness.py +8 -0
  94. angr/analyses/s_propagator.py +18 -3
  95. angr/analyses/s_reaching_definitions/s_rda_view.py +2 -5
  96. angr/analyses/s_reaching_definitions/s_reaching_definitions.py +9 -5
  97. angr/analyses/stack_pointer_tracker.py +4 -4
  98. angr/analyses/typehoon/simple_solver.py +14 -14
  99. angr/analyses/typehoon/translator.py +10 -2
  100. angr/analyses/typehoon/typeconsts.py +11 -3
  101. angr/analyses/typehoon/typevars.py +26 -26
  102. angr/analyses/unpacker/__init__.py +1 -1
  103. angr/analyses/variable_recovery/engine_ail.py +299 -259
  104. angr/analyses/variable_recovery/engine_base.py +138 -121
  105. angr/analyses/variable_recovery/engine_vex.py +175 -185
  106. angr/analyses/variable_recovery/irsb_scanner.py +49 -38
  107. angr/analyses/variable_recovery/variable_recovery.py +28 -5
  108. angr/analyses/variable_recovery/variable_recovery_base.py +33 -34
  109. angr/analyses/variable_recovery/variable_recovery_fast.py +4 -8
  110. angr/analyses/veritesting.py +2 -2
  111. angr/analyses/vfg.py +5 -5
  112. angr/analyses/xrefs.py +46 -19
  113. angr/angrdb/serializers/__init__.py +1 -1
  114. angr/annocfg.py +20 -15
  115. angr/blade.py +2 -2
  116. angr/block.py +20 -25
  117. angr/calling_conventions.py +12 -14
  118. angr/code_location.py +6 -10
  119. angr/codenode.py +3 -3
  120. angr/engines/__init__.py +12 -14
  121. angr/engines/engine.py +24 -61
  122. angr/engines/light/__init__.py +13 -5
  123. angr/engines/light/data.py +1 -1
  124. angr/engines/light/engine.py +1003 -1185
  125. angr/engines/pcode/__init__.py +1 -1
  126. angr/engines/pcode/behavior.py +1 -1
  127. angr/engines/pcode/cc.py +2 -0
  128. angr/engines/pcode/lifter.py +13 -15
  129. angr/engines/soot/expressions/__init__.py +12 -12
  130. angr/engines/soot/statements/__init__.py +6 -6
  131. angr/engines/soot/values/__init__.py +6 -6
  132. angr/engines/soot/values/arrayref.py +2 -2
  133. angr/engines/soot/values/constants.py +1 -1
  134. angr/engines/soot/values/instancefieldref.py +1 -1
  135. angr/engines/soot/values/paramref.py +1 -1
  136. angr/engines/soot/values/staticfieldref.py +1 -1
  137. angr/engines/successors.py +15 -14
  138. angr/engines/vex/__init__.py +5 -5
  139. angr/engines/vex/claripy/ccall.py +2 -2
  140. angr/engines/vex/claripy/datalayer.py +1 -1
  141. angr/engines/vex/claripy/irop.py +19 -19
  142. angr/engines/vex/heavy/__init__.py +2 -2
  143. angr/engines/vex/heavy/actions.py +1 -3
  144. angr/engines/vex/heavy/heavy.py +4 -6
  145. angr/engines/vex/lifter.py +2 -4
  146. angr/engines/vex/light/light.py +0 -2
  147. angr/engines/vex/light/slicing.py +5 -5
  148. angr/exploration_techniques/__init__.py +19 -142
  149. angr/exploration_techniques/base.py +126 -0
  150. angr/exploration_techniques/bucketizer.py +1 -1
  151. angr/exploration_techniques/dfs.py +3 -1
  152. angr/exploration_techniques/director.py +2 -3
  153. angr/exploration_techniques/driller_core.py +1 -1
  154. angr/exploration_techniques/explorer.py +4 -2
  155. angr/exploration_techniques/lengthlimiter.py +2 -1
  156. angr/exploration_techniques/local_loop_seer.py +2 -1
  157. angr/exploration_techniques/loop_seer.py +5 -5
  158. angr/exploration_techniques/manual_mergepoint.py +2 -1
  159. angr/exploration_techniques/memory_watcher.py +3 -1
  160. angr/exploration_techniques/oppologist.py +4 -5
  161. angr/exploration_techniques/slicecutor.py +4 -2
  162. angr/exploration_techniques/spiller.py +1 -1
  163. angr/exploration_techniques/stochastic.py +2 -1
  164. angr/exploration_techniques/stub_stasher.py +2 -1
  165. angr/exploration_techniques/suggestions.py +3 -1
  166. angr/exploration_techniques/symbion.py +3 -1
  167. angr/exploration_techniques/tech_builder.py +2 -1
  168. angr/exploration_techniques/threading.py +2 -11
  169. angr/exploration_techniques/timeout.py +4 -2
  170. angr/exploration_techniques/tracer.py +4 -3
  171. angr/exploration_techniques/unique.py +3 -2
  172. angr/exploration_techniques/veritesting.py +1 -1
  173. angr/factory.py +36 -6
  174. angr/keyed_region.py +4 -4
  175. angr/knowledge_base.py +1 -1
  176. angr/knowledge_plugins/__init__.py +11 -11
  177. angr/knowledge_plugins/cfg/__init__.py +5 -5
  178. angr/knowledge_plugins/cfg/cfg_manager.py +2 -2
  179. angr/knowledge_plugins/cfg/cfg_model.py +8 -8
  180. angr/knowledge_plugins/cfg/cfg_node.py +19 -19
  181. angr/knowledge_plugins/cfg/indirect_jump.py +6 -6
  182. angr/knowledge_plugins/cfg/memory_data.py +5 -7
  183. angr/knowledge_plugins/functions/function.py +48 -52
  184. angr/knowledge_plugins/functions/function_parser.py +4 -4
  185. angr/knowledge_plugins/key_definitions/__init__.py +3 -3
  186. angr/knowledge_plugins/key_definitions/atoms.py +8 -8
  187. angr/knowledge_plugins/key_definitions/definition.py +1 -1
  188. angr/knowledge_plugins/key_definitions/live_definitions.py +30 -27
  189. angr/knowledge_plugins/labels.py +1 -1
  190. angr/knowledge_plugins/propagations/__init__.py +1 -1
  191. angr/knowledge_plugins/propagations/prop_value.py +2 -2
  192. angr/knowledge_plugins/propagations/propagation_model.py +7 -8
  193. angr/knowledge_plugins/propagations/states.py +44 -39
  194. angr/knowledge_plugins/variables/variable_access.py +2 -2
  195. angr/knowledge_plugins/variables/variable_manager.py +24 -10
  196. angr/knowledge_plugins/xrefs/xref.py +5 -8
  197. angr/lib/angr_native.dylib +0 -0
  198. angr/misc/__init__.py +4 -4
  199. angr/misc/hookset.py +4 -5
  200. angr/misc/loggers.py +2 -2
  201. angr/misc/telemetry.py +1 -1
  202. angr/procedures/__init__.py +1 -1
  203. angr/procedures/cgc/fdwait.py +2 -2
  204. angr/procedures/definitions/__init__.py +2 -2
  205. angr/procedures/definitions/linux_kernel.py +0 -1
  206. angr/procedures/definitions/parse_syscalls_from_local_system.py +1 -1
  207. angr/procedures/definitions/parse_win32json.py +0 -1
  208. angr/procedures/ntdll/exceptions.py +1 -1
  209. angr/procedures/stubs/format_parser.py +3 -3
  210. angr/procedures/win32/dynamic_loading.py +1 -1
  211. angr/protos/__init__.py +3 -3
  212. angr/sim_manager.py +3 -5
  213. angr/sim_state.py +40 -42
  214. angr/sim_state_options.py +3 -3
  215. angr/sim_type.py +15 -14
  216. angr/sim_variable.py +42 -45
  217. angr/simos/__init__.py +4 -4
  218. angr/simos/cgc.py +1 -1
  219. angr/simos/simos.py +1 -1
  220. angr/simos/userland.py +1 -1
  221. angr/slicer.py +4 -7
  222. angr/state_plugins/__init__.py +34 -34
  223. angr/state_plugins/callstack.py +5 -12
  224. angr/state_plugins/heap/__init__.py +2 -2
  225. angr/state_plugins/heap/heap_brk.py +2 -4
  226. angr/state_plugins/heap/heap_ptmalloc.py +1 -1
  227. angr/state_plugins/jni_references.py +3 -2
  228. angr/state_plugins/scratch.py +1 -1
  229. angr/state_plugins/sim_action.py +1 -4
  230. angr/state_plugins/sim_event.py +1 -1
  231. angr/state_plugins/solver.py +7 -9
  232. angr/state_plugins/uc_manager.py +1 -1
  233. angr/state_plugins/view.py +2 -2
  234. angr/storage/__init__.py +1 -1
  235. angr/storage/file.py +10 -10
  236. angr/storage/memory_mixins/__init__.py +46 -46
  237. angr/storage/memory_mixins/default_filler_mixin.py +1 -3
  238. angr/storage/memory_mixins/javavm_memory_mixin.py +2 -2
  239. angr/storage/memory_mixins/name_resolution_mixin.py +2 -2
  240. angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +1 -3
  241. angr/storage/memory_mixins/paged_memory/pages/__init__.py +6 -6
  242. angr/storage/memory_mixins/paged_memory/pages/list_page.py +1 -1
  243. angr/storage/memory_mixins/paged_memory/pages/multi_values.py +1 -1
  244. angr/storage/memory_mixins/paged_memory/pages/mv_list_page.py +1 -1
  245. angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +2 -4
  246. angr/storage/memory_mixins/regioned_memory/__init__.py +3 -3
  247. angr/storage/memory_mixins/regioned_memory/region_data.py +5 -5
  248. angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +7 -9
  249. angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +4 -4
  250. angr/storage/memory_object.py +4 -4
  251. angr/utils/__init__.py +3 -3
  252. angr/utils/bits.py +12 -0
  253. angr/utils/dynamic_dictlist.py +1 -1
  254. angr/utils/graph.py +1 -1
  255. angr/utils/orderedset.py +4 -1
  256. angr/utils/segment_list.py +2 -2
  257. angr/utils/ssa/__init__.py +33 -8
  258. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/METADATA +6 -6
  259. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/RECORD +263 -264
  260. angr/analyses/propagator/engine_ail.py +0 -1562
  261. angr/storage/memory_mixins/__init__.pyi +0 -48
  262. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/LICENSE +0 -0
  263. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/WHEEL +0 -0
  264. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/entry_points.txt +0 -0
  265. {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/top_level.txt +0 -0
angr/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # pylint: disable=wrong-import-position
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "9.2.131"
5
+ __version__ = "9.2.133"
6
6
 
7
7
  if bytes is str:
8
8
  raise Exception(
@@ -202,162 +202,162 @@ loggers.load_all_loggers()
202
202
  load_external_definitions()
203
203
 
204
204
  __all__ = (
205
- "SimProcedure",
206
- "SIM_PROCEDURES",
207
- "SIM_LIBRARIES",
208
- "SIM_TYPE_COLLECTIONS",
209
- "sim_options",
210
- "options",
211
- "BP_BEFORE",
205
+ "BP",
212
206
  "BP_AFTER",
207
+ "BP_BEFORE",
213
208
  "BP_BOTH",
214
209
  "BP_IPDB",
215
210
  "BP_IPYTHON",
216
- "BP",
217
- "SimStatePlugin",
218
- "Project",
219
- "load_shellcode",
220
- "AngrError",
221
- "AngrRuntimeError",
222
- "AngrValueError",
223
- "AngrLifterError",
224
- "AngrExitError",
225
- "AngrPathError",
226
- "AngrVaultError",
227
- "PathUnreachableError",
228
- "SimulationManagerError",
229
- "AngrInvalidArgumentError",
230
- "AngrSurveyorError",
211
+ "DEFAULT_CC",
212
+ "SIM_LIBRARIES",
213
+ "SIM_PROCEDURES",
214
+ "SIM_TYPE_COLLECTIONS",
215
+ "SYSCALL_CC",
216
+ "Analysis",
231
217
  "AngrAnalysisError",
232
- "AngrBladeError",
233
- "AngrBladeSimProcError",
234
218
  "AngrAnnotatedCFGError",
219
+ "AngrAssemblyError",
235
220
  "AngrBackwardSlicingError",
221
+ "AngrBladeError",
222
+ "AngrBladeSimProcError",
223
+ "AngrCFGError",
236
224
  "AngrCallableError",
237
225
  "AngrCallableMultistateError",
238
- "AngrSyscallError",
239
- "AngrSimOSError",
240
- "AngrAssemblyError",
241
- "AngrTypeError",
242
- "AngrMissingTypeError",
243
- "AngrIncongruencyError",
244
- "AngrForwardAnalysisError",
245
- "AngrSkipJobNotice",
226
+ "AngrCorruptDBError",
227
+ "AngrDBError",
228
+ "AngrDDGError",
229
+ "AngrDataGraphError",
230
+ "AngrDecompilationError",
246
231
  "AngrDelayJobNotice",
232
+ "AngrDirectorError",
233
+ "AngrError",
234
+ "AngrExitError",
235
+ "AngrExplorationTechniqueError",
236
+ "AngrExplorerError",
237
+ "AngrForwardAnalysisError",
238
+ "AngrIncompatibleDBError",
239
+ "AngrIncongruencyError",
240
+ "AngrInvalidArgumentError",
247
241
  "AngrJobMergingFailureNotice",
248
242
  "AngrJobWideningFailureNotice",
249
- "AngrCFGError",
250
- "AngrVFGError",
251
- "AngrVFGRestartAnalysisNotice",
252
- "AngrDataGraphError",
253
- "AngrDDGError",
243
+ "AngrLifterError",
254
244
  "AngrLoopAnalysisError",
255
- "AngrExplorationTechniqueError",
256
- "AngrExplorerError",
257
- "AngrDirectorError",
245
+ "AngrMissingTypeError",
246
+ "AngrNoPluginError",
247
+ "AngrPathError",
248
+ "AngrRuntimeError",
249
+ "AngrSimOSError",
250
+ "AngrSkipJobNotice",
251
+ "AngrSurveyorError",
252
+ "AngrSyscallError",
258
253
  "AngrTracerError",
259
- "AngrDBError",
260
- "AngrCorruptDBError",
261
- "AngrIncompatibleDBError",
262
- "TracerEnvironmentError",
263
- "SimError",
264
- "SimStateError",
265
- "SimMergeError",
266
- "SimMemoryError",
267
- "SimMemoryMissingError",
254
+ "AngrTypeError",
255
+ "AngrUnsupportedSyscallError",
256
+ "AngrVFGError",
257
+ "AngrVFGRestartAnalysisNotice",
258
+ "AngrValueError",
259
+ "AngrVaultError",
260
+ "Blade",
261
+ "Block",
262
+ "ExplorationTechnique",
263
+ "KnowledgeBase",
264
+ "PTChunk",
265
+ "PathUnreachableError",
266
+ "PointerWrapper",
267
+ "Project",
268
+ "Server",
268
269
  "SimAbstractMemoryError",
269
- "SimRegionMapError",
270
- "SimMemoryLimitError",
271
- "SimMemoryAddressError",
272
- "SimFastMemoryError",
270
+ "SimActionError",
271
+ "SimCC",
272
+ "SimCCError",
273
+ "SimCCallError",
274
+ "SimConcreteBreakpointError",
275
+ "SimConcreteMemoryError",
276
+ "SimConcreteRegisterError",
277
+ "SimEmptyCallStackError",
278
+ "SimEngineError",
279
+ "SimError",
273
280
  "SimEventError",
274
- "SimPosixError",
275
- "SimFilesystemError",
276
- "SimSymbolicFilesystemError",
281
+ "SimException",
282
+ "SimExpressionError",
283
+ "SimFastMemoryError",
284
+ "SimFastPathError",
285
+ "SimFile",
286
+ "SimFileBase",
287
+ "SimFileDescriptor",
288
+ "SimFileDescriptorDuplex",
277
289
  "SimFileError",
290
+ "SimFileStream",
291
+ "SimFilesystemError",
292
+ "SimHeapBrk",
278
293
  "SimHeapError",
279
- "SimUnsupportedError",
294
+ "SimHeapPTMalloc",
295
+ "SimHostFilesystem",
296
+ "SimIRSBError",
297
+ "SimIRSBNoDecodeError",
298
+ "SimMemoryAddressError",
299
+ "SimMemoryError",
300
+ "SimMemoryLimitError",
301
+ "SimMemoryMissingError",
302
+ "SimMergeError",
303
+ "SimMissingTempError",
304
+ "SimMount",
305
+ "SimOS",
306
+ "SimOperationError",
307
+ "SimPackets",
308
+ "SimPacketsStream",
309
+ "SimPosixError",
310
+ "SimProcedure",
311
+ "SimProcedureArgumentError",
312
+ "SimProcedureError",
313
+ "SimProcedures",
314
+ "SimRegionMapError",
315
+ "SimReliftException",
316
+ "SimSegfaultError",
317
+ "SimSegfaultException",
318
+ "SimShadowStackError",
319
+ "SimSlicerError",
280
320
  "SimSolverError",
281
321
  "SimSolverModeError",
282
322
  "SimSolverOptionError",
283
- "SimValueError",
284
- "SimUnsatError",
285
- "SimOperationError",
286
- "UnsupportedIROpError",
287
- "SimExpressionError",
288
- "UnsupportedIRExprError",
289
- "SimCCallError",
290
- "UnsupportedCCallError",
291
- "SimUninitializedAccessError",
323
+ "SimState",
324
+ "SimStateError",
325
+ "SimStateOptionsError",
326
+ "SimStatePlugin",
292
327
  "SimStatementError",
293
- "UnsupportedIRStmtError",
294
- "UnsupportedDirtyError",
295
- "SimMissingTempError",
296
- "SimEngineError",
297
- "SimIRSBError",
328
+ "SimSymbolicFilesystemError",
298
329
  "SimTranslationError",
299
- "SimProcedureError",
300
- "SimProcedureArgumentError",
301
- "SimShadowStackError",
302
- "SimFastPathError",
303
- "SimIRSBNoDecodeError",
304
- "AngrUnsupportedSyscallError",
305
- "UnsupportedSyscallError",
306
- "SimReliftException",
307
- "SimSlicerError",
308
- "SimActionError",
309
- "SimCCError",
310
- "SimUCManagerError",
311
330
  "SimUCManagerAllocationError",
312
- "SimUnicornUnsupport",
331
+ "SimUCManagerError",
313
332
  "SimUnicornError",
314
333
  "SimUnicornSymbolic",
315
- "SimEmptyCallStackError",
316
- "SimStateOptionsError",
317
- "SimException",
318
- "SimSegfaultException",
319
- "SimSegfaultError",
334
+ "SimUnicornUnsupport",
335
+ "SimUninitializedAccessError",
336
+ "SimUnsatError",
337
+ "SimUnsupportedError",
338
+ "SimValueError",
320
339
  "SimZeroDivisionException",
321
- "AngrNoPluginError",
322
- "SimConcreteMemoryError",
323
- "SimConcreteRegisterError",
324
- "SimConcreteBreakpointError",
325
- "AngrDecompilationError",
326
- "UnsupportedNodeTypeError",
327
- "Blade",
328
- "SimOS",
329
- "Block",
330
340
  "SimulationManager",
331
- "Analysis",
332
- "register_analysis",
333
- "analyses",
334
- "knowledge_plugins",
335
- "exploration_techniques",
336
- "ExplorationTechnique",
337
- "types",
341
+ "SimulationManagerError",
338
342
  "StateHierarchy",
339
- "SimState",
340
- "engines",
341
- "DEFAULT_CC",
342
- "default_cc",
343
- "SYSCALL_CC",
344
- "PointerWrapper",
345
- "SimCC",
346
- "SimFileBase",
347
- "SimFile",
348
- "SimPackets",
349
- "SimFileStream",
350
- "SimPacketsStream",
351
- "SimFileDescriptor",
352
- "SimFileDescriptorDuplex",
353
- "SimMount",
354
- "SimHostFilesystem",
355
- "SimHeapBrk",
356
- "SimHeapPTMalloc",
357
- "PTChunk",
343
+ "TracerEnvironmentError",
344
+ "UnsupportedCCallError",
345
+ "UnsupportedDirtyError",
346
+ "UnsupportedIRExprError",
347
+ "UnsupportedIROpError",
348
+ "UnsupportedIRStmtError",
349
+ "UnsupportedNodeTypeError",
350
+ "UnsupportedSyscallError",
351
+ "analyses",
358
352
  "concretization_strategies",
359
- "Server",
353
+ "default_cc",
354
+ "engines",
355
+ "exploration_techniques",
356
+ "knowledge_plugins",
357
+ "load_shellcode",
360
358
  "manager",
361
- "SimProcedures",
362
- "KnowledgeBase",
359
+ "options",
360
+ "register_analysis",
361
+ "sim_options",
362
+ "types",
363
363
  )
angr/analyses/__init__.py CHANGED
@@ -58,59 +58,59 @@ from . import deobfuscator
58
58
 
59
59
 
60
60
  __all__ = (
61
- "Analysis",
62
- "AnalysesHub",
63
- "register_analysis",
64
- "ForwardAnalysis",
65
- "visitors",
66
- "PropagatorAnalysis",
67
- "CFGFast",
68
- "CFGEmulated",
69
- "CFG",
70
- "CFGArchOptions",
71
- "CFGFastSoot",
72
61
  "CDG",
62
+ "CFG",
73
63
  "DDG",
74
64
  "VFG",
75
- "BoyScout",
76
- "BackwardSlice",
77
- "Veritesting",
78
65
  "VSA_DDG",
66
+ "AnalysesHub",
67
+ "Analysis",
68
+ "BackwardSlice",
79
69
  "BinDiff",
80
- "LoopFinder",
81
- "CongruencyCheck",
82
- "StaticHooker",
83
- "Reassembler",
84
70
  "BinaryOptimizer",
85
- "Disassembly",
86
- "VariableRecovery",
87
- "VariableRecoveryFast",
88
- "Identifier",
71
+ "BoyScout",
72
+ "CFGArchOptions",
73
+ "CFGEmulated",
74
+ "CFGFast",
75
+ "CFGFastSoot",
89
76
  "CalleeCleanupFinder",
90
- "ReachingDefinitionsAnalysis",
91
77
  "CallingConventionAnalysis",
78
+ "ClassIdentifier",
79
+ "CodeCaveAnalysis",
92
80
  "CodeTagging",
93
- "StackPointerTracker",
94
- "DominanceFrontier",
81
+ "CompleteCallingConventionsAnalysis",
82
+ "CongruencyCheck",
95
83
  "DataDependencyGraphAnalysis",
96
84
  "Decompiler",
97
- "SootClassHierarchy",
98
- "XRefsAnalysis",
85
+ "Disassembly",
86
+ "DominanceFrontier",
87
+ "FlirtAnalysis",
88
+ "ForwardAnalysis",
89
+ "Identifier",
99
90
  "InitializationFinder",
100
- "CompleteCallingConventionsAnalysis",
101
- "Typehoon",
91
+ "LoopFinder",
92
+ "PackingDetector",
93
+ "PatchFinderAnalysis",
94
+ "Pathfinder",
95
+ "PropagatorAnalysis",
102
96
  "ProximityGraphAnalysis",
103
- "VtableFinder",
104
- "StaticObjectFinder",
105
- "ClassIdentifier",
106
- "FlirtAnalysis",
97
+ "ReachingDefinitionsAnalysis",
98
+ "Reassembler",
99
+ "SLivenessAnalysis",
107
100
  "SPropagatorAnalysis",
108
101
  "SReachingDefinitionsAnalysis",
109
- "SLivenessAnalysis",
110
- "CodeCaveAnalysis",
111
- "PatchFinderAnalysis",
112
- "Pathfinder",
113
102
  "SelfModifyingCodeAnalysis",
114
- "PackingDetector",
103
+ "SootClassHierarchy",
104
+ "StackPointerTracker",
105
+ "StaticHooker",
106
+ "StaticObjectFinder",
107
+ "Typehoon",
108
+ "VariableRecovery",
109
+ "VariableRecoveryFast",
110
+ "Veritesting",
111
+ "VtableFinder",
112
+ "XRefsAnalysis",
115
113
  "deobfuscator",
114
+ "register_analysis",
115
+ "visitors",
116
116
  )
angr/analyses/analysis.py CHANGED
@@ -20,6 +20,7 @@ from rich import progress
20
20
  from angr.misc.plugins import PluginVendor, VendorPreset
21
21
  from angr.misc.ux import deprecated
22
22
  from angr.misc import telemetry
23
+ from angr.misc.testing import is_testing
23
24
 
24
25
  if TYPE_CHECKING:
25
26
  from angr.knowledge_base import KnowledgeBase
@@ -190,11 +191,14 @@ class AnalysisFactory(Generic[A]):
190
191
 
191
192
  def prep(
192
193
  self,
193
- fail_fast=False,
194
+ fail_fast: bool | None = None,
194
195
  kb: KnowledgeBase | None = None,
195
196
  progress_callback: Callable | None = None,
196
197
  show_progressbar: bool = False,
197
198
  ) -> type[A]:
199
+ if fail_fast is None:
200
+ fail_fast = is_testing
201
+
198
202
  @functools.wraps(self._analysis_cls.__init__)
199
203
  @t.start_as_current_span(self._analysis_cls.__name__)
200
204
  def wrapper(*args, **kwargs):
@@ -253,7 +257,7 @@ class AnalysisFactory(Generic[A]):
253
257
  return wrapper # type: ignore
254
258
 
255
259
  def __call__(self, *args, **kwargs) -> A:
256
- fail_fast = kwargs.pop("fail_fast", False)
260
+ fail_fast = kwargs.pop("fail_fast", is_testing)
257
261
  kb = kwargs.pop("kb", self._project.kb)
258
262
  progress_callback = kwargs.pop("progress_callback", None)
259
263
  show_progressbar = kwargs.pop("show_progressbar", False)
@@ -110,10 +110,9 @@ class BackwardSlice(Analysis):
110
110
  s = repr(self) + "\n"
111
111
 
112
112
  if len(self.chosen_statements) > max_display:
113
- s += "%d SimRuns in program slice, displaying %d.\n" % (len(self.chosen_statements), max_display)
113
+ s += f"{len(self.chosen_statements)} SimRuns in program slice, displaying {max_display}.\n"
114
114
  else:
115
- s += "%d SimRuns in program slice.\n" % len(self.chosen_statements)
116
-
115
+ s += f"{len(self.chosen_statements)} SimRuns in program slice.\n"
117
116
  # Pretty-print the first `max_display` basic blocks
118
117
  if max_display is None:
119
118
  # Output all
@@ -150,7 +149,7 @@ class BackwardSlice(Analysis):
150
149
  statements = vex_block.statements
151
150
  for i in range(len(statements)):
152
151
  line = "+" if i in chosen_statements else "-"
153
- line += "[% 3d] " % i
152
+ line += f"[{i: 3d}] "
154
153
  line += str(statements[i])
155
154
  ss += line + "\n"
156
155
 
@@ -35,12 +35,8 @@ class RedundantStackVariable:
35
35
  self.argument_register_as_retval = False
36
36
 
37
37
  def __repr__(self):
38
- return "<StackVar %s for %s at %d locations%s>" % (
39
- self.stack_variable,
40
- self.argument,
41
- len(self.stack_variable_consuming_locs),
42
- " - retval" if self.argument_register_as_retval else "",
43
- )
38
+ retval_str = " - retval" if self.argument_register_as_retval else ""
39
+ return f"<StackVar {self.stack_variable} for {self.argument} at {len(self.stack_variable_consuming_locs)} locations{retval_str}>"
44
40
 
45
41
 
46
42
  class RegisterReallocation:
@@ -79,12 +75,9 @@ class RegisterReallocation:
79
75
  self.epilogue_size = epilogue_size
80
76
 
81
77
  def __repr__(self):
82
- return "<RegisterReallocation %s for %s with %d sources and %d consumers>" % (
83
- self.register_variable,
84
- self.stack_variable,
85
- len(self.stack_variable_sources),
86
- len(self.stack_variable_consumers),
87
- )
78
+ sources_count = len(self.stack_variable_sources)
79
+ consumers_count = len(self.stack_variable_consumers)
80
+ return f"<RegisterReallocation {self.register_variable} for {self.stack_variable} with {sources_count} sources and {consumers_count} consumers>"
88
81
 
89
82
 
90
83
  class DeadAssignment:
angr/analyses/bindiff.py CHANGED
@@ -208,11 +208,8 @@ def compare_statement_dict(statement_1, statement_2):
208
208
  # constants
209
209
  if isinstance(statement_1, (int, float, str, bytes)):
210
210
  if (
211
- isinstance(statement_1, float)
212
- and math.isnan(statement_1)
213
- and math.isnan(statement_2)
214
- or statement_1 == statement_2
215
- ):
211
+ isinstance(statement_1, float) and math.isnan(statement_1) and math.isnan(statement_2)
212
+ ) or statement_1 == statement_2:
216
213
  return []
217
214
  return [Difference(None, statement_1, statement_2)]
218
215
 
@@ -283,7 +280,7 @@ class NormalizedBlock:
283
280
 
284
281
  def __repr__(self):
285
282
  size = sum([b.size for b in self.blocks])
286
- return "<Normalized Block for %#x, %d bytes>" % (self.addr, size)
283
+ return f"<Normalized Block for {self.addr:#x}, {size} bytes>"
287
284
 
288
285
 
289
286
  class NormalizedFunction:
@@ -277,7 +277,7 @@ class CallingConventionAnalysis(Analysis):
277
277
  # prioritize the hooker
278
278
  hooker = self.project.hooked_by(real_func.addr)
279
279
  if hooker is not None and (
280
- not hooker.is_stub or hooker.is_function and not hooker.guessed_prototype
280
+ not hooker.is_stub or (hooker.is_function and not hooker.guessed_prototype)
281
281
  ):
282
282
  return real_func.calling_convention, hooker.prototype
283
283
  if real_func.calling_convention and real_func.prototype:
@@ -414,7 +414,7 @@ class CallingConventionAnalysis(Analysis):
414
414
 
415
415
  for src, _, data in sorted(in_edges, key=lambda x: x[0].addr):
416
416
  edge_type = data.get("jumpkind", "Ijk_Call")
417
- if not (edge_type == "Ijk_Call" or edge_type == "Ijk_Boring" and self._cfg.graph.out_degree[src] == 1):
417
+ if not (edge_type == "Ijk_Call" or (edge_type == "Ijk_Boring" and self._cfg.graph.out_degree[src] == 1)):
418
418
  continue
419
419
  if not self.kb.functions.contains_addr(src.function_address):
420
420
  continue
@@ -523,8 +523,7 @@ class CallingConventionAnalysis(Analysis):
523
523
  def_
524
524
  for def_ in rda.all_uses._uses_by_definition
525
525
  if (
526
- def_.codeloc.block_addr == caller_block_addr
527
- and def_.codeloc.stmt_idx == DEFAULT_STATEMENT
526
+ (def_.codeloc.block_addr == caller_block_addr and def_.codeloc.stmt_idx == DEFAULT_STATEMENT)
528
527
  or any(isinstance(tag, ReturnValueTag) for tag in def_.tags)
529
528
  )
530
529
  }
@@ -13,11 +13,11 @@ from .cfg_base import CFGBase
13
13
 
14
14
 
15
15
  __all__ = (
16
- "CFGFast",
17
- "CFGEmulated",
18
16
  "CFG",
19
17
  "CFBlanket",
20
- "CFGFastSoot",
21
18
  "CFGArchOptions",
22
19
  "CFGBase",
20
+ "CFGEmulated",
21
+ "CFGFast",
22
+ "CFGFastSoot",
23
23
  )
@@ -111,7 +111,7 @@ class CFGBase(Analysis):
111
111
 
112
112
  # Sanity checks
113
113
  if context_sensitivity_level < 0:
114
- raise ValueError("Unsupported context sensitivity level %d" % context_sensitivity_level)
114
+ raise ValueError(f"Unsupported context sensitivity level {context_sensitivity_level}")
115
115
 
116
116
  self._binary = binary if binary is not None else self.project.loader.main_object
117
117
  self._force_segment = force_segment
@@ -2972,7 +2972,7 @@ class CFGEmulated(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method
2972
2972
  # Skip this IRSB
2973
2973
  l.debug("Caught a SimIRSBError %s. Don't panic, this is usually expected.", ex)
2974
2974
  inst = SIM_PROCEDURES["stubs"]["PathTerminator"]()
2975
- sim_successors = ProcedureEngine().process(state, procedure=inst)
2975
+ sim_successors = ProcedureEngine(self.project).process(state, procedure=inst)
2976
2976
 
2977
2977
  except SimIRSBError:
2978
2978
  exception_info = sys.exc_info()
@@ -2980,28 +2980,28 @@ class CFGEmulated(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method
2980
2980
  # does not support. I'll create a terminating stub there
2981
2981
  l.debug("Caught a SimIRSBError during CFG recovery. Creating a PathTerminator.", exc_info=True)
2982
2982
  inst = SIM_PROCEDURES["stubs"]["PathTerminator"]()
2983
- sim_successors = ProcedureEngine().process(state, procedure=inst)
2983
+ sim_successors = ProcedureEngine(self.project).process(state, procedure=inst)
2984
2984
 
2985
2985
  except claripy.ClaripyError:
2986
2986
  exception_info = sys.exc_info()
2987
2987
  l.debug("Caught a ClaripyError during CFG recovery. Don't panic, this is usually expected.", exc_info=True)
2988
2988
  # Generate a PathTerminator to terminate the current path
2989
2989
  inst = SIM_PROCEDURES["stubs"]["PathTerminator"]()
2990
- sim_successors = ProcedureEngine().process(state, procedure=inst)
2990
+ sim_successors = ProcedureEngine(self.project).process(state, procedure=inst)
2991
2991
 
2992
2992
  except SimError:
2993
2993
  exception_info = sys.exc_info()
2994
2994
  l.debug("Caught a SimError during CFG recovery. Don't panic, this is usually expected.", exc_info=True)
2995
2995
  # Generate a PathTerminator to terminate the current path
2996
2996
  inst = SIM_PROCEDURES["stubs"]["PathTerminator"]()
2997
- sim_successors = ProcedureEngine().process(state, procedure=inst)
2997
+ sim_successors = ProcedureEngine(self.project).process(state, procedure=inst)
2998
2998
 
2999
2999
  except AngrExitError:
3000
3000
  exception_info = sys.exc_info()
3001
3001
  l.debug("Caught a AngrExitError during CFG recovery. Don't panic, this is usually expected.", exc_info=True)
3002
3002
  # Generate a PathTerminator to terminate the current path
3003
3003
  inst = SIM_PROCEDURES["stubs"]["PathTerminator"]()
3004
- sim_successors = ProcedureEngine().process(state, procedure=inst)
3004
+ sim_successors = ProcedureEngine(self.project).process(state, procedure=inst)
3005
3005
 
3006
3006
  except AngrError:
3007
3007
  exception_info = sys.exc_info()