angr 9.2.159__cp310-abi3-macosx_11_0_arm64.whl → 9.2.160__cp310-abi3-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.

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.159"
5
+ __version__ = "9.2.160"
6
6
 
7
7
  if bytes is str:
8
8
  raise Exception(
@@ -143,7 +143,8 @@ class Clinic(Analysis):
143
143
  desired_variables: set[str] | None = None,
144
144
  force_loop_single_exit: bool = True,
145
145
  complete_successors: bool = False,
146
- max_type_constraints: int = 4000,
146
+ max_type_constraints: int = 100_000,
147
+ type_constraint_set_degradation_threshold: int = 150,
147
148
  ail_graph: networkx.DiGraph | None = None,
148
149
  arg_vvars: dict[int, tuple[ailment.Expr.VirtualVariable, SimVariable]] | None = None,
149
150
  start_stage: ClinicStage | None = ClinicStage.INITIALIZATION,
@@ -185,6 +186,7 @@ class Clinic(Analysis):
185
186
  self._cache = cache
186
187
  self._mode = mode
187
188
  self._max_type_constraints = max_type_constraints
189
+ self._type_constraint_set_degradation_threshold = type_constraint_set_degradation_threshold
188
190
  self.vvar_id_start = vvar_id_start
189
191
  self.vvar_to_vvar: dict[int, int] | None = None
190
192
  # during SSA conversion, we create secondary stack variables because they overlap and are larger than the
@@ -1871,6 +1873,7 @@ class Clinic(Analysis):
1871
1873
  must_struct=must_struct,
1872
1874
  ground_truth=groundtruth,
1873
1875
  stackvar_max_sizes=tv_max_sizes,
1876
+ constraint_set_degradation_threshold=self._type_constraint_set_degradation_threshold,
1874
1877
  )
1875
1878
  # tp.pp_constraints()
1876
1879
  # tp.pp_solution()
@@ -23,7 +23,7 @@ from .ailgraph_walker import AILGraphWalker
23
23
  from .condition_processor import ConditionProcessor
24
24
  from .decompilation_options import DecompilationOption
25
25
  from .decompilation_cache import DecompilationCache
26
- from .utils import remove_labels, remove_edges_in_ailgraph
26
+ from .utils import remove_edges_in_ailgraph
27
27
  from .sequence_walker import SequenceWalker
28
28
  from .structuring.structurer_nodes import SequenceNode
29
29
  from .presets import DECOMPILATION_PRESETS, DecompilationPreset
@@ -319,12 +319,8 @@ class Decompiler(Analysis):
319
319
  # removed!
320
320
  remove_edges_in_ailgraph(clinic.graph, clinic.edges_to_remove)
321
321
 
322
- # Rewrite the graph to remove phi expressions
323
- # this is probably optional if we do not pretty-print clinic.graph
324
- clinic.graph = self._transform_graph_from_ssa(clinic.graph)
325
-
326
322
  # save the graph before structuring happens (for AIL view)
327
- clinic.cc_graph = remove_labels(clinic.copy_graph())
323
+ clinic.cc_graph = clinic.copy_graph()
328
324
 
329
325
  codegen = None
330
326
  seq_node = None
@@ -357,7 +353,7 @@ class Decompiler(Analysis):
357
353
  )
358
354
 
359
355
  # rewrite the sequence node to remove phi expressions
360
- seq_node = self._transform_seqnode_from_ssa(seq_node)
356
+ seq_node = self.transform_seqnode_from_ssa(seq_node)
361
357
 
362
358
  # update memory data
363
359
  if self._cfg is not None and self._update_memory_data:
@@ -670,14 +666,21 @@ class Decompiler(Analysis):
670
666
  memory_data_addrs=added_memory_data_addrs,
671
667
  )
672
668
 
673
- def _transform_graph_from_ssa(self, ail_graph: networkx.DiGraph) -> networkx.DiGraph:
669
+ def transform_graph_from_ssa(self, ail_graph: networkx.DiGraph) -> networkx.DiGraph:
670
+ """
671
+ Translate an SSA AIL graph out of SSA form. This is useful for producing a non-SSA AIL graph for displaying in
672
+ angr management.
673
+
674
+ :param ail_graph: The AIL graph to transform out of SSA form.
675
+ :return: The translated AIL graph.
676
+ """
674
677
  variable_kb = self._variable_kb
675
678
  dephication = self.project.analyses.GraphDephication(
676
679
  self.func, ail_graph, rewrite=True, variable_kb=variable_kb, kb=self.kb, fail_fast=self._fail_fast
677
680
  )
678
681
  return dephication.output
679
682
 
680
- def _transform_seqnode_from_ssa(self, seq_node: SequenceNode) -> SequenceNode:
683
+ def transform_seqnode_from_ssa(self, seq_node: SequenceNode) -> SequenceNode:
681
684
  variable_kb = self._variable_kb
682
685
  dephication = self.project.analyses.SeqNodeDephication(
683
686
  self.func, seq_node, rewrite=True, variable_kb=variable_kb, kb=self.kb, fail_fast=self._fail_fast
@@ -1,4 +1,4 @@
1
- # pylint:disable=missing-class-docstring
1
+ # pylint:disable=missing-class-docstring,too-many-boolean-expressions
2
2
  from __future__ import annotations
3
3
  import enum
4
4
  from collections import defaultdict
@@ -432,7 +432,14 @@ class SimpleSolver:
432
432
  improvements.
433
433
  """
434
434
 
435
- def __init__(self, bits: int, constraints, typevars, stackvar_max_sizes: dict[TypeVariable, int] | None = None):
435
+ def __init__(
436
+ self,
437
+ bits: int,
438
+ constraints,
439
+ typevars,
440
+ constraint_set_degradation_threshold: int = 150,
441
+ stackvar_max_sizes: dict[TypeVariable, int] | None = None,
442
+ ):
436
443
  if bits not in (32, 64):
437
444
  raise ValueError(f"Pointer size {bits} is not supported. Expect 32 or 64.")
438
445
 
@@ -440,6 +447,7 @@ class SimpleSolver:
440
447
  self._constraints: dict[TypeVariable, set[TypeConstraint]] = constraints
441
448
  self._typevars: set[TypeVariable] = typevars
442
449
  self.stackvar_max_sizes = stackvar_max_sizes if stackvar_max_sizes is not None else {}
450
+ self._constraint_set_degradation_threshold = constraint_set_degradation_threshold
443
451
  self._base_lattice = BASE_LATTICES[bits]
444
452
  self._base_lattice_inverted = networkx.DiGraph()
445
453
  for src, dst in self._base_lattice.edges:
@@ -459,7 +467,11 @@ class SimpleSolver:
459
467
  self.processed_constraints_count += len(self._constraints[typevar])
460
468
 
461
469
  self._constraints[typevar] |= self._eq_constraints_from_add(typevar)
462
- self._constraints[typevar] = self._handle_equivalence(typevar)
470
+ self._constraints[typevar] |= self._discover_equivalence(self._constraints[typevar])
471
+ new_constraints, replacements = self._handle_equivalence(self._constraints[typevar])
472
+ self._equivalence |= replacements
473
+ self._constraints[typevar] = new_constraints
474
+ self._constraints[typevar] = self._filter_constraints(self._constraints[typevar])
463
475
 
464
476
  self.simplified_constraints_count += len(self._constraints[typevar])
465
477
 
@@ -517,11 +529,18 @@ class SimpleSolver:
517
529
 
518
530
  _, sketches = self.infer_shapes(typevars, constraints)
519
531
  constraintset2tvs = defaultdict(set)
532
+ tvs_seen = set()
520
533
  for idx, tv in enumerate(constrained_typevars):
521
534
  _l.debug("Collecting constraints for type variable %r (%d/%d)", tv, idx + 1, len(constrained_typevars))
535
+ if tv in tvs_seen:
536
+ continue
522
537
  # build a sub constraint set for the type variable
523
- constraint_subset = frozenset(self._generate_constraint_subset(constraints, {tv}))
524
- constraintset2tvs[constraint_subset].add(tv)
538
+ constraint_subset, related_tvs = self._generate_constraint_subset(constraints, {tv})
539
+ # drop all type vars outside constrained_typevars
540
+ related_tvs = related_tvs.intersection(constrained_typevars)
541
+ tvs_seen |= related_tvs
542
+ frozen_constraint_subset = frozenset(constraint_subset)
543
+ constraintset2tvs[frozen_constraint_subset] = related_tvs
525
544
 
526
545
  for idx, (constraint_subset, tvs) in enumerate(constraintset2tvs.items()):
527
546
  _l.debug(
@@ -534,8 +553,31 @@ class SimpleSolver:
534
553
  )
535
554
  self.eqclass_constraints_count.append(len(constraint_subset))
536
555
 
537
- while True:
538
- base_constraint_graph = self._generate_constraint_graph(constraint_subset, tvs | PRIMITIVE_TYPES)
556
+ if len(constraint_subset) > self._constraint_set_degradation_threshold:
557
+ _l.debug(
558
+ "Constraint subset contains %d constraints, which is over the limit of %d. Enter degradation.",
559
+ len(constraint_subset),
560
+ self._constraint_set_degradation_threshold,
561
+ )
562
+ constraint_subset = self._degrade_constraint_set(constraint_subset)
563
+ _l.debug("Degraded constraint subset to %d constraints.", len(constraint_subset))
564
+
565
+ while constraint_subset:
566
+
567
+ _l.debug("Working with %d constraints.", len(constraint_subset))
568
+
569
+ # remove constraints that are a <: b where a only appears once; in this case, the solution fo a is
570
+ # entirely determined by the solution of b (which is the upper bound of a)
571
+ filtered_constraint_subset, ub_subtypes = self._filter_leaf_typevars(constraint_subset, tvs)
572
+ _l.debug(
573
+ "Filtered %d leaf typevars; %d constraints remain.",
574
+ len(ub_subtypes),
575
+ len(filtered_constraint_subset),
576
+ )
577
+
578
+ base_constraint_graph = self._generate_constraint_graph(
579
+ filtered_constraint_subset, tvs | PRIMITIVE_TYPES
580
+ )
539
581
  primitive_constraints = self._generate_primitive_constraints(tvs, base_constraint_graph)
540
582
  tvs_with_primitive_constraints = set()
541
583
  for primitive_constraint in primitive_constraints:
@@ -546,12 +588,22 @@ class SimpleSolver:
546
588
  solutions = {}
547
589
  self.determine(sketches, tvs_with_primitive_constraints, solutions)
548
590
  _l.debug("Determined solutions for %d type variable(s).", len(tvs_with_primitive_constraints))
591
+
592
+ leaf_solutions = 0
593
+ for tv_, ub_tv in ub_subtypes.items():
594
+ if ub_tv in solutions:
595
+ solutions[tv_] = solutions[ub_tv]
596
+ leaf_solutions += 1
597
+ elif isinstance(ub_tv, TypeConstant):
598
+ solutions[tv_] = ub_tv
599
+ leaf_solutions += 1
600
+ _l.debug("Determined solutions for %d leaf type variable(s).", leaf_solutions)
601
+
549
602
  if not solutions:
550
603
  break
551
-
552
604
  self.solution |= solutions
553
605
 
554
- tvs = {tv for tv in tvs if tv not in tvs_with_primitive_constraints}
606
+ tvs = {tv for tv in tvs if tv not in solutions}
555
607
  if not tvs:
556
608
  break
557
609
  # rewrite existing constraints
@@ -559,7 +611,7 @@ class SimpleSolver:
559
611
  for constraint in constraint_subset:
560
612
  rewritten = self._rewrite_constraint(constraint, solutions)
561
613
  new_constraint_subset.add(rewritten)
562
- constraint_subset = new_constraint_subset
614
+ constraint_subset = self._filter_constraints(new_constraint_subset)
563
615
 
564
616
  # set the solution for missing type vars to TOP
565
617
  self.determine(sketches, set(sketches).difference(set(self.solution)), self.solution)
@@ -775,14 +827,45 @@ class SimpleSolver:
775
827
  new_constraints.add(Equivalence(constraint.type_1, constraint.type_r))
776
828
  return new_constraints
777
829
 
778
- def _handle_equivalence(self, typevar: TypeVariable):
830
+ @staticmethod
831
+ def _discover_equivalence(constraints: set[TypeConstraint]) -> set[Equivalence]:
832
+ """
833
+ a <:b && b <: a ==> a == b
834
+ """
835
+
836
+ new_eq_constraints: set[Equivalence] = set()
837
+ subtypes = defaultdict(set)
838
+ for constraint in constraints:
839
+ if isinstance(constraint, Subtype):
840
+ sub_type = constraint.sub_type
841
+ super_type = constraint.super_type
842
+ subtypes[sub_type].add(super_type)
843
+
844
+ # check everything
845
+ seen = set()
846
+ for tv, tv_supers in subtypes.items():
847
+ for tv_super in tv_supers:
848
+ if tv_super in subtypes and tv in subtypes[tv_super]: # noqa: SIM102
849
+ # we have a pair of subtypes that are equivalent
850
+ if (tv, tv_super) not in seen and (tv_super, tv) not in seen:
851
+ new_eq_constraints.add(Equivalence(tv, tv_super))
852
+ seen.add((tv, tv_super))
853
+
854
+ _l.debug(
855
+ "Discovered %d equivalence constraints from %d constraints.", len(new_eq_constraints), len(constraints)
856
+ )
857
+ return new_eq_constraints
858
+
859
+ @staticmethod
860
+ def _handle_equivalence(
861
+ constraint_set: set[TypeConstraint],
862
+ ) -> tuple[set[TypeConstraint], dict[TypeVariable, TypeVariable | TypeConstant]]:
779
863
  graph = networkx.Graph()
780
864
 
781
- replacements = {}
782
- constraints = set()
865
+ replacements: dict[TypeVariable, TypeVariable | TypeConstant] = {}
783
866
 
784
867
  # collect equivalence relations
785
- for constraint in self._constraints[typevar]:
868
+ for constraint in constraint_set:
786
869
  if isinstance(constraint, Equivalence):
787
870
  # | type_a == type_b
788
871
  # we apply unification and removes one of them
@@ -803,15 +886,30 @@ class SimpleSolver:
803
886
  for tv in components_lst[1:]:
804
887
  replacements[tv] = representative
805
888
 
806
- # replace
807
- for constraint in self._constraints[typevar]:
889
+ constraints = SimpleSolver._rewrite_constraints_with_replacements(constraint_set, replacements)
890
+
891
+ # import pprint
892
+ # print("Replacements")
893
+ # pprint.pprint(replacements)
894
+ # print("Constraints (after replacement)")
895
+ # pprint.pprint(constraints)
896
+
897
+ return constraints, replacements
898
+
899
+ @staticmethod
900
+ def _rewrite_constraints_with_replacements(
901
+ constraints: set[TypeConstraint], replacements: dict[TypeVariable, TypeVariable]
902
+ ) -> set[TypeConstraint]:
903
+ # replace constraints according to a dictionary of type variable replacements
904
+ replaced_constraints = set()
905
+ for constraint in constraints:
808
906
  if isinstance(constraint, Existence):
809
907
  replaced, new_constraint = constraint.replace(replacements)
810
908
 
811
909
  if replaced:
812
- constraints.add(new_constraint)
910
+ replaced_constraints.add(new_constraint)
813
911
  else:
814
- constraints.add(constraint)
912
+ replaced_constraints.add(constraint)
815
913
 
816
914
  elif isinstance(constraint, Subtype):
817
915
  # subtype <: supertype
@@ -819,18 +917,122 @@ class SimpleSolver:
819
917
  replaced, new_constraint = constraint.replace(replacements)
820
918
 
821
919
  if replaced:
822
- constraints.add(new_constraint)
920
+ replaced_constraints.add(new_constraint)
823
921
  else:
824
- constraints.add(constraint)
922
+ replaced_constraints.add(constraint)
923
+ return replaced_constraints
825
924
 
826
- # import pprint
827
- # print("Replacements")
828
- # pprint.pprint(replacements)
829
- # print("Constraints (after replacement)")
830
- # pprint.pprint(constraints)
925
+ @staticmethod
926
+ def _filter_constraints(constraints: set[TypeConstraint]) -> set[TypeConstraint]:
927
+ """
928
+ Filter out constraints that we don't yet support.
929
+ """
930
+
931
+ filtered_constraints = set()
932
+ for constraint in constraints:
933
+ dropped = False
934
+ if isinstance(constraint, Subtype) and (
935
+ (isinstance(constraint.sub_type, TypeConstant) and isinstance(constraint.super_type, TypeConstant))
936
+ or (
937
+ isinstance(constraint.sub_type, DerivedTypeVariable)
938
+ and isinstance(constraint.sub_type.labels[-1], ConvertTo)
939
+ )
940
+ or (
941
+ isinstance(constraint.sub_type, TypeVariable)
942
+ and isinstance(constraint.super_type, TypeVariable)
943
+ and constraint.sub_type == constraint.super_type
944
+ )
945
+ ):
946
+ dropped = True
831
947
 
832
- self._equivalence = replacements
833
- return constraints
948
+ if not dropped:
949
+ filtered_constraints.add(constraint)
950
+
951
+ return filtered_constraints
952
+
953
+ @staticmethod
954
+ def _filter_leaf_typevars(
955
+ constraints: set[TypeConstraint], tvs_to_solve: set[TypeVariable]
956
+ ) -> tuple[set[TypeConstraint], dict[TypeVariable, TypeVariable]]:
957
+ """
958
+ Filter out leaf type variables that only appear once in the constraints. These type variables are not
959
+ interesting and can be removed from the constraints.
960
+ """
961
+
962
+ sub_typevars = defaultdict(set)
963
+ tv_to_dtvs: dict[TypeVariable, set[TypeVariable | DerivedTypeVariable]] = defaultdict(set)
964
+ for constraint in constraints:
965
+ if isinstance(constraint, Subtype):
966
+ if isinstance(constraint.sub_type, TypeVariable):
967
+ sub_typevars[constraint.sub_type].add(constraint.super_type)
968
+ for tv in [constraint.sub_type, constraint.super_type]:
969
+ if isinstance(tv, DerivedTypeVariable):
970
+ tv_to_dtvs[tv.type_var].add(constraint.sub_type)
971
+ elif isinstance(tv, TypeVariable):
972
+ tv_to_dtvs[tv].add(constraint.sub_type)
973
+
974
+ ub_subtypes: dict[TypeVariable, TypeVariable] = {}
975
+ for tv, dtvs in tv_to_dtvs.items():
976
+ if len(dtvs) == 1 and tv in sub_typevars and len(sub_typevars[tv]) == 1:
977
+ ub = next(iter(sub_typevars[tv]))
978
+ if ub in tvs_to_solve:
979
+ ub_subtypes[tv] = ub
980
+
981
+ filtered_constraints = set()
982
+ for constraint in constraints:
983
+ if isinstance(constraint, Subtype) and constraint.sub_type in ub_subtypes:
984
+ continue
985
+ filtered_constraints.add(constraint)
986
+
987
+ return filtered_constraints, ub_subtypes
988
+
989
+ def _degrade_constraint_set(self, constraints: set[TypeConstraint]) -> set[TypeConstraint]:
990
+ """
991
+ Degrade the constraint set to a smaller set of constraints to speed up the DFA generation process.
992
+ """
993
+
994
+ tv_with_ls = defaultdict(set) # tv_with_ls are type variables with Loads or Stores
995
+ graph = networkx.Graph()
996
+
997
+ for constraint in constraints:
998
+ if isinstance(constraint, Subtype):
999
+ if isinstance(constraint.sub_type, DerivedTypeVariable) and isinstance(
1000
+ constraint.sub_type.labels[0], (Load, Store)
1001
+ ):
1002
+ tv_with_ls[constraint.sub_type.type_var].add(constraint.sub_type)
1003
+ if type(constraint.sub_type) is TypeVariable and type(constraint.super_type) is TypeVariable:
1004
+ graph.add_edge(constraint.sub_type, constraint.super_type)
1005
+
1006
+ tv_to_degrade = set()
1007
+ for tv, dtvs in tv_with_ls.items():
1008
+ if len(dtvs) > 5:
1009
+ # degrade all subtype relationships involving this type variable to equivalence
1010
+ tv_to_degrade.add(tv)
1011
+
1012
+ replacements = {}
1013
+ for components in networkx.connected_components(graph):
1014
+ if len(components) == 1:
1015
+ continue
1016
+ if any(tv in tv_to_degrade for tv in components):
1017
+ components_lst = sorted(components, key=str)
1018
+ representative = components_lst[0]
1019
+ for tv in components_lst[1:]:
1020
+ replacements[tv] = representative
1021
+
1022
+ degraded_constraints = self._rewrite_constraints_with_replacements(constraints, replacements)
1023
+
1024
+ # discover more equivalence relations
1025
+ eq_constraints = self._discover_equivalence(degraded_constraints)
1026
+ _l.debug("Discovered %d equivalence constraints from degraded constraints.", len(eq_constraints))
1027
+ if eq_constraints:
1028
+ degraded_constraints, eq_replacements = self._handle_equivalence(degraded_constraints | eq_constraints)
1029
+ self._equivalence |= eq_replacements
1030
+
1031
+ # filter them
1032
+ degraded_constraints = self._filter_constraints(degraded_constraints)
1033
+
1034
+ self._equivalence |= replacements
1035
+ return degraded_constraints
834
1036
 
835
1037
  def _convert_arrays(self, constraints):
836
1038
  for constraint in constraints:
@@ -860,7 +1062,7 @@ class SimpleSolver:
860
1062
  @staticmethod
861
1063
  def _generate_constraint_subset(
862
1064
  constraints: set[TypeConstraint], typevars: set[TypeVariable]
863
- ) -> set[TypeConstraint]:
1065
+ ) -> tuple[set[TypeConstraint], set[TypeVariable]]:
864
1066
  subset = set()
865
1067
  related_typevars = set(typevars)
866
1068
  while True:
@@ -890,7 +1092,7 @@ class SimpleSolver:
890
1092
  if not new:
891
1093
  break
892
1094
  subset |= new
893
- return subset
1095
+ return subset, related_typevars
894
1096
 
895
1097
  def _generate_constraint_graph(
896
1098
  self, constraints: set[TypeConstraint], interesting_variables: set[DerivedTypeVariable]
@@ -40,6 +40,7 @@ class Typehoon(Analysis):
40
40
  must_struct: set[TypeVariable] | None = None,
41
41
  stackvar_max_sizes: dict[TypeVariable, int] | None = None,
42
42
  stack_offset_tvs: dict[int, TypeVariable] | None = None,
43
+ constraint_set_degradation_threshold: int = 150,
43
44
  ):
44
45
  """
45
46
 
@@ -57,6 +58,7 @@ class Typehoon(Analysis):
57
58
  self._must_struct = must_struct
58
59
  self._stackvar_max_sizes = stackvar_max_sizes if stackvar_max_sizes is not None else {}
59
60
  self._stack_offset_tvs = stack_offset_tvs if stack_offset_tvs is not None else {}
61
+ self._constraint_set_degradation_threshold = constraint_set_degradation_threshold
60
62
 
61
63
  self.bits = self.project.arch.bits
62
64
  self.solution = None
@@ -193,7 +195,7 @@ class Typehoon(Analysis):
193
195
  self.simtypes_solution.update(self._ground_truth)
194
196
 
195
197
  @staticmethod
196
- def _resolve_derived(tv):
198
+ def _resolve_derived(tv: TypeVariable | DerivedTypeVariable) -> TypeVariable:
197
199
  return tv.type_var if isinstance(tv, DerivedTypeVariable) else tv
198
200
 
199
201
  def _solve(self):
@@ -211,7 +213,13 @@ class Typehoon(Analysis):
211
213
  if isinstance(constraint.super_type, TypeVariable):
212
214
  typevars.add(self._resolve_derived(constraint.super_type))
213
215
 
214
- solver = SimpleSolver(self.bits, self._constraints, typevars, stackvar_max_sizes=self._stackvar_max_sizes)
216
+ solver = SimpleSolver(
217
+ self.bits,
218
+ self._constraints,
219
+ typevars,
220
+ stackvar_max_sizes=self._stackvar_max_sizes,
221
+ constraint_set_degradation_threshold=self._constraint_set_degradation_threshold,
222
+ )
215
223
  self.solution = solver.solution
216
224
  self.processed_constraints_count = solver.processed_constraints_count
217
225
  self.eqclass_constraints_count = solver.eqclass_constraints_count
@@ -633,10 +633,7 @@ class SimEngineVRAIL(
633
633
  if not r1.data.concrete:
634
634
  # we don't support symbolic shiftamount
635
635
  r = self.state.top(result_size)
636
- return RichR(
637
- r,
638
- typevar=r0.typevar,
639
- )
636
+ return RichR(r)
640
637
 
641
638
  shiftamount = r1.data.concrete_value
642
639
  return RichR(r0.data << shiftamount, typevar=typeconsts.int_type(result_size), type_constraints=None)
@@ -651,10 +648,7 @@ class SimEngineVRAIL(
651
648
  if not r1.data.concrete:
652
649
  # we don't support symbolic shiftamount
653
650
  r = self.state.top(result_size)
654
- return RichR(
655
- r,
656
- typevar=r0.typevar,
657
- )
651
+ return RichR(r)
658
652
 
659
653
  shiftamount = r1.data.concrete_value
660
654
 
@@ -672,10 +666,7 @@ class SimEngineVRAIL(
672
666
  if not r1.data.concrete:
673
667
  # we don't support symbolic shiftamount
674
668
  r = self.state.top(result_size)
675
- return RichR(
676
- r,
677
- typevar=r0.typevar,
678
- )
669
+ return RichR(r)
679
670
 
680
671
  shiftamount = r1.data.concrete_value
681
672
 
@@ -691,10 +682,7 @@ class SimEngineVRAIL(
691
682
  if not r1.data.concrete:
692
683
  # we don't support symbolic shiftamount
693
684
  r = self.state.top(result_size)
694
- return RichR(
695
- r,
696
- typevar=r0.typevar,
697
- )
685
+ return RichR(r)
698
686
 
699
687
  shiftamount = r1.data.concrete_value
700
688
 
@@ -761,22 +749,22 @@ class SimEngineVRAIL(
761
749
  def _handle_binop_Rol(self, expr):
762
750
  arg0, arg1 = expr.operands
763
751
 
764
- r0 = self._expr_bv(arg0)
752
+ _ = self._expr_bv(arg0)
765
753
  _ = self._expr_bv(arg1)
766
754
  result_size = arg0.bits
767
755
 
768
756
  r = self.state.top(result_size)
769
- return RichR(r, typevar=r0.typevar)
757
+ return RichR(r)
770
758
 
771
759
  def _handle_binop_Ror(self, expr):
772
760
  arg0, arg1 = expr.operands
773
761
 
774
- r0 = self._expr_bv(arg0)
762
+ _ = self._expr_bv(arg0)
775
763
  _ = self._expr_bv(arg1)
776
764
  result_size = arg0.bits
777
765
 
778
766
  r = self.state.top(result_size)
779
- return RichR(r, typevar=r0.typevar)
767
+ return RichR(r)
780
768
 
781
769
  def _handle_binop_Concat(self, expr):
782
770
  arg0, arg1 = expr.operands
angr/rustylib.abi3.so CHANGED
Binary file
@@ -394,14 +394,14 @@ class _VexArchInfo(ctypes.Structure):
394
394
 
395
395
  def _load_native():
396
396
  if sys.platform == "darwin":
397
- libfile = "angr_native.dylib"
397
+ libfile = "unicornlib.dylib"
398
398
  elif sys.platform in {"win32", "cygwin"}:
399
- libfile = "angr_native.dll"
399
+ libfile = "unicornlib.dll"
400
400
  else:
401
- libfile = "angr_native.so"
401
+ libfile = "unicornlib.so"
402
402
 
403
403
  try:
404
- angr_path = str(importlib.resources.files("angr") / "lib" / libfile)
404
+ angr_path = str(importlib.resources.files("angr") / libfile)
405
405
  h = ctypes.CDLL(angr_path)
406
406
 
407
407
  VexArch = ctypes.c_int
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: angr
3
- Version: 9.2.159
3
+ Version: 9.2.160
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/
7
7
  Project-URL: Repository, https://github.com/angr/angr
8
- Classifier: License :: OSI Approved :: BSD License
9
8
  Classifier: Programming Language :: Python :: 3
10
9
  Classifier: Programming Language :: Python :: 3 :: Only
11
10
  Classifier: Programming Language :: Python :: 3.10
@@ -17,12 +16,12 @@ Description-Content-Type: text/markdown
17
16
  License-File: LICENSE
18
17
  Requires-Dist: cxxheaderparser
19
18
  Requires-Dist: GitPython
20
- Requires-Dist: archinfo==9.2.159
19
+ Requires-Dist: archinfo==9.2.160
21
20
  Requires-Dist: cachetools
22
21
  Requires-Dist: capstone==5.0.3
23
22
  Requires-Dist: cffi>=1.14.0
24
- Requires-Dist: claripy==9.2.159
25
- Requires-Dist: cle==9.2.159
23
+ Requires-Dist: claripy==9.2.160
24
+ Requires-Dist: cle==9.2.160
26
25
  Requires-Dist: mulpyplexer
27
26
  Requires-Dist: networkx!=2.8.1,>=2.0
28
27
  Requires-Dist: protobuf>=5.28.2
@@ -31,7 +30,7 @@ Requires-Dist: pycparser>=2.18
31
30
  Requires-Dist: pydemumble
32
31
  Requires-Dist: pyformlang
33
32
  Requires-Dist: pypcode<4.0,>=3.2.1
34
- Requires-Dist: pyvex==9.2.159
33
+ Requires-Dist: pyvex==9.2.160
35
34
  Requires-Dist: rich>=13.1.0
36
35
  Requires-Dist: sortedcontainers
37
36
  Requires-Dist: sympy
@@ -1,4 +1,4 @@
1
- angr/__init__.py,sha256=OceCOkg7DfGXhezCu4vARQkwc1Vm6rKcmI5EUdsljpU,9153
1
+ angr/__init__.py,sha256=y2AyYUWq5y7F77fLWaQlVLS_IfEoqKG_0JJn943Yb0g,9153
2
2
  angr/__main__.py,sha256=AK9V6uPZ58UuTKmmiH_Kgn5pG9AvjnmJCPOku69A-WU,4993
3
3
  angr/annocfg.py,sha256=0NIvcuCskwz45hbBzigUTAuCrYutjDMwEXtMJf0y0S0,10742
4
4
  angr/blade.py,sha256=NhesOPloKJC1DQJRv_HBT18X7oNxK16JwAfNz2Lc1o0,15384
@@ -14,7 +14,7 @@ angr/keyed_region.py,sha256=Cx6dadqFgEvRmEHTbCJpg9mXkBtKGc_BKckHc6bk1IU,17992
14
14
  angr/knowledge_base.py,sha256=hRoSLuLaOXmddTSF9FN5TVs7liftpBGq_IICz5AaYBk,4533
15
15
  angr/project.py,sha256=ANJUNPF41_Gs1vH8SC28FktgogurkNdeTH-uqLNPeoQ,37567
16
16
  angr/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
17
- angr/rustylib.abi3.so,sha256=4BIY3LBXyNrKq6Lm6H4LQuIeBFg0MgPTf7OY-c3k3H0,4791920
17
+ angr/rustylib.abi3.so,sha256=fFNRVo1fu9Boxtq1v4XeVgAlJyUTLSNhB8dNz23hKLg,4791920
18
18
  angr/serializable.py,sha256=l908phj_KcqopEEL_oCufbP_H6cm3Wc9v-5xdux1-6g,1533
19
19
  angr/sim_manager.py,sha256=w7yTfWR-P9yoN5x85eeiNpj9dTrnjpJ3o5aoFpDAPnc,39396
20
20
  angr/sim_options.py,sha256=tfl57MFECmA7uvMMtQrRRbpG8g_A9jKOzwY6nApTW6Y,17782
@@ -26,6 +26,7 @@ angr/sim_variable.py,sha256=3DssmMw5G7m_-MYToJ3LBP-ooy2UQEuI2YgxIuX3d4Y,13177
26
26
  angr/slicer.py,sha256=DND0BERanYKafasRH9MDFAng0rSjdjmzXj2-phCD6CQ,10634
27
27
  angr/state_hierarchy.py,sha256=qDQCUGXmQm3vOxE3CSoiqTH4OAFFOWZZt9BLhNpeOhA,8484
28
28
  angr/tablespecs.py,sha256=Kx1e87FxTx3_ZN7cAHWZSRpdInT4Vfj5gExAWtLkLTw,3259
29
+ angr/unicornlib.dylib,sha256=aFP8fWKwgFSW-ULArLcXW8oj7TRGdOklXZSbzBMjZQQ,234064
29
30
  angr/vaults.py,sha256=D_gkDegCyPlZMKGC5E8zINYAaZfSXNWbmhX0rXCYpvM,9718
30
31
  angr/ailment/__init__.py,sha256=X1LTS6MuTovGtbXBjZendUVOzRk-ib-bP0imuqJDOYI,2039
31
32
  angr/ailment/block.py,sha256=rkmimsNPhrUabVVbRd2IgCaW0hA2_isvAsKlYtHZhgY,2428
@@ -120,11 +121,11 @@ angr/analyses/decompiler/block_io_finder.py,sha256=9J56W0_SQPczZ2-VoxqSv61T57foH
120
121
  angr/analyses/decompiler/block_similarity.py,sha256=S1lTlXFyOmJlQa7I3y7xgLsENLS4XGET7tdD55k_6Vg,6859
121
122
  angr/analyses/decompiler/block_simplifier.py,sha256=wjdp5fBMbAh6C3YKadQb56DP7jzuWq1bS7KJ1amah4g,14249
122
123
  angr/analyses/decompiler/callsite_maker.py,sha256=QxdNvnPt0oyRtsbFLCVpWdI7NL1LdT-TlEq27X5RAqA,23150
123
- angr/analyses/decompiler/clinic.py,sha256=BAPMXpIyhmY0IhlVfIXgjxArnAnux_BTJQ76RLbdwWc,150537
124
+ angr/analyses/decompiler/clinic.py,sha256=wfUJO9BI0htA38x3HF_u1Uq9vch8vzMFXF2UzQ6btbE,150808
124
125
  angr/analyses/decompiler/condition_processor.py,sha256=r1lVXkFLai8DtU5gqtvxz3kpjW2S4oP4mNSx7iqzQ38,53175
125
126
  angr/analyses/decompiler/decompilation_cache.py,sha256=gAZtyXs-eoFj3680bTrJVAZcIoaPsFK0kayu30NYLb4,1509
126
127
  angr/analyses/decompiler/decompilation_options.py,sha256=NDB67DI1L-stvJ4b1eQkfV26HgDJ_rG9-6PEv08G9-8,8195
127
- angr/analyses/decompiler/decompiler.py,sha256=5olAxG6aDWiY-LtwCgXaWTajvfU7VsiNDtiNpJs37VY,30415
128
+ angr/analyses/decompiler/decompiler.py,sha256=5_ifidQ9u5lUupyZD9AVHWmJCzviGsqrZhneZNv4dqw,30479
128
129
  angr/analyses/decompiler/empty_node_remover.py,sha256=4CdxTM1AVmRoEdRIwJg1YEy10AgkEoRmJ8SU7xGbKnM,7424
129
130
  angr/analyses/decompiler/expression_narrower.py,sha256=lBtcsPu4V5JJ_u25GF-BJ3vaybu8TRr9XxmnjOrA4J8,10367
130
131
  angr/analyses/decompiler/goto_manager.py,sha256=wVoeXJcadIda84LloGgqW-rL0QHLv3fx4vZHLhmz-_o,4027
@@ -376,10 +377,10 @@ angr/analyses/s_reaching_definitions/s_reaching_definitions.py,sha256=GkMe-Kl4zz
376
377
  angr/analyses/typehoon/__init__.py,sha256=KjKBUZadAd3grXUy48_qO0L4Me-riSqPGteVDcTL59M,92
377
378
  angr/analyses/typehoon/dfa.py,sha256=41lzhE-QmkC342SjfaaPI41lr4Au5XROTu_7oenvg7g,3823
378
379
  angr/analyses/typehoon/lifter.py,sha256=hxYJmM_A0Kl6YgY7NyWBtA3ieaY49Ey3ESCHC61lMys,4000
379
- angr/analyses/typehoon/simple_solver.py,sha256=FCXrUzN4FyLh9_WGj1n0GrFSGt9-kkE5qvk0YlfEf9A,58255
380
+ angr/analyses/typehoon/simple_solver.py,sha256=CCGsuxzcRwPxh3S3fU_CJNQ7KVJaTP_SzH5ZImuPhDw,67609
380
381
  angr/analyses/typehoon/translator.py,sha256=_UE1JC4KNDXXl4plula9OApK1ee07z9BFdX9HKa5uqw,10568
381
382
  angr/analyses/typehoon/typeconsts.py,sha256=jQEVziyt3LnctrSrCtbUSPi-0tjl8DKoLMFfaOEG3lI,7939
382
- angr/analyses/typehoon/typehoon.py,sha256=_f8-l1XyxmQm3gvR6wO7q_PRhIVmYEX7dVDfy2kmgM4,12426
383
+ angr/analyses/typehoon/typehoon.py,sha256=qj5MBJdzVB-5f73N_Da0gs5fG-eIFN272VNfsdYn7lo,12777
383
384
  angr/analyses/typehoon/typevars.py,sha256=ZDnKaGEwBTzYWUPQzacQkJ4rMpUDlnLzzJuKyQuEEtA,17839
384
385
  angr/analyses/typehoon/variance.py,sha256=3wYw3of8uoar-MQ7gD6arALiwlJRW990t0BUqMarXIY,193
385
386
  angr/analyses/unpacker/__init__.py,sha256=tBXwDMFKN0Hp8YP0DK-c6deo0Muc_LNopvoKKbzp3Tc,190
@@ -387,7 +388,7 @@ angr/analyses/unpacker/obfuscation_detector.py,sha256=VWMHOO2UbyiGzRYzAq9yrU3WwZ
387
388
  angr/analyses/unpacker/packing_detector.py,sha256=SO6aXR1gZkQ7w17AAv3C1-U2KAc0yL9OIQqjNOtVnuo,5331
388
389
  angr/analyses/variable_recovery/__init__.py,sha256=eA1SHzfSx8aPufUdkvgMmBnbI6VDYKKMJklcOoCO7Ao,208
389
390
  angr/analyses/variable_recovery/annotations.py,sha256=2va7cXnRHYqVqXeVt00QanxfAo3zanL4BkAcC0-Bk20,1438
390
- angr/analyses/variable_recovery/engine_ail.py,sha256=M8nEWRb0_N_id9KMFDTL6P_MuXNR_rknwcHVrxkvDbU,34019
391
+ angr/analyses/variable_recovery/engine_ail.py,sha256=8yqrl_qfO_DCvaIxwsa_eits5rIbly4rBEFh5W_U2O4,33709
391
392
  angr/analyses/variable_recovery/engine_base.py,sha256=uKtxlkGVWQC1ACAA9-9e2T5TriwD0bhOY-N4IRakCJc,52641
392
393
  angr/analyses/variable_recovery/engine_vex.py,sha256=5Q2S1jAr7tALa0m0okqBHBe3cUePmJlnV1Grxos1xbo,21344
393
394
  angr/analyses/variable_recovery/irsb_scanner.py,sha256=1dL2IC7fZGuRrhmcpa2Q-G666aMPmbM8zSzmIRpLNSY,5141
@@ -586,7 +587,6 @@ angr/knowledge_plugins/xrefs/__init__.py,sha256=5PhqVOtTZ27lCjJ9wp7akUeJydqILbyC
586
587
  angr/knowledge_plugins/xrefs/xref.py,sha256=U2H1rfffp5EXoh0awlGxMBxA4K5MIwl3CXjV3Uih3tA,4856
587
588
  angr/knowledge_plugins/xrefs/xref_manager.py,sha256=1n373rtV91xicAfSUresRigsZ6qCBhPOaJKrN_SW3QY,4157
588
589
  angr/knowledge_plugins/xrefs/xref_types.py,sha256=LcQ9pD4E4XlC51Us49xiqAoGAFGpnCrpYO4mOzILiKI,308
589
- angr/lib/angr_native.dylib,sha256=cDRLLQ2szE6ISI2oUBH2nP8ThwYPIHD8K5tSK5Jxy1Y,234064
590
590
  angr/misc/__init__.py,sha256=FoUwjk1DhqlIsr2sBN0MlR8MnSOGQv9QJhxmq32RYuA,355
591
591
  angr/misc/ansi.py,sha256=nPJHC0SKfqasMQZ0LxdmmIYojjmk4nr5jI6FrzoTwS0,811
592
592
  angr/misc/autoimport.py,sha256=iZagpuPwZWczUTYIqs-JkDMQjftMqc_cchcm7OBFiEg,3450
@@ -1308,7 +1308,7 @@ angr/state_plugins/solver.py,sha256=GVN-z84AkVtWbTt-6m8j_1pxxDQ-Y2GsnebdLVF4Wmk,
1308
1308
  angr/state_plugins/symbolizer.py,sha256=XEdY9g1G0xN0SbA1MDmSDsaOithnP3HnrsckeNV37m4,11011
1309
1309
  angr/state_plugins/trace_additions.py,sha256=d1P4a-DdC0c2Fu5_KAhNzfLr1mylAR2wWSOMSwad7os,29717
1310
1310
  angr/state_plugins/uc_manager.py,sha256=-mervKrD5a5K71CVAUxHrDW5RCduNwNxZXwW63L9bEA,2973
1311
- angr/state_plugins/unicorn_engine.py,sha256=gvepo_hpUjrreGj0U6vgqnoQdGSSPVqvGdVnHG-Lgpc,77945
1311
+ angr/state_plugins/unicorn_engine.py,sha256=-HYSPKLxN1VEA6LeVXtHSyIVKEH-rY0pmNaRrYx9d4A,77934
1312
1312
  angr/state_plugins/view.py,sha256=968XQAnGrPB0gHh0f6DDTEn54VlpwFjcDZgtAmIwCf8,12382
1313
1313
  angr/state_plugins/heap/__init__.py,sha256=ajfNPVloK8CUpfd1z22v8dof55c8skshy8aFHG-aqy8,340
1314
1314
  angr/state_plugins/heap/heap_base.py,sha256=IaKFHqGoWIcFWx6WCEvpnUvn8eqmD1Gay3JWFerLnnk,6281
@@ -1397,9 +1397,9 @@ angr/utils/types.py,sha256=688trvR0_j93sfeRgFT1npcmjNGSx99m_IPe9Xyy9WY,4967
1397
1397
  angr/utils/ssa/__init__.py,sha256=veiW783pfwUhphLOIgxBbiH6kL2i22daZQ2beJC5ZHs,15255
1398
1398
  angr/utils/ssa/tmp_uses_collector.py,sha256=digAUQpYoFR1VYfwoXlF3T1pYdDi6Pdq_ck54SjMabQ,813
1399
1399
  angr/utils/ssa/vvar_uses_collector.py,sha256=HewqUQluNE9EsaiLeFo7LaBvws_DDBDYNt9RBExy464,1367
1400
- angr-9.2.159.dist-info/licenses/LICENSE,sha256=PmWf0IlSz6Jjp9n7nyyBQA79Q5C2ma68LRykY1V3GF0,1456
1401
- angr-9.2.159.dist-info/METADATA,sha256=DK9INGhwh64jkzr6Q4XY0bW88b6mnEeFt9-IkNkFy6Q,4394
1402
- angr-9.2.159.dist-info/WHEEL,sha256=Xo4I_AKyna1Fzpk3lt1KsHk3bISzty9j2i4Mgn1zPIM,108
1403
- angr-9.2.159.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
1404
- angr-9.2.159.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
1405
- angr-9.2.159.dist-info/RECORD,,
1400
+ angr-9.2.160.dist-info/licenses/LICENSE,sha256=PmWf0IlSz6Jjp9n7nyyBQA79Q5C2ma68LRykY1V3GF0,1456
1401
+ angr-9.2.160.dist-info/METADATA,sha256=5PNZ_AfJn_ihj55HU-z9J2PzJpTkXem-HYY9lBXOT-c,4343
1402
+ angr-9.2.160.dist-info/WHEEL,sha256=Xo4I_AKyna1Fzpk3lt1KsHk3bISzty9j2i4Mgn1zPIM,108
1403
+ angr-9.2.160.dist-info/entry_points.txt,sha256=Vjh1C8PMyr5dZFMnik5WkEP01Uwr2T73I3a6N32sgQU,44
1404
+ angr-9.2.160.dist-info/top_level.txt,sha256=dKw0KWTbwLXytFvv15oAAG4sUs3ey47tt6DorJG9-hw,5
1405
+ angr-9.2.160.dist-info/RECORD,,
File without changes