angr 9.2.126__py3-none-macosx_11_0_arm64.whl → 9.2.127__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 (31) hide show
  1. angr/__init__.py +1 -1
  2. angr/analyses/analysis.py +8 -2
  3. angr/analyses/cfg/cfg_fast.py +12 -1
  4. angr/analyses/decompiler/clinic.py +1 -0
  5. angr/analyses/decompiler/condition_processor.py +5 -7
  6. angr/analyses/decompiler/decompilation_cache.py +4 -0
  7. angr/analyses/decompiler/decompiler.py +18 -3
  8. angr/analyses/decompiler/dephication/graph_vvar_mapping.py +1 -2
  9. angr/analyses/decompiler/ssailification/traversal.py +1 -0
  10. angr/analyses/decompiler/ssailification/traversal_engine.py +15 -0
  11. angr/analyses/decompiler/structured_codegen/c.py +0 -3
  12. angr/analyses/decompiler/structured_codegen/dwarf_import.py +4 -1
  13. angr/analyses/reaching_definitions/function_handler_library/string.py +2 -2
  14. angr/analyses/s_liveness.py +3 -3
  15. angr/analyses/s_propagator.py +74 -3
  16. angr/angrdb/models.py +2 -1
  17. angr/angrdb/serializers/kb.py +3 -3
  18. angr/angrdb/serializers/structured_code.py +5 -3
  19. angr/calling_conventions.py +1 -1
  20. angr/knowledge_base.py +1 -1
  21. angr/knowledge_plugins/__init__.py +0 -2
  22. angr/knowledge_plugins/structured_code.py +1 -1
  23. angr/lib/angr_native.dylib +0 -0
  24. angr/utils/ssa/__init__.py +8 -3
  25. {angr-9.2.126.dist-info → angr-9.2.127.dist-info}/METADATA +6 -6
  26. {angr-9.2.126.dist-info → angr-9.2.127.dist-info}/RECORD +30 -31
  27. angr/knowledge_plugins/decompilation.py +0 -45
  28. {angr-9.2.126.dist-info → angr-9.2.127.dist-info}/LICENSE +0 -0
  29. {angr-9.2.126.dist-info → angr-9.2.127.dist-info}/WHEEL +0 -0
  30. {angr-9.2.126.dist-info → angr-9.2.127.dist-info}/entry_points.txt +0 -0
  31. {angr-9.2.126.dist-info → angr-9.2.127.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.126"
5
+ __version__ = "9.2.127"
6
6
 
7
7
  if bytes is str:
8
8
  raise Exception(
angr/analyses/analysis.py CHANGED
@@ -9,6 +9,7 @@ from typing import TYPE_CHECKING, TypeVar, Generic, cast
9
9
  from collections.abc import Callable
10
10
  from types import NoneType
11
11
  from itertools import chain
12
+ from traceback import format_exception
12
13
 
13
14
  import logging
14
15
  import time
@@ -75,6 +76,11 @@ class AnalysisLogEntry:
75
76
 
76
77
  self.message = message
77
78
 
79
+ def format(self) -> str:
80
+ if self.exc_traceback is None:
81
+ return self.message
82
+ return "\n".join((*format_exception(self.exc_type, self.exc_value, self.exc_traceback), "", self.message))
83
+
78
84
  def __getstate__(self):
79
85
  return (
80
86
  str(self.__dict__.get("exc_type")),
@@ -281,8 +287,8 @@ class Analysis:
281
287
  kb: KnowledgeBase
282
288
  _fail_fast: bool
283
289
  _name: str
284
- errors = []
285
- named_errors = defaultdict(list)
290
+ errors: list[AnalysisLogEntry] = []
291
+ named_errors: defaultdict[str, list[AnalysisLogEntry]] = defaultdict(list)
286
292
  _progress_callback = None
287
293
  _show_progressbar = False
288
294
  _progressbar = None
@@ -3309,7 +3309,18 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
3309
3309
  # this is not a no-op block. Determine where nop instructions terminate.
3310
3310
  insns = block.capstone.insns
3311
3311
  if insns:
3312
- nop_length = self._get_nop_length(insns)
3312
+ if (
3313
+ self.project.simos is not None
3314
+ and self.project.simos.name == "Win32"
3315
+ and insns[0].mnemonic == "mov"
3316
+ ):
3317
+ op0, op1 = insns[0].operands
3318
+ if op0.type == 1 and op1.type == 1 and op0.reg == op1.reg:
3319
+ # hot-patch points on Windows DLLs
3320
+ # https://devblogs.microsoft.com/oldnewthing/20110921-00/?p=9583
3321
+ nop_length = None
3322
+ else:
3323
+ nop_length = self._get_nop_length(insns)
3313
3324
 
3314
3325
  if nop_length is None or nop_length <= 0:
3315
3326
  continue
@@ -1043,6 +1043,7 @@ class Clinic(Analysis):
1043
1043
  reg_name=self.project.arch.translate_register_name(
1044
1044
  ret_reg_offset, size=self.project.arch.bits
1045
1045
  ),
1046
+ **target.tags,
1046
1047
  )
1047
1048
  call_stmt = ailment.Stmt.Call(
1048
1049
  None,
@@ -1113,17 +1113,15 @@ class ConditionProcessor:
1113
1113
  r1_with: claripy.ast.Bool,
1114
1114
  ) -> claripy.ast.Bool:
1115
1115
  if ast.op == "And":
1116
- return ast.make_like(
1117
- "And", (ConditionProcessor._replace_term_in_ast(arg, r0, r0_with, r1, r1_with) for arg in ast.args)
1116
+ return claripy.And(
1117
+ *(ConditionProcessor._replace_term_in_ast(arg, r0, r0_with, r1, r1_with) for arg in ast.args)
1118
1118
  )
1119
1119
  if ast.op == "Or":
1120
- return ast.make_like(
1121
- "Or", (ConditionProcessor._replace_term_in_ast(arg, r0, r0_with, r1, r1_with) for arg in ast.args)
1120
+ return claripy.Or(
1121
+ *(ConditionProcessor._replace_term_in_ast(arg, r0, r0_with, r1, r1_with) for arg in ast.args)
1122
1122
  )
1123
1123
  if ast.op == "Not":
1124
- return ast.make_like(
1125
- "Not", (ConditionProcessor._replace_term_in_ast(ast.args[0], r0, r0_with, r1, r1_with),)
1126
- )
1124
+ return claripy.Not(ConditionProcessor._replace_term_in_ast(ast.args[0], r0, r0_with, r1, r1_with))
1127
1125
  if ast is r0:
1128
1126
  return r0_with
1129
1127
  if ast is r1:
@@ -23,6 +23,7 @@ class DecompilationCache:
23
23
  "clinic",
24
24
  "ite_exprs",
25
25
  "binop_operators",
26
+ "errors",
26
27
  )
27
28
 
28
29
  def __init__(self, addr):
@@ -35,7 +36,10 @@ class DecompilationCache:
35
36
  self.clinic: Clinic | None = None
36
37
  self.ite_exprs: set[tuple[int, Any]] | None = None
37
38
  self.binop_operators: dict[OpDescriptor, str] | None = None
39
+ self.errors: list[str] = []
38
40
 
39
41
  @property
40
42
  def local_types(self):
43
+ if self.clinic is None or self.clinic.variable_kb is None:
44
+ return None
41
45
  return self.clinic.variable_kb.variables[self.addr].types
@@ -139,7 +139,22 @@ class Decompiler(Analysis):
139
139
  self.expr_collapse_depth = expr_collapse_depth
140
140
 
141
141
  if decompile:
142
- self._decompile()
142
+ with self._resilience():
143
+ self._decompile()
144
+ if self.errors:
145
+ if (self.func.addr, self._flavor) not in self.kb.decompilations:
146
+ self.kb.decompilations[(self.func.addr, self._flavor)] = DecompilationCache(self.func.addr)
147
+ for error in self.errors:
148
+ self.kb.decompilations[(self.func.addr, self._flavor)].errors.append(error.format())
149
+ with self._resilience():
150
+ l.info("Decompilation failed for %s. Switching to basic preset and trying again.")
151
+ if preset != DECOMPILATION_PRESETS["basic"]:
152
+ self._optimization_passes = DECOMPILATION_PRESETS["basic"].get_optimization_passes(
153
+ self.project.arch, self.project.simos.name
154
+ )
155
+ self._decompile()
156
+ for error in self.errors:
157
+ self.kb.decompilations[(self.func.addr, self._flavor)].errors.append(error.format())
143
158
 
144
159
  def _can_use_decompilation_cache(self, cache: DecompilationCache) -> bool:
145
160
  a, b = self._cache_parameters, cache.parameters
@@ -155,7 +170,7 @@ class Decompiler(Analysis):
155
170
 
156
171
  if self._cache_parameters is not None:
157
172
  try:
158
- cache = self.kb.decompilations[self.func.addr]
173
+ cache = self.kb.decompilations[(self.func.addr, self._flavor)]
159
174
  if not self._can_use_decompilation_cache(cache):
160
175
  cache = None
161
176
  except KeyError:
@@ -347,7 +362,7 @@ class Decompiler(Analysis):
347
362
  self.cache.codegen = codegen
348
363
  self.cache.clinic = self.clinic
349
364
 
350
- self.kb.decompilations[self.func.addr] = self.cache
365
+ self.kb.decompilations[(self.func.addr, self._flavor)] = self.cache
351
366
 
352
367
  def _recover_regions(self, graph: networkx.DiGraph, condition_processor, update_graph: bool = True):
353
368
  return self.project.analyses[RegionIdentifier].prep(kb=self.kb)(
@@ -290,8 +290,7 @@ class GraphDephicationVVarMapping(Analysis): # pylint:disable=abstract-method
290
290
  for stmt in dst_block.statements:
291
291
  if isinstance(stmt, Label):
292
292
  continue
293
- r, _ = is_phi_assignment(stmt)
294
- if r:
293
+ if is_phi_assignment(stmt):
295
294
  for src_, vvar in stmt.src.src_and_vvars:
296
295
  if src_ == src and vvar is not None and vvar.varid == vvar_id:
297
296
  return True
@@ -32,6 +32,7 @@ class TraversalAnalysis(ForwardAnalysis[None, NodeType, object, object]):
32
32
  )
33
33
  self._engine_ail = SimEngineSSATraversal(
34
34
  self.project.arch,
35
+ self.project.simos,
35
36
  sp_tracker=sp_tracker,
36
37
  bp_as_gpr=bp_as_gpr,
37
38
  stackvars=self._stackvars,
@@ -7,6 +7,7 @@ from ailment.expression import Register, BinaryOp, StackBaseOffset, ITE, VEXCCal
7
7
  from angr.engines.light import SimEngineLight, SimEngineLightAILMixin
8
8
  from angr.utils.ssa import get_reg_offset_base
9
9
  from angr.utils.orderedset import OrderedSet
10
+ from angr.calling_conventions import default_cc
10
11
  from .traversal_state import TraversalState
11
12
 
12
13
 
@@ -23,6 +24,7 @@ class SimEngineSSATraversal(
23
24
  def __init__(
24
25
  self,
25
26
  arch,
27
+ simos,
26
28
  sp_tracker=None,
27
29
  bp_as_gpr: bool = False,
28
30
  def_to_loc=None,
@@ -33,6 +35,7 @@ class SimEngineSSATraversal(
33
35
  super().__init__()
34
36
 
35
37
  self.arch = arch
38
+ self.simos = simos
36
39
  self.sp_tracker = sp_tracker
37
40
  self.bp_as_gpr = bp_as_gpr
38
41
  self.stackvars = stackvars
@@ -75,6 +78,18 @@ class SimEngineSSATraversal(
75
78
  self._expr(stmt.false_target)
76
79
 
77
80
  def _handle_Call(self, stmt: Call):
81
+
82
+ # kill caller-saved registers
83
+ cc = (
84
+ default_cc(self.arch.name, platform=self.simos.name if self.simos is not None else None)
85
+ if stmt.calling_convention is None
86
+ else stmt.calling_convention
87
+ )
88
+ for reg_name in cc.CALLER_SAVED_REGS:
89
+ reg_offset = self.arch.registers[reg_name][0]
90
+ base_off = get_reg_offset_base(reg_offset, self.arch)
91
+ self.state.live_registers.discard(base_off)
92
+
78
93
  if stmt.ret_expr is not None and isinstance(stmt.ret_expr, Register):
79
94
  codeloc = self._codeloc()
80
95
  self.def_to_loc.append((stmt.ret_expr, codeloc))
@@ -2511,9 +2511,6 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
2511
2511
 
2512
2512
  self._analyze()
2513
2513
 
2514
- if flavor is not None:
2515
- self.kb.structured_code[(func.addr, flavor)] = self
2516
-
2517
2514
  def reapply_options(self, options):
2518
2515
  for option, value in options:
2519
2516
  if option.param == "braces_on_own_lines":
@@ -5,6 +5,7 @@ import logging
5
5
  from sortedcontainers import SortedList
6
6
 
7
7
  from angr.analyses import Analysis, register_analysis
8
+ from angr.analyses.decompiler.decompilation_cache import DecompilationCache
8
9
  from .base import BaseStructuredCodeGenerator, InstructionMapping, PositionMapping
9
10
  from angr.knowledge_plugins.functions.function import Function
10
11
 
@@ -30,7 +31,9 @@ class ImportSourceCode(BaseStructuredCodeGenerator, Analysis):
30
31
  self.regenerate_text()
31
32
 
32
33
  if flavor is not None and self.text:
33
- self.kb.structured_code[(function.addr, flavor)] = self
34
+ if (function.addr, flavor) not in self.kb.decompilations:
35
+ self.kb.decompilations[(function.addr, flavor)] = DecompilationCache(function.addr)
36
+ self.kb.decompilations[(function.addr, flavor)].codegen = self
34
37
 
35
38
  def regenerate_text(self):
36
39
  cache = {}
@@ -46,8 +46,8 @@ class LibcStringHandlers(FunctionHandler):
46
46
 
47
47
  @FunctionCallDataUnwrapped.decorate
48
48
  def handle_impl_strncpy(self, state: ReachingDefinitionsState, data: FunctionCallDataUnwrapped):
49
- n = state.get_concrete_value(data.args_atoms[1])
50
- src_atom = state.deref(data.args_atoms[2], DerefSize.NULL_TERMINATE if n is None else n)
49
+ n = state.get_concrete_value(data.args_atoms[2])
50
+ src_atom = state.deref(data.args_atoms[1], DerefSize.NULL_TERMINATE if n is None else n)
51
51
  src_str = state.get_values(src_atom)
52
52
  if src_str is not None:
53
53
  dst_atom = state.deref(data.args_atoms[0], len(src_str) // 8)
@@ -5,7 +5,7 @@ from ailment.expression import VirtualVariable
5
5
  from ailment.statement import Assignment
6
6
 
7
7
  from angr.analyses import Analysis, register_analysis
8
- from angr.utils.ssa import is_phi_assignment, VVarUsesCollector
8
+ from angr.utils.ssa import VVarUsesCollector, phi_assignment_get_src
9
9
 
10
10
 
11
11
  class SLivenessModel:
@@ -85,8 +85,8 @@ class SLivenessAnalysis(Analysis):
85
85
  if isinstance(stmt, Assignment) and isinstance(stmt.dst, VirtualVariable):
86
86
  live.discard(stmt.dst.varid)
87
87
 
88
- r, phi_expr = is_phi_assignment(stmt)
89
- if r:
88
+ phi_expr = phi_assignment_get_src(stmt)
89
+ if phi_expr is not None:
90
90
  for src, vvar in phi_expr.src_and_vvars:
91
91
  if src not in live_in_by_pred:
92
92
  live_in_by_pred[src] = live.copy()
@@ -4,7 +4,7 @@ import contextlib
4
4
  from collections import defaultdict
5
5
 
6
6
  from ailment.block import Block
7
- from ailment.expression import Const, VirtualVariable, VirtualVariableCategory, StackBaseOffset
7
+ from ailment.expression import Const, VirtualVariable, VirtualVariableCategory, StackBaseOffset, Load, Convert
8
8
  from ailment.statement import Assignment, Store, Return, Jump
9
9
 
10
10
  from angr.knowledge_plugins.functions import Function
@@ -21,6 +21,7 @@ from angr.utils.ssa import (
21
21
  is_const_vvar_tmp_assignment,
22
22
  get_tmp_uselocs,
23
23
  get_tmp_deflocs,
24
+ phi_assignment_get_src,
24
25
  )
25
26
 
26
27
 
@@ -129,8 +130,8 @@ class SPropagatorAnalysis(Analysis):
129
130
  replacements[useloc][vvar_at_use] = v
130
131
  continue
131
132
 
132
- r, v = is_phi_assignment(stmt)
133
- if r:
133
+ v = phi_assignment_get_src(stmt)
134
+ if v is not None:
134
135
  src_varids = {vvar.varid if vvar is not None else None for _, vvar in v.src_and_vvars}
135
136
  if None not in src_varids and all(varid in const_vvars for varid in src_varids):
136
137
  src_values = {
@@ -182,6 +183,31 @@ class SPropagatorAnalysis(Analysis):
182
183
  # this vvar is used once if we exclude its uses at ret sites or jump sites. we can propagate it
183
184
  for vvar_used, vvar_useloc in vvar_uselocs[vvar.varid]:
184
185
  replacements[vvar_useloc][vvar_used] = stmt.src
186
+ continue
187
+
188
+ # special logic for global variables: if it's used once or multiple times, and the variable is never
189
+ # updated before it's used, we will propagate the load
190
+ if isinstance(stmt, Assignment):
191
+ stmt_src = stmt.src
192
+ # unpack conversions
193
+ while isinstance(stmt_src, Convert):
194
+ stmt_src = stmt_src.operand
195
+ if isinstance(stmt_src, Load) and isinstance(stmt_src.addr, Const):
196
+ gv_updated = False
197
+ for vvar_used, vvar_useloc in vvar_uselocs[vvar.varid]:
198
+ gv_updated |= self.is_global_variable_updated(
199
+ self.func_graph,
200
+ blocks,
201
+ vvar.varid,
202
+ stmt_src.addr.value,
203
+ stmt_src.size,
204
+ defloc,
205
+ vvar_useloc,
206
+ )
207
+ if not gv_updated:
208
+ for vvar_used, vvar_useloc in vvar_uselocs[vvar.varid]:
209
+ replacements[vvar_useloc][vvar_used] = stmt.src
210
+ continue
185
211
 
186
212
  for vvar_id, uselocs in vvar_uselocs.items():
187
213
  vvar = next(iter(uselocs))[0] if vvar_id not in vvarid_to_vvar else vvarid_to_vvar[vvar_id]
@@ -257,5 +283,50 @@ class SPropagatorAnalysis(Analysis):
257
283
 
258
284
  self.model.replacements = replacements
259
285
 
286
+ @staticmethod
287
+ def is_global_variable_updated(
288
+ func_graph, block_dict, varid: int, gv_addr: int, gv_size: int, defloc: CodeLocation, useloc: CodeLocation
289
+ ) -> bool:
290
+ defblock = block_dict[(defloc.block_addr, defloc.block_idx)]
291
+ useblock = block_dict[(useloc.block_addr, useloc.block_idx)]
292
+
293
+ # traverse a graph slice from the def block to the use block and check if the global variable is updated
294
+ seen = {defblock}
295
+ queue = [defblock]
296
+ while queue:
297
+ block = queue.pop(0)
298
+
299
+ start_stmt_idx = defloc.stmt_idx if block is defblock else 0 # inclusive
300
+ end_stmt_idx = useloc.stmt_idx if block is useblock else len(block.statements) # exclusive
301
+
302
+ for idx in range(start_stmt_idx, end_stmt_idx):
303
+ stmt = block.statements[idx]
304
+ if isinstance(stmt, Store) and isinstance(stmt.addr, Const):
305
+ store_addr = stmt.addr.value
306
+ store_size = stmt.size
307
+ if gv_addr <= store_addr < gv_addr + gv_size or store_addr <= gv_addr < store_addr + store_size:
308
+ return True
309
+
310
+ if block is useblock:
311
+ continue
312
+
313
+ for succ in func_graph.successors(block):
314
+ if succ not in seen:
315
+ abort_path = False
316
+ for stmt in succ.statements:
317
+ if is_phi_assignment(stmt) and any(
318
+ vvar.varid == varid for _, vvar in stmt.src.src_and_vvars if vvar is not None
319
+ ):
320
+ # the virtual variable is no longer live after this point
321
+ abort_path = True
322
+ break
323
+ if abort_path:
324
+ continue
325
+
326
+ seen.add(succ)
327
+ queue.append(succ)
328
+
329
+ return False
330
+
260
331
 
261
332
  register_analysis(SPropagatorAnalysis, "SPropagator")
angr/angrdb/models.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from __future__ import annotations
2
- from sqlalchemy import Column, Integer, String, Boolean, BLOB, ForeignKey
2
+ from sqlalchemy import Column, Integer, String, Boolean, BLOB, TEXT, ForeignKey
3
3
  from sqlalchemy.orm import declarative_base, relationship
4
4
 
5
5
  Base = declarative_base()
@@ -127,6 +127,7 @@ class DbStructuredCode(Base):
127
127
  configuration = Column(BLOB, nullable=True)
128
128
  const_formats = Column(BLOB, nullable=True)
129
129
  ite_exprs = Column(BLOB, nullable=True)
130
+ errors = Column(TEXT, nullable=True)
130
131
 
131
132
 
132
133
  class DbXRefs(Base):
@@ -16,7 +16,7 @@ class KnowledgeBaseSerializer:
16
16
  """
17
17
 
18
18
  @staticmethod
19
- def dump(session, kb):
19
+ def dump(session, kb: KnowledgeBase):
20
20
  """
21
21
 
22
22
  :param session: The database session object.
@@ -40,7 +40,7 @@ class KnowledgeBaseSerializer:
40
40
  CommentsSerializer.dump(session, db_kb, kb.comments)
41
41
  LabelsSerializer.dump(session, db_kb, kb.labels)
42
42
  VariableManagerSerializer.dump(session, db_kb, kb.variables)
43
- StructuredCodeManagerSerializer.dump(session, db_kb, kb.structured_code)
43
+ StructuredCodeManagerSerializer.dump(session, db_kb, kb.decompilations)
44
44
 
45
45
  @staticmethod
46
46
  def load(session, project, name):
@@ -89,7 +89,7 @@ class KnowledgeBaseSerializer:
89
89
  # Load structured code
90
90
  structured_code = StructuredCodeManagerSerializer.load(session, db_kb, kb)
91
91
  if structured_code is not None:
92
- kb.structured_code = structured_code
92
+ kb.decompilations = structured_code
93
93
 
94
94
  if cfg_model is not None:
95
95
  # CFG may not exist for all knowledge bases
@@ -37,15 +37,15 @@ class StructuredCodeManagerSerializer:
37
37
  # TODO: Cache types
38
38
 
39
39
  expr_comments = None
40
- if cache.codegen.expr_comments:
40
+ if cache.codegen is not None and cache.codegen.expr_comments:
41
41
  expr_comments = json.dumps(cache.codegen.expr_comments).encode("utf-8")
42
42
 
43
43
  stmt_comments = None
44
- if cache.codegen.stmt_comments:
44
+ if cache.codegen is not None and cache.codegen.stmt_comments:
45
45
  stmt_comments = json.dumps(cache.codegen.stmt_comments).encode("utf-8")
46
46
 
47
47
  const_formats = None
48
- if cache.codegen.const_formats:
48
+ if cache.codegen is not None and cache.codegen.const_formats:
49
49
  const_formats = pickle.dumps(cache.codegen.const_formats)
50
50
 
51
51
  ite_exprs = None
@@ -60,6 +60,7 @@ class StructuredCodeManagerSerializer:
60
60
  stmt_comments=stmt_comments,
61
61
  const_formats=const_formats,
62
62
  ite_exprs=ite_exprs,
63
+ errors="\n\n\n".join(cache.errors),
63
64
  # configuration=configuration,
64
65
  )
65
66
  session.add(db_code)
@@ -118,6 +119,7 @@ class StructuredCodeManagerSerializer:
118
119
  cache = DecompilationCache(db_code.func_addr)
119
120
  cache.codegen = dummy_codegen
120
121
  cache.ite_exprs = ite_exprs
122
+ cache.errors = db_code.errors.split("\n\n\n")
121
123
  manager[(db_code.func_addr, db_code.flavor)] = cache
122
124
 
123
125
  return manager
@@ -1654,7 +1654,7 @@ class SimCCAMD64WindowsSyscall(SimCCSyscall):
1654
1654
  class SimCCARM(SimCC):
1655
1655
  ARG_REGS = ["r0", "r1", "r2", "r3"]
1656
1656
  FP_ARG_REGS = [] # regular arg regs are used as fp arg regs
1657
- CALLER_SAVED_REGS = []
1657
+ CALLER_SAVED_REGS = ["r0", "r1", "r2", "r3"]
1658
1658
  RETURN_ADDR = SimRegArg("lr", 4)
1659
1659
  RETURN_VAL = SimRegArg("r0", 4)
1660
1660
  OVERFLOW_RETURN_VAL = SimRegArg("r1", 4)
angr/knowledge_base.py CHANGED
@@ -35,13 +35,13 @@ class KnowledgeBase:
35
35
 
36
36
  functions: FunctionManager
37
37
  variables: VariableManager
38
- structured_code: StructuredCodeManager
39
38
  defs: KeyDefinitionManager
40
39
  cfgs: CFGManager
41
40
  _project: Project
42
41
  types: TypesStore
43
42
  propagations: PropagationManager
44
43
  xrefs: XRefManager
44
+ decompilations: StructuredCodeManager
45
45
 
46
46
  def __init__(self, project, obj=None, name=None):
47
47
  if obj is not None:
@@ -17,7 +17,6 @@ from .structured_code import StructuredCodeManager
17
17
  from .types import TypesStore
18
18
  from .callsite_prototypes import CallsitePrototypes
19
19
  from .custom_strings import CustomStrings
20
- from .decompilation import DecompilationManager
21
20
  from .obfuscations import Obfuscations
22
21
 
23
22
 
@@ -40,6 +39,5 @@ __all__ = (
40
39
  "TypesStore",
41
40
  "CallsitePrototypes",
42
41
  "CustomStrings",
43
- "DecompilationManager",
44
42
  "Obfuscations",
45
43
  )
@@ -60,4 +60,4 @@ class StructuredCodeManager(KnowledgeBasePlugin):
60
60
  raise NotImplementedError
61
61
 
62
62
 
63
- KnowledgeBasePlugin.register_default("structured_code", StructuredCodeManager)
63
+ KnowledgeBasePlugin.register_default("decompilations", StructuredCodeManager)
Binary file
@@ -178,10 +178,14 @@ def is_const_vvar_load_dirty_assignment(stmt: Statement) -> bool:
178
178
  return False
179
179
 
180
180
 
181
- def is_phi_assignment(stmt: Statement) -> tuple[bool, Phi | None]:
181
+ def is_phi_assignment(stmt: Statement) -> bool:
182
+ return isinstance(stmt, Assignment) and isinstance(stmt.src, Phi)
183
+
184
+
185
+ def phi_assignment_get_src(stmt: Statement) -> Phi | None:
182
186
  if isinstance(stmt, Assignment) and isinstance(stmt.src, Phi):
183
- return True, stmt.src
184
- return False, None
187
+ return stmt.src
188
+ return None
185
189
 
186
190
 
187
191
  __all__ = (
@@ -190,6 +194,7 @@ __all__ = (
190
194
  "get_vvar_uselocs",
191
195
  "is_const_assignment",
192
196
  "is_phi_assignment",
197
+ "phi_assignment_get_src",
193
198
  "is_const_and_vvar_assignment",
194
199
  "is_const_vvar_load_assignment",
195
200
  "is_const_vvar_load_dirty_assignment",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: angr
3
- Version: 9.2.126
3
+ Version: 9.2.127
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
  Home-page: https://github.com/angr/angr
6
6
  License: BSD-2-Clause
@@ -16,13 +16,13 @@ Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Requires-Dist: CppHeaderParser
18
18
  Requires-Dist: GitPython
19
- Requires-Dist: ailment==9.2.126
20
- Requires-Dist: archinfo==9.2.126
19
+ Requires-Dist: ailment==9.2.127
20
+ Requires-Dist: archinfo==9.2.127
21
21
  Requires-Dist: cachetools
22
22
  Requires-Dist: capstone==5.0.3
23
23
  Requires-Dist: cffi>=1.14.0
24
- Requires-Dist: claripy==9.2.126
25
- Requires-Dist: cle==9.2.126
24
+ Requires-Dist: claripy==9.2.127
25
+ Requires-Dist: cle==9.2.127
26
26
  Requires-Dist: itanium-demangler
27
27
  Requires-Dist: mulpyplexer
28
28
  Requires-Dist: nampa
@@ -31,7 +31,7 @@ Requires-Dist: protobuf>=5.28.2
31
31
  Requires-Dist: psutil
32
32
  Requires-Dist: pycparser>=2.18
33
33
  Requires-Dist: pyformlang
34
- Requires-Dist: pyvex==9.2.126
34
+ Requires-Dist: pyvex==9.2.127
35
35
  Requires-Dist: rich>=13.1.0
36
36
  Requires-Dist: sortedcontainers
37
37
  Requires-Dist: sympy
@@ -1,17 +1,17 @@
1
- angr/__init__.py,sha256=9wJycKm7XIhAgcU_NaR1jipFfExGOE4p3d01V5DIbAE,9153
1
+ angr/__init__.py,sha256=RVxXUHB8F4gQKi1KltS9-39I-4HywT29QiDLx2F1bMY,9153
2
2
  angr/__main__.py,sha256=XeawhF6Cco9eWcfMTDWzYYggLB3qjnQ87IIeFOplaHM,2873
3
3
  angr/annocfg.py,sha256=5fiS9TPt5r1_8g_qSfD2XkETlBdm5MTClBIQKqhm040,10624
4
4
  angr/blade.py,sha256=GpbEumxMsb_6qD7TbtfZuW2CMzV7W1iwqYzQWYlXnxM,15394
5
5
  angr/block.py,sha256=O5kFpofRMVlCqdG-6E53UEti7bGtIcqqx6fvyWDPu58,14975
6
6
  angr/callable.py,sha256=1rzhXjWlx62jKJaRKHvp12rbsJ75zNa86vXtCt6eFLo,6065
7
- angr/calling_conventions.py,sha256=2Fet0k_lIPMYwyOqHpYWz6SlPontXID8BBsSVrMwKWs,92950
7
+ angr/calling_conventions.py,sha256=oBgMwDZBVqKYcLa9w96Brn32s06Ffuru3fd2V7gFI_0,92972
8
8
  angr/code_location.py,sha256=JpxnEa-FbQIloGwrGa4SyZlA6La_DsvHNt4WMh7lMMY,5466
9
9
  angr/codenode.py,sha256=z-XdQh20yl_exg5H4Ep62Kw2lb3ce8od_IaEHw2v-D8,3793
10
10
  angr/errors.py,sha256=I0L-TbxmVYIkC-USuHwaQ9BGPi2YVObnhZXQQ3kJFuo,8385
11
11
  angr/factory.py,sha256=YMieuzZk70g96BcqgUT0vZxemDlQh0WvjzoxZgduZj0,17453
12
12
  angr/graph_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  angr/keyed_region.py,sha256=bi4xQYh3Is4t5LuFykgVDaaPpko0s4kEmDUEsGsJuPM,17992
14
- angr/knowledge_base.py,sha256=rpQTkiIKpbjkJTaIaPf-L7ylwiGeM95VTGnUsTg9pOs,4538
14
+ angr/knowledge_base.py,sha256=cvMTebMzLwTdvYCALxGDK1mj3PRf-CJWfI0GFOUDNxo,4537
15
15
  angr/project.py,sha256=TQUXF1qyKpYjAs0gY2abwwhSwxLj67IeHlwQC-9ylcY,37535
16
16
  angr/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
17
17
  angr/serializable.py,sha256=l908phj_KcqopEEL_oCufbP_H6cm3Wc9v-5xdux1-6g,1533
@@ -27,7 +27,7 @@ angr/state_hierarchy.py,sha256=qDQCUGXmQm3vOxE3CSoiqTH4OAFFOWZZt9BLhNpeOhA,8484
27
27
  angr/tablespecs.py,sha256=Kx1e87FxTx3_ZN7cAHWZSRpdInT4Vfj5gExAWtLkLTw,3259
28
28
  angr/vaults.py,sha256=v_RBKEGN2wkyOoskC_akKSlawcRtMicukKh1O1hxrJk,9719
29
29
  angr/analyses/__init__.py,sha256=wchoQKOTR2QWB-5Gk-cNI4Zi5510LPZcBjcDp9PiIOw,3434
30
- angr/analyses/analysis.py,sha256=ggR1xFe0HSpLhkqiJtmzm8qmS5H-7xZDwhYf4IyBNf8,14551
30
+ angr/analyses/analysis.py,sha256=upfeqlRt9mePT1io8FvV_rREdGrjZOROoERmqjqHv30,14872
31
31
  angr/analyses/backward_slice.py,sha256=pLMeo7Y2niifNmtfIzMbQDlRy_w5GbKi1sYa0XVhPBA,27228
32
32
  angr/analyses/binary_optimizer.py,sha256=JqKfOXx5FiWsYdQ6JMWYivfB2AiNl2Pw8Utk8kPEVrk,26186
33
33
  angr/analyses/bindiff.py,sha256=ZAnBeB4-0sGRZ494MTjM6NrNXL33YWcXw2bHZRBqY8M,51431
@@ -54,8 +54,8 @@ angr/analyses/patchfinder.py,sha256=i0TJmBwNlFKJYpG04YpU6yFBdZlNAuzj3VwM28jfnW0,
54
54
  angr/analyses/pathfinder.py,sha256=_prNqmRUSuSt2ZCP8qbvNN7pw7mtM8pWr9IL0AO6XL8,11496
55
55
  angr/analyses/proximity_graph.py,sha256=-g7pNpbP2HQhKW3w1Eff23K8vAsgWWYoe3wVxRh3Lhk,16066
56
56
  angr/analyses/reassembler.py,sha256=y41XIGWqCVvwFlE3uACEMFLR-vByKkOazC405UPCOpM,98524
57
- angr/analyses/s_liveness.py,sha256=YI-N62--Wo8B4yB5lvUi4mFBNqxwRxYq-p3zXR4qFNs,5213
58
- angr/analyses/s_propagator.py,sha256=vmOnkwrBQTvh3WJbAXY7R4imAW_AKzYoeRM311oXVsA,11311
57
+ angr/analyses/s_liveness.py,sha256=TQ_Er-6nQXZZU-tp_LNUXPbZeVCyR_QtVofpPLo8DU4,5239
58
+ angr/analyses/s_propagator.py,sha256=7iyYX_MW6ljpd5BPjALIYcFmcjHzOW_BcmZLaO4YPQQ,14634
59
59
  angr/analyses/smc.py,sha256=0fvLPUpjlg6GCjYnfSqanXkGYlthmPwqMYR-ZYBHsbo,5075
60
60
  angr/analyses/soot_class_hierarchy.py,sha256=AtvXMAlz6CVvfbtkPY4ghouH_1mNnPg9s9jFhZwWvEw,8741
61
61
  angr/analyses/stack_pointer_tracker.py,sha256=5NZf4muUFIJX-F605n5LMw8ihA648-FA4Bm5mAcsHBE,31379
@@ -71,7 +71,7 @@ angr/analyses/cfg/cfg.py,sha256=ZHZFWtP4uD1YxgKy44O_oD_BiSo871Llcd1zpXmFkBE,3177
71
71
  angr/analyses/cfg/cfg_arch_options.py,sha256=QpC_sonf0eODcIxWtjVrW6E-gFRGvvdataqGEp9DFFI,3142
72
72
  angr/analyses/cfg/cfg_base.py,sha256=CIVnGRf8zDUK-lu4Ovm0joPn9pRNjijilSUX585MteA,122866
73
73
  angr/analyses/cfg/cfg_emulated.py,sha256=BK80J79mEyg2RlDo-ikuQkW2VePuquY3kkSCA2YwDw4,152255
74
- angr/analyses/cfg/cfg_fast.py,sha256=eLStNKXQXT4XWrOZiHcw8lEmIFFh9d-PKUroCNVCB6w,221775
74
+ angr/analyses/cfg/cfg_fast.py,sha256=QE28ijb8Kk5FIRhOocjve0Qw_ouzgDtMgchYzF0cr9A,222452
75
75
  angr/analyses/cfg/cfg_fast_soot.py,sha256=3ImLNg04hssYTQYm2ZcKXoc5E30LxFrPDA0MQblpn6k,25913
76
76
  angr/analyses/cfg/cfg_job_base.py,sha256=Zshze972MakTsd-licQz77lac17igQaaTsAteHeHhYQ,5974
77
77
  angr/analyses/cfg/indirect_jump_resolvers/__init__.py,sha256=EXzMcZH1DBZ-jBLJcYThR0fmWAlJmqhesZNBh_2SlCk,691
@@ -102,11 +102,11 @@ angr/analyses/decompiler/block_io_finder.py,sha256=xMwG8Bi69OGNYVs0U0F4yxM8kEsny
102
102
  angr/analyses/decompiler/block_similarity.py,sha256=ISMoOm-TGJ_1wD2i_4m8IYTletgnP66gReQESJnfvS0,6873
103
103
  angr/analyses/decompiler/block_simplifier.py,sha256=_WYyfFW8bJ_-RkrudJIlDdHh9fc6_aHkuwzW9gylY-k,13922
104
104
  angr/analyses/decompiler/callsite_maker.py,sha256=Gs_FmlmIs5jM-XccL9OMCaj_-L83NlYzkzxsy2HmcfQ,18749
105
- angr/analyses/decompiler/clinic.py,sha256=fl5waZwLlU279EJqoTdK4-9feJwSWGwZOfrB1iUyiO8,105986
106
- angr/analyses/decompiler/condition_processor.py,sha256=yfQZzPr5gYxnxMCWM6uue9DZdHF8rAzRKfIT0yNgSD8,52897
107
- angr/analyses/decompiler/decompilation_cache.py,sha256=dnlY0w4-ViAFz_M1qCjXbGNOLiMlDG8hJW6z2x-VKEs,1230
105
+ angr/analyses/decompiler/clinic.py,sha256=pSM3UVv-HMolsBeNZwLLKxpYof_fVH5m9G95gD4-OfE,106033
106
+ angr/analyses/decompiler/condition_processor.py,sha256=MbpbSk6zXHmMLWjLAHxpYjcLCVL1TuL08KmTBTNpm_4,52839
107
+ angr/analyses/decompiler/decompilation_cache.py,sha256=ELz1DDVYvrs6IeUX4_L0OZDZICUifSBdJkdJXWrFZAY,1375
108
108
  angr/analyses/decompiler/decompilation_options.py,sha256=QWUGnfQ0FUekGs_I6X-ZKvAvL39VX2hFRcZrlXd72fY,7957
109
- angr/analyses/decompiler/decompiler.py,sha256=A3diyVLzYDrB_1WQqplyboTnFBvE8Bvn7RiYNT_ijvk,26868
109
+ angr/analyses/decompiler/decompiler.py,sha256=h6f8fsy3BzFm_-WuGdtXCb_u9xTL494lUEXI5j-PreU,27928
110
110
  angr/analyses/decompiler/empty_node_remover.py,sha256=_RAGjqDyRmannEGPcMmWkL7em990-_sKgl5CYreb-yI,7403
111
111
  angr/analyses/decompiler/expression_narrower.py,sha256=TvkqtgNI9aDsquqyNFH5kXLW04rP_J940GFhrGopxP4,10343
112
112
  angr/analyses/decompiler/goto_manager.py,sha256=GUWt3Y_NCpmreIt4plxX5Y3UO2V8IVGZuRtF2GqI-cw,4006
@@ -132,7 +132,7 @@ angr/analyses/decompiler/dephication/__init__.py,sha256=0Ufg3SSL7VkKBn-sfMZg2XRA
132
132
  angr/analyses/decompiler/dephication/dephication_base.py,sha256=UToP1wF9814qxzJpQcqGljYlOkYA7mwvLveGn41089o,3132
133
133
  angr/analyses/decompiler/dephication/graph_dephication.py,sha256=xjm_OrWgcuDIoDCEAhbW4xGzCHwOPw9ya8IroZH3qf4,2169
134
134
  angr/analyses/decompiler/dephication/graph_rewriting.py,sha256=R0rlwYL0Cnt1UPjdEJZG4kEvruKPr8I1hfhTMTZnBxA,3405
135
- angr/analyses/decompiler/dephication/graph_vvar_mapping.py,sha256=KeZ6VIQAB-Jy4bGUychFCKyinK3rKwy8E9_25ImlKhQ,13724
135
+ angr/analyses/decompiler/dephication/graph_vvar_mapping.py,sha256=nsMwppwMXrGC8_RF-neehpaz-7kmEORVhpAbjOdVFWM,13703
136
136
  angr/analyses/decompiler/dephication/rewriting_engine.py,sha256=3KUIxwUmfTZj2Jm1mB98J5vMkHqy4LLPYTrLzZfLbBA,10442
137
137
  angr/analyses/decompiler/dephication/seqnode_dephication.py,sha256=q29kS8lOs_-mxgJMtQvoZdw6l3q2lUDeXcTcGienIrY,4343
138
138
  angr/analyses/decompiler/optimization_passes/__init__.py,sha256=pCYamez51inHric94E2tD_Hy9gHl8sGHJbfG2dcpGBQ,4833
@@ -240,14 +240,14 @@ angr/analyses/decompiler/ssailification/rewriting.py,sha256=-3jNGbtTH8-Yznoy0Bgu
240
240
  angr/analyses/decompiler/ssailification/rewriting_engine.py,sha256=IUQOrEJDxvCZ0iKpPfj-0lod8ejnTke629JMw1dGG_Q,27204
241
241
  angr/analyses/decompiler/ssailification/rewriting_state.py,sha256=L7apDXQLPiItuLdQFoQdut5RMUE8MRV1zRc3CsnuH6E,1883
242
242
  angr/analyses/decompiler/ssailification/ssailification.py,sha256=bTMTwS4auYQCnY9cNwqbgdYksFym0Iro5e7qRIDmlME,8711
243
- angr/analyses/decompiler/ssailification/traversal.py,sha256=Er6XFmgwmpTf6W8vg9vZupO5MDvsE2y4wONYIYYXzAQ,2949
244
- angr/analyses/decompiler/ssailification/traversal_engine.py,sha256=YBsWyuXyt_3q1yTnxqVaU6vL2nM3okUb9vkSGdHvJj8,5307
243
+ angr/analyses/decompiler/ssailification/traversal.py,sha256=75QzMIAC5RY_RcxMmqUTNeoEgGJwuTnR2KXIc8hnaMI,2981
244
+ angr/analyses/decompiler/ssailification/traversal_engine.py,sha256=qVkx9fevkqxXy6PO1Yu2esPholvoaUOzqB1zmLKW9Os,5877
245
245
  angr/analyses/decompiler/ssailification/traversal_state.py,sha256=_AsCnLiI2HFdM6WrPyAudhc0X4aU_PziznbOgmzpDzQ,1313
246
246
  angr/analyses/decompiler/structured_codegen/__init__.py,sha256=unzkTPhZbpjf5J3GWg1iAFkW17aHFHzuByZCMKE4onQ,633
247
247
  angr/analyses/decompiler/structured_codegen/base.py,sha256=9Zfp2d8Oqp6TAgLJyu7v214YDBtdy3Qx8rs801wIsv0,3796
248
- angr/analyses/decompiler/structured_codegen/c.py,sha256=z3Xejr4nRA-VAfw-T-52Wtr7HP2YxHhpUR7a5M7Azz8,139083
248
+ angr/analyses/decompiler/structured_codegen/c.py,sha256=zkS0NwthFXiILkdlRuniPXRKyeKlI6QMHPjaERG8ysQ,138987
249
249
  angr/analyses/decompiler/structured_codegen/dummy.py,sha256=JZLeovXE-8C-unp2hbejxCG30l-yCx4sWFh7JMF_iRM,570
250
- angr/analyses/decompiler/structured_codegen/dwarf_import.py,sha256=Lf4DKgDs17ohKH8UmCrnJI1BVmPrx2oIb3zXvJ7qc4U,6819
250
+ angr/analyses/decompiler/structured_codegen/dwarf_import.py,sha256=J6V40RuIyKXN7r6ESftIYfoREgmgFavnUL5m3lyTzlM,7072
251
251
  angr/analyses/decompiler/structuring/__init__.py,sha256=u2SGBezMdqQF_2ixo8wr66vCMedAMY-cSjQyq2m-nR8,711
252
252
  angr/analyses/decompiler/structuring/dream.py,sha256=mPNNsNvNb-LoDcoU_HjUejRytIFY_ZyCAbK4tNq_5lM,48254
253
253
  angr/analyses/decompiler/structuring/phoenix.py,sha256=uJ6V7DMoc7DOH2b_NfnuRPvyKvB31eUIUOmuWmC7Sz4,120632
@@ -326,7 +326,7 @@ angr/analyses/reaching_definitions/subject.py,sha256=LxfEi_uko0KJixwFMWMy79l7QW4
326
326
  angr/analyses/reaching_definitions/function_handler_library/__init__.py,sha256=7q_JCZ0RkwaWEhOeaAd2hns9O9afso3r3BHYsdollk0,458
327
327
  angr/analyses/reaching_definitions/function_handler_library/stdio.py,sha256=To3dKtjqRbtqcJhybbhuQF_uxBXg4JX-A0601SsftRQ,11370
328
328
  angr/analyses/reaching_definitions/function_handler_library/stdlib.py,sha256=5PWr7HGaIxcZwkHqZCumXnGPgur5Gf1mE9a1a9izv2U,6426
329
- angr/analyses/reaching_definitions/function_handler_library/string.py,sha256=qUV3JRRkhxxAX92IeQgLkrlotjTy5SHtPXlFj_YHIhs,5047
329
+ angr/analyses/reaching_definitions/function_handler_library/string.py,sha256=14gNFX-oH8zVmfnyILklXbHAkxmsWcNT0YkYDSdHMo8,5047
330
330
  angr/analyses/reaching_definitions/function_handler_library/unistd.py,sha256=J_wALo_qxPk-KjhiWMoWDhH4O36wKmqKkWyf2zlAqug,1238
331
331
  angr/analyses/s_reaching_definitions/__init__.py,sha256=TyfVplxkJj8FAAAw9wegzJlcrbGwlFpIB23PdCcwrLA,254
332
332
  angr/analyses/s_reaching_definitions/s_rda_model.py,sha256=XBrKqy6Ky9aHqTiWiaJPMQTM4aZT9aF9OKOtiylybUM,5009
@@ -355,15 +355,15 @@ angr/analyses/variable_recovery/variable_recovery_base.py,sha256=_WX6Qa6HIFUJkZn
355
355
  angr/analyses/variable_recovery/variable_recovery_fast.py,sha256=7MG8qzgnCJlYyqhZLSQfjpq0022T4825PrWWrCKspnQ,25516
356
356
  angr/angrdb/__init__.py,sha256=Jin6JjtVadtqsgm_a6gQGx3Hn7BblkbJvdcl_GwZshg,307
357
357
  angr/angrdb/db.py,sha256=ecwcJ9b_LcM9a74GXJUm7JVWTghk3JhXScLhaQ4ZP7o,6260
358
- angr/angrdb/models.py,sha256=_DTDAV6S7bEuNER8qiHrlo27fRgBRcv_HCfH7to1ZxE,4747
358
+ angr/angrdb/models.py,sha256=5Akv-fIjk3E2YHymEWu_nrbE8aQ9l75zOAaSIDEzeTQ,4794
359
359
  angr/angrdb/serializers/__init__.py,sha256=Gu2B79cp2wwXx4l_S5ITc4QcqyK5YnoG-zEG253JUZY,184
360
360
  angr/angrdb/serializers/cfg_model.py,sha256=Uxy1VDKAy_50dMXUykpEsl_zp3ko5ETuKNPRAd3Xsek,1314
361
361
  angr/angrdb/serializers/comments.py,sha256=oHlwu9weMpFJrVBo19Ud1OB-XtpUPrdH9MWZy7QnQ40,1578
362
362
  angr/angrdb/serializers/funcs.py,sha256=twDiZ5rx88kat8llBwsukKtg2lgklQpmHJ7X9lLI-DY,1727
363
- angr/angrdb/serializers/kb.py,sha256=4wEiS-q1MES5GuDfnu9iwYDu9tXZrsc6btCiXBiVCio,3876
363
+ angr/angrdb/serializers/kb.py,sha256=vDC9Qh27L4NTRd1nplRwRXDUWXyZT2eOTz-8pEBu2js,3889
364
364
  angr/angrdb/serializers/labels.py,sha256=wShkd0cnxUc5ZfeRAAZYChTUgstQRElhrEI7_T9tPcg,1472
365
365
  angr/angrdb/serializers/loader.py,sha256=xgvlp8t0H4tKgU680SpIW3r5DcrbU-qHtU_L_S_5B7E,5248
366
- angr/angrdb/serializers/structured_code.py,sha256=rnhMYipIzObumQ7N4K5cYGrCwGceP46uip9KrADh7G4,4109
366
+ angr/angrdb/serializers/structured_code.py,sha256=AYaSZneT5py8IxZSoDk-itN-xwjhrH7-M_MhRk5t27A,4309
367
367
  angr/angrdb/serializers/variables.py,sha256=LyrBqhn4B4u6y8_WBiE_JF0vwD2j6sAjIOlWPw8VqxA,2392
368
368
  angr/angrdb/serializers/xrefs.py,sha256=C28PKZVmTJMFjycPttBckvCrrMsRDAzIcU52LCwWjq0,1205
369
369
  angr/concretization_strategies/__init__.py,sha256=g24sC27w9mTCz-gWJOVO_1OPYS7EJgt4AnXh2JsJEuA,4319
@@ -494,19 +494,18 @@ angr/exploration_techniques/unique.py,sha256=uA-BynLkUw9V1QJGdVGHDMmH020I5LWH8xd
494
494
  angr/exploration_techniques/veritesting.py,sha256=XmMuNcvV3lxbAyjtuFdgB8pfGiAtvfGxRPbr1MZrDBc,1388
495
495
  angr/flirt/__init__.py,sha256=O6Qo4OKaEkpq1kxluphTNauGjBH2WS5AuX91xlToyzA,4403
496
496
  angr/flirt/build_sig.py,sha256=3vQl6gZWWcF2HRgTQzFP6G3st8q2vpPHzRa3GfwkBnY,10036
497
- angr/knowledge_plugins/__init__.py,sha256=spYypq3Rzbic2fD5eWF6D1KpSu8W6BwsPtoZPyJ5NAM,1236
497
+ angr/knowledge_plugins/__init__.py,sha256=pnbU_L6GoP1rzX-VIXh-RArNV94nVCD_ubHxIcWu7Ho,1160
498
498
  angr/knowledge_plugins/callsite_prototypes.py,sha256=ZVqTebckIj2VonQSGLFYW6TUgft1J5sOpSwE0K1Nyuk,1587
499
499
  angr/knowledge_plugins/comments.py,sha256=s4wUAtbUa75MC0Dc5h44V08kyVtO8VO39zcy_qkU6cg,339
500
500
  angr/knowledge_plugins/custom_strings.py,sha256=5qYAvmcm9BkTA247hZngDaHHrO9iIipYKJgGH9vxLLA,1037
501
501
  angr/knowledge_plugins/data.py,sha256=u2Is51L6Opp4eeWkpO_ss8WfXgceK5AUa_BlnPcZXmk,874
502
502
  angr/knowledge_plugins/debug_variables.py,sha256=pxiY6l0OPX3y2ZEcCGu-vJCGfw60tiPvkjdDFE9Z4uM,8075
503
- angr/knowledge_plugins/decompilation.py,sha256=izceZ5UEhnF7q5EO0D1Hd7_LLKk1QHXfdv4g4kIbFS4,1346
504
503
  angr/knowledge_plugins/indirect_jumps.py,sha256=VlIDWeU3xZyTAp1qSYyZxtusz2idxa1vrlLQmGWlkHA,1034
505
504
  angr/knowledge_plugins/labels.py,sha256=H9_as9RFSKmth-Dxwq-iibXo007ayvS7nFGnYtnN8jE,3146
506
505
  angr/knowledge_plugins/obfuscations.py,sha256=CM7wGiSdZamD3t9v9kdymDWkSMtcFYsKupL7jVs-jjo,1407
507
506
  angr/knowledge_plugins/patches.py,sha256=tPjKI2GloTaWcA96u0yp75956HUkqOfsvusitEeWmGE,4335
508
507
  angr/knowledge_plugins/plugin.py,sha256=8tPrsgo1hsZG3ifXs4mWsKkeyB03ubfZdY5YArWw9-Q,766
509
- angr/knowledge_plugins/structured_code.py,sha256=Ri7e9ccjZw1v8I5WTXQ6ccj2NHPuqAkTS3BTEFxb3Rg,2168
508
+ angr/knowledge_plugins/structured_code.py,sha256=9IKRF1Pb7E0eBz0uMK36Pk8HL0fmI7JqVaeihu7uiRQ,2167
510
509
  angr/knowledge_plugins/types.py,sha256=EjskCalakpsUi4CKvjrP530VsWFBGkM4xmPbGN2ymRQ,2076
511
510
  angr/knowledge_plugins/cfg/__init__.py,sha256=Y6sJ3L81gG8oDqewYYuIY27-cxXN3nvcgUg4FRdXqCY,418
512
511
  angr/knowledge_plugins/cfg/cfg_manager.py,sha256=FteAHC7Kk3t46xzabJOn_mu6XoIuj6V6hK2IxhLmV64,2656
@@ -545,7 +544,7 @@ angr/knowledge_plugins/xrefs/__init__.py,sha256=5PhqVOtTZ27lCjJ9wp7akUeJydqILbyC
545
544
  angr/knowledge_plugins/xrefs/xref.py,sha256=ROo_kAEKwB51whVYcGtTV0QRtYmQZV8nEoEtbQWyC9U,4883
546
545
  angr/knowledge_plugins/xrefs/xref_manager.py,sha256=Yb88z3L8Y26TfGeRHdsGWQlT9f6oWntjEg6s-kcVtUQ,4040
547
546
  angr/knowledge_plugins/xrefs/xref_types.py,sha256=LcQ9pD4E4XlC51Us49xiqAoGAFGpnCrpYO4mOzILiKI,308
548
- angr/lib/angr_native.dylib,sha256=OqqAFHyR48W11hRqUWl21v9Wk84Ol_Ldzdv8KE0h_VM,16187984
547
+ angr/lib/angr_native.dylib,sha256=OdJVVXraXbWldaBhIh1eXkak4aIuD5ExVasukiW-KfI,16187984
549
548
  angr/misc/__init__.py,sha256=ZPHXbrIdsfe_qdmq8CnXuS_bBWOy4MDT2NjwUnPgHZc,355
550
549
  angr/misc/ansi.py,sha256=nPJHC0SKfqasMQZ0LxdmmIYojjmk4nr5jI6FrzoTwS0,811
551
550
  angr/misc/autoimport.py,sha256=iZagpuPwZWczUTYIqs-JkDMQjftMqc_cchcm7OBFiEg,3450
@@ -1349,12 +1348,12 @@ angr/utils/orderedset.py,sha256=K5PKeDqy4xUeq47k7SdZ7E3K9M1AMXJ9-veTOo5DQIE,1978
1349
1348
  angr/utils/segment_list.py,sha256=ayUMIeaFp61AhTuxsf_go4XoXRqGi8cxTeP0OyuhEk4,20369
1350
1349
  angr/utils/tagged_interval_map.py,sha256=rXKBuT14N23AAntpOKhZhmA-qqymnsvjpheFXoTRVRA,4417
1351
1350
  angr/utils/timing.py,sha256=ELuRPzdRSHzOATgtAzTFByMlVr021ypMrsvtpopreLg,1481
1352
- angr/utils/ssa/__init__.py,sha256=Z7yXY0xe4X-T4bfdK0YtL9ZFnYF-JhQuJ16ZW-wpSZI,7886
1351
+ angr/utils/ssa/__init__.py,sha256=Sz9zQVnvtmCbJJYeTG_k2JxcZtgxvIxap-KqzvRnIFQ,8015
1353
1352
  angr/utils/ssa/tmp_uses_collector.py,sha256=rSpvMxBHzg-tmvhsfjn3iLyPEKzaZN-xpQrdslMq3J4,793
1354
1353
  angr/utils/ssa/vvar_uses_collector.py,sha256=8gfAWdRMz73Deh-ZshDM3GPAot9Lf-rHzCiaCil0hlE,1342
1355
- angr-9.2.126.dist-info/LICENSE,sha256=cgL_ho5B1NH8UxwtBuqThRWdjear8b7hktycaS1sz6g,1327
1356
- angr-9.2.126.dist-info/METADATA,sha256=19rrTfgPBg4OHgBK6THWNcmcfQICUl2FPLVMhwngrpc,4762
1357
- angr-9.2.126.dist-info/WHEEL,sha256=obDBrsNvkbO7xvVLrBUaB5Z67T0LixWUZ_N8DpT93rI,105
1358
- angr-9.2.126.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
1359
- angr-9.2.126.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
1360
- angr-9.2.126.dist-info/RECORD,,
1354
+ angr-9.2.127.dist-info/LICENSE,sha256=cgL_ho5B1NH8UxwtBuqThRWdjear8b7hktycaS1sz6g,1327
1355
+ angr-9.2.127.dist-info/METADATA,sha256=ShqPxcNeKaZBhxu__-FOBkH4XxlaufXprp4jtO5F_yg,4762
1356
+ angr-9.2.127.dist-info/WHEEL,sha256=obDBrsNvkbO7xvVLrBUaB5Z67T0LixWUZ_N8DpT93rI,105
1357
+ angr-9.2.127.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
1358
+ angr-9.2.127.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
1359
+ angr-9.2.127.dist-info/RECORD,,
@@ -1,45 +0,0 @@
1
- # pylint:disable=import-outside-toplevel
2
- from __future__ import annotations
3
-
4
- from typing import Any, TYPE_CHECKING
5
-
6
- from .plugin import KnowledgeBasePlugin
7
-
8
- if TYPE_CHECKING:
9
- from angr.analyses.decompiler.decompilation_cache import DecompilationCache
10
-
11
-
12
- class DecompilationManager(KnowledgeBasePlugin):
13
- """A knowledge base plugin to store decompilation results."""
14
-
15
- def __init__(self, kb):
16
- super().__init__(kb=kb)
17
- self.cached: dict[Any, DecompilationCache] = {}
18
-
19
- def _normalize_key(self, item: int | str):
20
- if type(item) is str:
21
- item = (self._kb.labels.lookup(item[0]), *item[1:])
22
- return item
23
-
24
- def __getitem__(self, item) -> DecompilationCache:
25
- return self.cached[self._normalize_key(item)]
26
-
27
- def __setitem__(self, key, value: DecompilationCache):
28
- self.cached[self._normalize_key(key)] = value
29
-
30
- def __contains__(self, key):
31
- return self._normalize_key(key) in self.cached
32
-
33
- def __delitem__(self, key):
34
- del self.cached[self._normalize_key(key)]
35
-
36
- def discard(self, key):
37
- normalized_key = self._normalize_key(key)
38
- if normalized_key in self.cached:
39
- del self.cached[normalized_key]
40
-
41
- def copy(self):
42
- raise NotImplementedError
43
-
44
-
45
- KnowledgeBasePlugin.register_default("decompilations", DecompilationManager)
File without changes