angr 9.2.171__cp310-abi3-macosx_10_12_x86_64.whl → 9.2.172__cp310-abi3-macosx_10_12_x86_64.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.

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.171"
5
+ __version__ = "9.2.172"
6
6
 
7
7
  if bytes is str:
8
8
  raise Exception(
@@ -562,7 +562,13 @@ class Decompiler(Analysis):
562
562
  continue
563
563
 
564
564
  pass_ = timethis(pass_)
565
- a = pass_(self.func, seq=seq_node, scratch=self._optimization_scratch, **kwargs)
565
+ a = pass_(
566
+ self.func,
567
+ seq=seq_node,
568
+ scratch=self._optimization_scratch,
569
+ peephole_optimizations=self._peephole_optimizations,
570
+ **kwargs,
571
+ )
566
572
  if a.out_seq:
567
573
  seq_node = a.out_seq
568
574
 
@@ -35,6 +35,7 @@ from .switch_reused_entry_rewriter import SwitchReusedEntryRewriter
35
35
  from .condition_constprop import ConditionConstantPropagation
36
36
  from .determine_load_sizes import DetermineLoadSizes
37
37
  from .eager_std_string_concatenation import EagerStdStringConcatenationPass
38
+ from .peephole_simplifier import PostStructuringPeepholeOptimizationPass
38
39
 
39
40
  if TYPE_CHECKING:
40
41
  from angr.analyses.decompiler.presets import DecompilationPreset
@@ -72,6 +73,7 @@ ALL_OPTIMIZATION_PASSES = [
72
73
  ConditionConstantPropagation,
73
74
  DetermineLoadSizes,
74
75
  EagerStdStringConcatenationPass,
76
+ PostStructuringPeepholeOptimizationPass,
75
77
  ]
76
78
 
77
79
  # these passes may duplicate code to remove gotos or improve the structure of the graph
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from angr import ailment
4
+ from angr.analyses.decompiler.utils import (
5
+ peephole_optimize_expr,
6
+ )
7
+ from angr.analyses.decompiler.sequence_walker import SequenceWalker
8
+ from angr.analyses.decompiler.peephole_optimizations import (
9
+ PeepholeOptimizationExprBase,
10
+ EXPR_OPTS,
11
+ )
12
+ from .optimization_pass import OptimizationPassStage, SequenceOptimizationPass
13
+
14
+
15
+ class ExpressionSequenceWalker(SequenceWalker):
16
+ """
17
+ Walks sequences with generic expression handling.
18
+ """
19
+
20
+ def _handle(self, node, **kwargs):
21
+ if isinstance(node, ailment.Expr.Expression):
22
+ handler = self._handlers.get(ailment.Expr.Expression, None)
23
+ if handler:
24
+ return handler(node, **kwargs)
25
+ return super()._handle(node, **kwargs)
26
+
27
+
28
+ class PostStructuringPeepholeOptimizationPass(SequenceOptimizationPass):
29
+ """
30
+ Perform a post-structuring peephole optimization pass to simplify node statements and expressions.
31
+ """
32
+
33
+ ARCHES = None
34
+ PLATFORMS = None
35
+ STAGE = OptimizationPassStage.AFTER_STRUCTURING
36
+ NAME = "Post-Structuring Peephole Optimization"
37
+ DESCRIPTION = (__doc__ or "").strip()
38
+
39
+ def __init__(self, func, peephole_optimizations=None, **kwargs):
40
+ super().__init__(func, **kwargs)
41
+ self._peephole_optimizations = peephole_optimizations
42
+ self._expr_peephole_opts = [
43
+ cls(self.project, self.kb, self._func.addr)
44
+ for cls in (self._peephole_optimizations or EXPR_OPTS)
45
+ if issubclass(cls, PeepholeOptimizationExprBase)
46
+ ]
47
+ self.analyze()
48
+
49
+ def _check(self):
50
+ return True, None
51
+
52
+ def _analyze(self, cache=None):
53
+ walker = ExpressionSequenceWalker(
54
+ handlers={ailment.Expr.Expression: self._optimize_expr, ailment.Block: self._optimize_block}
55
+ )
56
+ walker.walk(self.seq)
57
+ self.out_seq = self.seq
58
+
59
+ def _optimize_expr(self, expr, **_):
60
+ new_expr = peephole_optimize_expr(expr, self._expr_peephole_opts)
61
+ return new_expr if expr != new_expr else None
62
+
63
+ def _optimize_block(self, block, **_):
64
+ old_block, new_block = None, block
65
+ while old_block != new_block:
66
+ old_block = new_block
67
+ # Note: AILBlockSimplifier updates expressions in place
68
+ simp = self.project.analyses.AILBlockSimplifier(
69
+ new_block,
70
+ func_addr=self._func.addr,
71
+ peephole_optimizations=self._peephole_optimizations,
72
+ )
73
+ assert simp.result_block is not None
74
+ new_block = simp.result_block
75
+ return new_block if block != new_block else None
@@ -10,6 +10,7 @@ from angr.analyses.decompiler.optimization_passes import (
10
10
  X86GccGetPcSimplifier,
11
11
  CallStatementRewriter,
12
12
  SwitchReusedEntryRewriter,
13
+ PostStructuringPeepholeOptimizationPass,
13
14
  )
14
15
 
15
16
 
@@ -25,6 +26,7 @@ preset_basic = DecompilationPreset(
25
26
  X86GccGetPcSimplifier,
26
27
  CallStatementRewriter,
27
28
  SwitchReusedEntryRewriter,
29
+ PostStructuringPeepholeOptimizationPass,
28
30
  ],
29
31
  )
30
32
 
@@ -23,6 +23,7 @@ from angr.analyses.decompiler.optimization_passes import (
23
23
  SwitchReusedEntryRewriter,
24
24
  ConditionConstantPropagation,
25
25
  DetermineLoadSizes,
26
+ PostStructuringPeepholeOptimizationPass,
26
27
  )
27
28
 
28
29
 
@@ -51,6 +52,7 @@ preset_fast = DecompilationPreset(
51
52
  CallStatementRewriter,
52
53
  ConditionConstantPropagation,
53
54
  DetermineLoadSizes,
55
+ PostStructuringPeepholeOptimizationPass,
54
56
  ],
55
57
  )
56
58
 
@@ -28,6 +28,7 @@ from angr.analyses.decompiler.optimization_passes import (
28
28
  SwitchReusedEntryRewriter,
29
29
  ConditionConstantPropagation,
30
30
  DetermineLoadSizes,
31
+ PostStructuringPeepholeOptimizationPass,
31
32
  )
32
33
 
33
34
 
@@ -61,6 +62,7 @@ preset_full = DecompilationPreset(
61
62
  SwitchReusedEntryRewriter,
62
63
  ConditionConstantPropagation,
63
64
  DetermineLoadSizes,
65
+ PostStructuringPeepholeOptimizationPass,
64
66
  ],
65
67
  )
66
68
 
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from archinfo import Arch
4
4
 
5
- from angr.analyses.decompiler.optimization_passes.optimization_pass import OptimizationPass
5
+ from angr.analyses.decompiler.optimization_passes.optimization_pass import BaseOptimizationPass
6
6
 
7
7
 
8
8
  class DecompilationPreset:
@@ -10,7 +10,7 @@ class DecompilationPreset:
10
10
  A DecompilationPreset provides a preconfigured set of optimizations and configurations for the Decompiler analysis.
11
11
  """
12
12
 
13
- def __init__(self, name: str, opt_passes: list[type[OptimizationPass]]):
13
+ def __init__(self, name: str, opt_passes: list[type[BaseOptimizationPass]]):
14
14
  self.name = name
15
15
  self.opt_passes = opt_passes
16
16
 
angr/rustylib.abi3.so CHANGED
Binary file
angr/unicornlib.dylib CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: angr
3
- Version: 9.2.171
3
+ Version: 9.2.172
4
4
  Summary: A multi-architecture binary analysis toolkit, with the ability to perform dynamic symbolic execution and various static analyses on binaries
5
5
  License: BSD-2-Clause
6
6
  Project-URL: Homepage, https://angr.io/
@@ -16,12 +16,12 @@ Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Requires-Dist: cxxheaderparser
18
18
  Requires-Dist: GitPython
19
- Requires-Dist: archinfo==9.2.171
19
+ Requires-Dist: archinfo==9.2.172
20
20
  Requires-Dist: cachetools
21
21
  Requires-Dist: capstone==5.0.3
22
22
  Requires-Dist: cffi>=1.14.0
23
- Requires-Dist: claripy==9.2.171
24
- Requires-Dist: cle==9.2.171
23
+ Requires-Dist: claripy==9.2.172
24
+ Requires-Dist: cle==9.2.172
25
25
  Requires-Dist: mulpyplexer
26
26
  Requires-Dist: networkx!=2.8.1,>=2.0
27
27
  Requires-Dist: protobuf>=5.28.2
@@ -30,7 +30,7 @@ Requires-Dist: pycparser>=2.18
30
30
  Requires-Dist: pydemumble
31
31
  Requires-Dist: pyformlang
32
32
  Requires-Dist: pypcode<4.0,>=3.2.1
33
- Requires-Dist: pyvex==9.2.171
33
+ Requires-Dist: pyvex==9.2.172
34
34
  Requires-Dist: rich>=13.1.0
35
35
  Requires-Dist: sortedcontainers
36
36
  Requires-Dist: sympy
@@ -1,23 +1,23 @@
1
- angr-9.2.171.dist-info/RECORD,,
2
- angr-9.2.171.dist-info/WHEEL,sha256=wTy_3c4XcOAcqIE15cpeRqeJHiJiSBH-pmU5VVW1EO8,137
3
- angr-9.2.171.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
4
- angr-9.2.171.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
5
- angr-9.2.171.dist-info/METADATA,sha256=GS64c1YeNbuFYLq1cSi8UTdj9wkmozjiUWSRIbZl_gg,4343
6
- angr-9.2.171.dist-info/licenses/LICENSE,sha256=PmWf0IlSz6Jjp9n7nyyBQA79Q5C2ma68LRykY1V3GF0,1456
1
+ angr-9.2.172.dist-info/RECORD,,
2
+ angr-9.2.172.dist-info/WHEEL,sha256=wTy_3c4XcOAcqIE15cpeRqeJHiJiSBH-pmU5VVW1EO8,137
3
+ angr-9.2.172.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
4
+ angr-9.2.172.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
5
+ angr-9.2.172.dist-info/METADATA,sha256=55ffKaXpTmUAExTjDVpK_UPO5MKEwSHXIQcMUDrnARY,4343
6
+ angr-9.2.172.dist-info/licenses/LICENSE,sha256=PmWf0IlSz6Jjp9n7nyyBQA79Q5C2ma68LRykY1V3GF0,1456
7
7
  angr/vaults.py,sha256=D_gkDegCyPlZMKGC5E8zINYAaZfSXNWbmhX0rXCYpvM,9718
8
- angr/unicornlib.dylib,sha256=RTuxsysows9O6BGpxReji9XixmG73ZrwoTGqEim2mr0,264656
8
+ angr/unicornlib.dylib,sha256=E4kM6p5IQ9XGbL7Zh12CarXRVNVKccJiNPqPjHH-VjQ,264656
9
9
  angr/state_hierarchy.py,sha256=qDQCUGXmQm3vOxE3CSoiqTH4OAFFOWZZt9BLhNpeOhA,8484
10
10
  angr/callable.py,sha256=j9Orwd4H4fPqOYylcEt5GuLGPV7ZOqyA_OYO2bp5PAA,6437
11
11
  angr/sim_type.py,sha256=Z0gWJaTVwjC6I_O7nzwa0DtEXZSFA9ekikm-U2gxCR4,135357
12
12
  angr/knowledge_base.py,sha256=hRoSLuLaOXmddTSF9FN5TVs7liftpBGq_IICz5AaYBk,4533
13
13
  angr/emulator.py,sha256=572e9l-N4VUzUzLKylqpv3JmBvVC5VExi1tLy6MZSoU,4633
14
- angr/rustylib.abi3.so,sha256=kRbdyqMQUXwmTaE3CojFoV1gWx_6LqoFkpfDdtCXQMo,5259644
14
+ angr/rustylib.abi3.so,sha256=Df1Cq53wXQziP6KC27BS7ehr_LOVNNnMwBXNH7VuZMQ,5259788
15
15
  angr/codenode.py,sha256=hCrQRp4Ebb2X6JicNmY1PXo3_Pm8GDxVivVW0Pwe84k,3918
16
16
  angr/graph_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  angr/sim_manager.py,sha256=w7yTfWR-P9yoN5x85eeiNpj9dTrnjpJ3o5aoFpDAPnc,39396
18
18
  angr/serializable.py,sha256=l908phj_KcqopEEL_oCufbP_H6cm3Wc9v-5xdux1-6g,1533
19
19
  angr/code_location.py,sha256=kXNJDEMge9VRHadrK4E6HQ8wDdCaHSXNqyAZuHDEGuM,5397
20
- angr/__init__.py,sha256=R8Y4OScd7DXLUKwJ31WPkrpNOKLNUbJvO2wJsH9ZiJA,9246
20
+ angr/__init__.py,sha256=ZeGnjkV15b26W_suDwvHXnFGn8nN22iB2dV9D0w5lW4,9246
21
21
  angr/blade.py,sha256=OGGW-oggqI9_LvgZhiQuh9Ktkvf3vhRBmH0XviNyZ6o,15801
22
22
  angr/factory.py,sha256=PPNWvTiWaIgzxzyoTr8ObSF-TXp1hCdbY2e-0xBePNc,17815
23
23
  angr/sim_state_options.py,sha256=dsMY3UefvL7yZKXloubMhzUET3N2Crw-Fpw2Vd1ouZQ,12468
@@ -1236,7 +1236,7 @@ angr/analyses/decompiler/decompilation_options.py,sha256=bs6CNpU3UxepgBB_9eUH4jr
1236
1236
  angr/analyses/decompiler/region_walker.py,sha256=u0hR0bEX1hSwkv-vejIM1gS-hcX2F2DLsDqpKhQ5_pQ,752
1237
1237
  angr/analyses/decompiler/graph_region.py,sha256=uSDdCLXfLZJVcb0wMdgBh-KtBJUUhLGHQ-Ap4dNs8wo,18186
1238
1238
  angr/analyses/decompiler/utils.py,sha256=kzHYCznq8rGmwNcjv7VZs3EteEG4a94EOX18jNXSrcE,42712
1239
- angr/analyses/decompiler/decompiler.py,sha256=Mw1C-VPO283ghNS6P5KscjQLhH7Yj19SDCiSDzwU7ME,31716
1239
+ angr/analyses/decompiler/decompiler.py,sha256=adX2UJv6s4JAF7Qf6HTgwPo28QQ6yCzrrQrtlqDZyfE,31864
1240
1240
  angr/analyses/decompiler/goto_manager.py,sha256=wVoeXJcadIda84LloGgqW-rL0QHLv3fx4vZHLhmz-_o,4027
1241
1241
  angr/analyses/decompiler/block_similarity.py,sha256=S1lTlXFyOmJlQa7I3y7xgLsENLS4XGET7tdD55k_6Vg,6859
1242
1242
  angr/analyses/decompiler/ail_simplifier.py,sha256=s9hFXhNwU8fBKDOkw4vtSWhSWy9xBdF9p1463cO5930,93071
@@ -1356,7 +1356,7 @@ angr/analyses/decompiler/optimization_passes/condition_constprop.py,sha256=8UBN1
1356
1356
  angr/analyses/decompiler/optimization_passes/ret_deduplicator.py,sha256=hqOBkbiyQwGDoPdkMLwJjJOI_90QQ2R6ESs2HQ4z0iw,8005
1357
1357
  angr/analyses/decompiler/optimization_passes/ret_addr_save_simplifier.py,sha256=A7azHMeTQDXPFj44lI-mK7wnbJZ6cdSL-lwwqxiBTk0,6420
1358
1358
  angr/analyses/decompiler/optimization_passes/switch_default_case_duplicator.py,sha256=154pzAHjRaDJA1bc69Z49qDBouToemUL0BoT2ybmjw8,6476
1359
- angr/analyses/decompiler/optimization_passes/__init__.py,sha256=y7ND9Wg98M5SoMGuOespoLeh1s-wFqKyeW2_4esDsiw,5236
1359
+ angr/analyses/decompiler/optimization_passes/__init__.py,sha256=v6LlcY49Z816sgba6FORCZUQ0XHtw58AztlZ9hsTtms,5354
1360
1360
  angr/analyses/decompiler/optimization_passes/ite_expr_converter.py,sha256=DA2H1Uk8ZUTBcebQ3SFFl5n8pDSsZnQZC1Hnjv-A1a0,7835
1361
1361
  angr/analyses/decompiler/optimization_passes/switch_reused_entry_rewriter.py,sha256=6-b3u4zCwSQkMaYXDP4aTjTZdFTlIWlYfd8zC1vNuRM,4035
1362
1362
  angr/analyses/decompiler/optimization_passes/tag_slicer.py,sha256=VSlwk9ZdnFZnAAxL0gUAgqAtP6HEk4fqcYGWlD3ylGg,1181
@@ -1374,6 +1374,7 @@ angr/analyses/decompiler/optimization_passes/eager_std_string_concatenation.py,s
1374
1374
  angr/analyses/decompiler/optimization_passes/return_duplicator_low.py,sha256=YHmS48Wyegq6Hb9pI9OKybFy9MWAo9r0ujDYJgykKk8,6866
1375
1375
  angr/analyses/decompiler/optimization_passes/code_motion.py,sha256=fdUvRseuFiH6ehpk9uWWMityDuBs_kqmIjYMi92dDkw,15353
1376
1376
  angr/analyses/decompiler/optimization_passes/stack_canary_simplifier.py,sha256=z8Fz1DXuwe0FVAvwPTJfrl6G9QsHoX0RI7gcB57jupU,14709
1377
+ angr/analyses/decompiler/optimization_passes/peephole_simplifier.py,sha256=4PeOX1al4raJ7QCVLyNcffF_Q5XnPS1vDwz4riNUeHQ,2672
1377
1378
  angr/analyses/decompiler/optimization_passes/base_ptr_save_simplifier.py,sha256=-kuCQk0ALYM1rmr6VaijrZYgHseeXqlWECaekKfI6hE,6120
1378
1379
  angr/analyses/decompiler/optimization_passes/x86_gcc_getpc_simplifier.py,sha256=aTQV3_yQaAKhQ24V66alxErjg7jv6gellWCqsT9G-lE,3104
1379
1380
  angr/analyses/decompiler/optimization_passes/mod_simplifier.py,sha256=9ekxyvxF8g3tN5oanUg96HaYiyYVbj5Nf-vSeeq86kI,3384
@@ -1390,10 +1391,10 @@ angr/analyses/decompiler/counters/seq_cf_structure_counter.py,sha256=gyNYOAo3bao
1390
1391
  angr/analyses/decompiler/counters/__init__.py,sha256=UT5K0cWgkVTAXZxy1qBBzrQip3YR2BOBVpxlAuNlt5o,480
1391
1392
  angr/analyses/decompiler/counters/boolean_counter.py,sha256=FG3M8dMpbU_WAyr8PV2iEI43OLUxoZ6JQ1johkMtivw,893
1392
1393
  angr/analyses/decompiler/presets/__init__.py,sha256=NWARH5yOyBz4-5qKhzH56PNfPNRViNKMDeESlpplFxo,375
1393
- angr/analyses/decompiler/presets/preset.py,sha256=sTK5fJfx_Cdx0Gjn7y4bOrDp-2eFPeg1e1d5Eyc9uXk,1256
1394
- angr/analyses/decompiler/presets/fast.py,sha256=52ZiYOp165AaCjRok6P7WP9HCzMMYgWX8kMQgTNKkTw,1542
1395
- angr/analyses/decompiler/presets/full.py,sha256=NbyJ3h589kWlYL6uDz6rv0R9gkGqX2TF0i-OLZM3Jb4,1786
1396
- angr/analyses/decompiler/presets/basic.py,sha256=KDHlMq_XWonN2-JIYYVIhbI6FbfzXttmkgXFrwi5MiA,803
1394
+ angr/analyses/decompiler/presets/preset.py,sha256=LvX7ydyO0ZzQsC0M2fy1wXA_0ygSqeP9P52VJAK0Eeo,1264
1395
+ angr/analyses/decompiler/presets/fast.py,sha256=0q9DEyWZOzt6MMJe2bb9LjlGrgv5NxgEjAb6Z1fah24,1636
1396
+ angr/analyses/decompiler/presets/full.py,sha256=j6ccrb3I8RFnxAZXbkdnMwCmG6AwIddP0qGD-7LzXz8,1880
1397
+ angr/analyses/decompiler/presets/basic.py,sha256=sHT2oalBmINVSZfpEbx4LmK0G1zqbZmLaVCAH-r-VDI,897
1397
1398
  angr/analyses/s_reaching_definitions/__init__.py,sha256=TyfVplxkJj8FAAAw9wegzJlcrbGwlFpIB23PdCcwrLA,254
1398
1399
  angr/analyses/s_reaching_definitions/s_reaching_definitions.py,sha256=gNdg8xpu5by_McWU8j0g0502yQsO2evkTlben9yimV0,7826
1399
1400
  angr/analyses/s_reaching_definitions/s_rda_model.py,sha256=FJSge_31FFzyzBJA1xm7dQz40TfuNna6v_RWAZMZvi0,5801
File without changes