angr 9.2.120__py3-none-manylinux2014_aarch64.whl → 9.2.121__py3-none-manylinux2014_aarch64.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 (76) hide show
  1. angr/__init__.py +1 -1
  2. angr/analyses/cfg/cfg_fast.py +2 -1
  3. angr/analyses/cfg/indirect_jump_resolvers/__init__.py +2 -0
  4. angr/analyses/cfg/indirect_jump_resolvers/default_resolvers.py +2 -0
  5. angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +10 -6
  6. angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py +138 -367
  7. angr/analyses/cfg/indirect_jump_resolvers/mips_elf_got.py +148 -0
  8. angr/analyses/decompiler/ccall_rewriters/amd64_ccalls.py +20 -0
  9. angr/analyses/typehoon/typevars.py +37 -16
  10. angr/angrdb/db.py +1 -1
  11. angr/block.py +9 -1
  12. angr/calling_conventions.py +1 -1
  13. angr/engines/engine.py +8 -15
  14. angr/engines/pcode/lifter.py +8 -0
  15. angr/engines/successors.py +1 -1
  16. angr/engines/vex/claripy/ccall.py +1 -1
  17. angr/engines/vex/claripy/datalayer.py +7 -10
  18. angr/engines/vex/heavy/actions.py +19 -24
  19. angr/engines/vex/heavy/heavy.py +7 -1
  20. angr/engines/vex/lifter.py +3 -1
  21. angr/engines/vex/light/light.py +2 -2
  22. angr/factory.py +5 -0
  23. angr/knowledge_plugins/cfg/memory_data.py +1 -0
  24. angr/lib/angr_native.so +0 -0
  25. angr/protos/cfg_pb2.py +23 -15
  26. angr/protos/function_pb2.py +19 -21
  27. angr/protos/primitives_pb2.py +46 -112
  28. angr/protos/variables_pb2.py +38 -114
  29. angr/protos/xrefs_pb2.py +17 -18
  30. angr/sim_state.py +2 -78
  31. angr/state_plugins/solver.py +72 -15
  32. angr/storage/__init__.py +1 -2
  33. angr/storage/memory_mixins/__init__.py +5 -160
  34. angr/storage/memory_mixins/actions_mixin.py +1 -1
  35. angr/storage/memory_mixins/address_concretization_mixin.py +1 -1
  36. angr/storage/memory_mixins/bvv_conversion_mixin.py +1 -1
  37. angr/storage/memory_mixins/clouseau_mixin.py +2 -1
  38. angr/storage/memory_mixins/conditional_store_mixin.py +1 -1
  39. angr/storage/memory_mixins/convenient_mappings_mixin.py +1 -1
  40. angr/storage/memory_mixins/default_filler_mixin.py +1 -1
  41. angr/storage/memory_mixins/dirty_addrs_mixin.py +2 -1
  42. angr/storage/memory_mixins/hex_dumper_mixin.py +1 -1
  43. angr/storage/memory_mixins/javavm_memory_mixin.py +1 -1
  44. angr/storage/memory_mixins/keyvalue_memory_mixin.py +1 -1
  45. angr/storage/memory_mixins/label_merger_mixin.py +1 -1
  46. angr/storage/memory_mixins/memory_mixin.py +163 -0
  47. angr/storage/memory_mixins/multi_value_merger_mixin.py +1 -1
  48. angr/storage/memory_mixins/name_resolution_mixin.py +3 -1
  49. angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +1 -1
  50. angr/storage/memory_mixins/paged_memory/paged_memory_multivalue_mixin.py +2 -1
  51. angr/storage/memory_mixins/paged_memory/pages/__init__.py +1 -1
  52. angr/storage/memory_mixins/paged_memory/pages/history_tracking_mixin.py +1 -1
  53. angr/storage/memory_mixins/paged_memory/pages/ispo_mixin.py +2 -1
  54. angr/storage/memory_mixins/paged_memory/pages/permissions_mixin.py +1 -1
  55. angr/storage/memory_mixins/paged_memory/pages/refcount_mixin.py +2 -1
  56. angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +1 -1
  57. angr/storage/memory_mixins/regioned_memory/abstract_merger_mixin.py +1 -2
  58. angr/storage/memory_mixins/regioned_memory/region_category_mixin.py +2 -1
  59. angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +1 -1
  60. angr/storage/memory_mixins/regioned_memory/regioned_address_concretization_mixin.py +1 -1
  61. angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +2 -2
  62. angr/storage/memory_mixins/simple_interface_mixin.py +2 -1
  63. angr/storage/memory_mixins/simplification_mixin.py +2 -1
  64. angr/storage/memory_mixins/size_resolution_mixin.py +1 -1
  65. angr/storage/memory_mixins/slotted_memory.py +2 -2
  66. angr/storage/memory_mixins/smart_find_mixin.py +1 -1
  67. angr/storage/memory_mixins/symbolic_merger_mixin.py +2 -1
  68. angr/storage/memory_mixins/top_merger_mixin.py +3 -2
  69. angr/storage/memory_mixins/underconstrained_mixin.py +4 -2
  70. angr/storage/memory_mixins/unwrapper_mixin.py +2 -1
  71. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/METADATA +7 -7
  72. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/RECORD +76 -74
  73. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/LICENSE +0 -0
  74. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/WHEEL +0 -0
  75. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/entry_points.txt +0 -0
  76. {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/top_level.txt +0 -0
@@ -1,126 +1,50 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # NO CHECKED-IN PROTOBUF GENCODE
2
3
  # source: protos/variables.proto
4
+ # Protobuf Python Version: 5.28.2
3
5
  """Generated protocol buffer code."""
6
+
4
7
  from google.protobuf import descriptor as _descriptor
5
8
  from google.protobuf import descriptor_pool as _descriptor_pool
6
- from google.protobuf import message as _message
7
- from google.protobuf import reflection as _reflection
9
+ from google.protobuf import runtime_version as _runtime_version
8
10
  from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+
13
+ _runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 28, 2, "", "protos/variables.proto")
9
14
  # @@protoc_insertion_point(imports)
10
15
 
11
16
  _sym_db = _symbol_database.Default()
12
17
 
13
18
 
14
-
15
-
16
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16protos/variables.proto\x12\x0b\x61ngr.protos\"\x90\x01\n\x0cVariableBase\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x06region\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x15\n\x08\x63\x61tegory\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0f\n\x07renamed\x18\x05 \x01(\x08\x12\x0e\n\x06is_phi\x18\x06 \x01(\x08\x42\t\n\x07_regionB\x0b\n\t_category\"L\n\x11TemporaryVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0e\n\x06tmp_id\x18\x02 \x01(\r\"V\n\x10RegisterVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0b\n\x03reg\x18\x02 \x01(\r\x12\x0c\n\x04size\x18\x03 \x01(\r\"U\n\x0eMemoryVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\x04\x12\x0c\n\x04size\x18\x03 \x01(\r\"u\n\rStackVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\x04\x12\x0c\n\x04size\x18\x03 \x01(\r\x12\x0f\n\x07sp_base\x18\x04 \x01(\x08\x12\x0e\n\x06offset\x18\x05 \x01(\x05\"\x9c\x02\n\x0eVariableAccess\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x12\n\nblock_addr\x18\x02 \x01(\x04\x12\x10\n\x08stmt_idx\x18\x03 \x01(\x05\x12\x10\n\x08ins_addr\x18\x04 \x01(\x04\x12\x13\n\x06offset\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x43\n\x0b\x61\x63\x63\x65ss_type\x18\x06 \x01(\x0e\x32..angr.protos.VariableAccess.VariableAccessSort\x12\x16\n\tatom_hash\x18\x07 \x01(\rH\x01\x88\x01\x01\"8\n\x12VariableAccessSort\x12\t\n\x05WRITE\x10\x00\x12\x08\n\x04READ\x10\x01\x12\r\n\tREFERENCE\x10\x02\x42\t\n\x07_offsetB\x0c\n\n_atom_hash\"/\n\x0cVariableType\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x10\n\x08var_type\x18\x02 \x01(\t\";\n\x0bVar2Unified\x12\x11\n\tvar_ident\x18\x01 \x01(\t\x12\x19\n\x11unified_var_ident\x18\x02 \x01(\t\"/\n\x07Phi2Var\x12\x11\n\tphi_ident\x18\x01 \x01(\t\x12\x11\n\tvar_ident\x18\x02 \x01(\t\"\xe6\x04\n\x17VariableManagerInternal\x12\x30\n\x08tempvars\x18\x01 \x03(\x0b\x32\x1e.angr.protos.TemporaryVariable\x12.\n\x07regvars\x18\x02 \x03(\x0b\x32\x1d.angr.protos.RegisterVariable\x12,\n\x07memvars\x18\x03 \x03(\x0b\x32\x1b.angr.protos.MemoryVariable\x12-\n\tstackvars\x18\x04 \x03(\x0b\x32\x1a.angr.protos.StackVariable\x12-\n\x08\x61\x63\x63\x65sses\x18\x05 \x03(\x0b\x32\x1b.angr.protos.VariableAccess\x12\x38\n\x10unified_tempvars\x18\x06 \x03(\x0b\x32\x1e.angr.protos.TemporaryVariable\x12\x36\n\x0funified_regvars\x18\x07 \x03(\x0b\x32\x1d.angr.protos.RegisterVariable\x12\x34\n\x0funified_memvars\x18\x08 \x03(\x0b\x32\x1b.angr.protos.MemoryVariable\x12\x35\n\x11unified_stackvars\x18\t \x03(\x0b\x32\x1a.angr.protos.StackVariable\x12-\n\x0bvar2unified\x18\n \x03(\x0b\x32\x18.angr.protos.Var2Unified\x12(\n\x05types\x18\x0b \x03(\x0b\x32\x19.angr.protos.VariableType\x12%\n\x07phi2var\x18\x0c \x03(\x0b\x32\x14.angr.protos.Phi2Varb\x06proto3')
17
-
18
-
19
-
20
- _VARIABLEBASE = DESCRIPTOR.message_types_by_name['VariableBase']
21
- _TEMPORARYVARIABLE = DESCRIPTOR.message_types_by_name['TemporaryVariable']
22
- _REGISTERVARIABLE = DESCRIPTOR.message_types_by_name['RegisterVariable']
23
- _MEMORYVARIABLE = DESCRIPTOR.message_types_by_name['MemoryVariable']
24
- _STACKVARIABLE = DESCRIPTOR.message_types_by_name['StackVariable']
25
- _VARIABLEACCESS = DESCRIPTOR.message_types_by_name['VariableAccess']
26
- _VARIABLETYPE = DESCRIPTOR.message_types_by_name['VariableType']
27
- _VAR2UNIFIED = DESCRIPTOR.message_types_by_name['Var2Unified']
28
- _PHI2VAR = DESCRIPTOR.message_types_by_name['Phi2Var']
29
- _VARIABLEMANAGERINTERNAL = DESCRIPTOR.message_types_by_name['VariableManagerInternal']
30
- _VARIABLEACCESS_VARIABLEACCESSSORT = _VARIABLEACCESS.enum_types_by_name['VariableAccessSort']
31
- VariableBase = _reflection.GeneratedProtocolMessageType('VariableBase', (_message.Message,), {
32
- 'DESCRIPTOR' : _VARIABLEBASE,
33
- '__module__' : 'protos.variables_pb2'
34
- # @@protoc_insertion_point(class_scope:angr.protos.VariableBase)
35
- })
36
- _sym_db.RegisterMessage(VariableBase)
37
-
38
- TemporaryVariable = _reflection.GeneratedProtocolMessageType('TemporaryVariable', (_message.Message,), {
39
- 'DESCRIPTOR' : _TEMPORARYVARIABLE,
40
- '__module__' : 'protos.variables_pb2'
41
- # @@protoc_insertion_point(class_scope:angr.protos.TemporaryVariable)
42
- })
43
- _sym_db.RegisterMessage(TemporaryVariable)
44
-
45
- RegisterVariable = _reflection.GeneratedProtocolMessageType('RegisterVariable', (_message.Message,), {
46
- 'DESCRIPTOR' : _REGISTERVARIABLE,
47
- '__module__' : 'protos.variables_pb2'
48
- # @@protoc_insertion_point(class_scope:angr.protos.RegisterVariable)
49
- })
50
- _sym_db.RegisterMessage(RegisterVariable)
51
-
52
- MemoryVariable = _reflection.GeneratedProtocolMessageType('MemoryVariable', (_message.Message,), {
53
- 'DESCRIPTOR' : _MEMORYVARIABLE,
54
- '__module__' : 'protos.variables_pb2'
55
- # @@protoc_insertion_point(class_scope:angr.protos.MemoryVariable)
56
- })
57
- _sym_db.RegisterMessage(MemoryVariable)
58
-
59
- StackVariable = _reflection.GeneratedProtocolMessageType('StackVariable', (_message.Message,), {
60
- 'DESCRIPTOR' : _STACKVARIABLE,
61
- '__module__' : 'protos.variables_pb2'
62
- # @@protoc_insertion_point(class_scope:angr.protos.StackVariable)
63
- })
64
- _sym_db.RegisterMessage(StackVariable)
65
-
66
- VariableAccess = _reflection.GeneratedProtocolMessageType('VariableAccess', (_message.Message,), {
67
- 'DESCRIPTOR' : _VARIABLEACCESS,
68
- '__module__' : 'protos.variables_pb2'
69
- # @@protoc_insertion_point(class_scope:angr.protos.VariableAccess)
70
- })
71
- _sym_db.RegisterMessage(VariableAccess)
72
-
73
- VariableType = _reflection.GeneratedProtocolMessageType('VariableType', (_message.Message,), {
74
- 'DESCRIPTOR' : _VARIABLETYPE,
75
- '__module__' : 'protos.variables_pb2'
76
- # @@protoc_insertion_point(class_scope:angr.protos.VariableType)
77
- })
78
- _sym_db.RegisterMessage(VariableType)
79
-
80
- Var2Unified = _reflection.GeneratedProtocolMessageType('Var2Unified', (_message.Message,), {
81
- 'DESCRIPTOR' : _VAR2UNIFIED,
82
- '__module__' : 'protos.variables_pb2'
83
- # @@protoc_insertion_point(class_scope:angr.protos.Var2Unified)
84
- })
85
- _sym_db.RegisterMessage(Var2Unified)
86
-
87
- Phi2Var = _reflection.GeneratedProtocolMessageType('Phi2Var', (_message.Message,), {
88
- 'DESCRIPTOR' : _PHI2VAR,
89
- '__module__' : 'protos.variables_pb2'
90
- # @@protoc_insertion_point(class_scope:angr.protos.Phi2Var)
91
- })
92
- _sym_db.RegisterMessage(Phi2Var)
93
-
94
- VariableManagerInternal = _reflection.GeneratedProtocolMessageType('VariableManagerInternal', (_message.Message,), {
95
- 'DESCRIPTOR' : _VARIABLEMANAGERINTERNAL,
96
- '__module__' : 'protos.variables_pb2'
97
- # @@protoc_insertion_point(class_scope:angr.protos.VariableManagerInternal)
98
- })
99
- _sym_db.RegisterMessage(VariableManagerInternal)
100
-
101
- if _descriptor._USE_C_DESCRIPTORS == False:
102
-
103
- DESCRIPTOR._options = None
104
- _VARIABLEBASE._serialized_start=40
105
- _VARIABLEBASE._serialized_end=184
106
- _TEMPORARYVARIABLE._serialized_start=186
107
- _TEMPORARYVARIABLE._serialized_end=262
108
- _REGISTERVARIABLE._serialized_start=264
109
- _REGISTERVARIABLE._serialized_end=350
110
- _MEMORYVARIABLE._serialized_start=352
111
- _MEMORYVARIABLE._serialized_end=437
112
- _STACKVARIABLE._serialized_start=439
113
- _STACKVARIABLE._serialized_end=556
114
- _VARIABLEACCESS._serialized_start=559
115
- _VARIABLEACCESS._serialized_end=843
116
- _VARIABLEACCESS_VARIABLEACCESSSORT._serialized_start=762
117
- _VARIABLEACCESS_VARIABLEACCESSSORT._serialized_end=818
118
- _VARIABLETYPE._serialized_start=845
119
- _VARIABLETYPE._serialized_end=892
120
- _VAR2UNIFIED._serialized_start=894
121
- _VAR2UNIFIED._serialized_end=953
122
- _PHI2VAR._serialized_start=955
123
- _PHI2VAR._serialized_end=1002
124
- _VARIABLEMANAGERINTERNAL._serialized_start=1005
125
- _VARIABLEMANAGERINTERNAL._serialized_end=1619
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
20
+ b'\n\x16protos/variables.proto\x12\x0b\x61ngr.protos"\x90\x01\n\x0cVariableBase\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x06region\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x15\n\x08\x63\x61tegory\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x0f\n\x07renamed\x18\x05 \x01(\x08\x12\x0e\n\x06is_phi\x18\x06 \x01(\x08\x42\t\n\x07_regionB\x0b\n\t_category"L\n\x11TemporaryVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0e\n\x06tmp_id\x18\x02 \x01(\r"V\n\x10RegisterVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0b\n\x03reg\x18\x02 \x01(\r\x12\x0c\n\x04size\x18\x03 \x01(\r"U\n\x0eMemoryVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\x04\x12\x0c\n\x04size\x18\x03 \x01(\r"u\n\rStackVariable\x12\'\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x19.angr.protos.VariableBase\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\x04\x12\x0c\n\x04size\x18\x03 \x01(\r\x12\x0f\n\x07sp_base\x18\x04 \x01(\x08\x12\x0e\n\x06offset\x18\x05 \x01(\x05"\x9c\x02\n\x0eVariableAccess\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x12\n\nblock_addr\x18\x02 \x01(\x04\x12\x10\n\x08stmt_idx\x18\x03 \x01(\x05\x12\x10\n\x08ins_addr\x18\x04 \x01(\x04\x12\x13\n\x06offset\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\x43\n\x0b\x61\x63\x63\x65ss_type\x18\x06 \x01(\x0e\x32..angr.protos.VariableAccess.VariableAccessSort\x12\x16\n\tatom_hash\x18\x07 \x01(\rH\x01\x88\x01\x01"8\n\x12VariableAccessSort\x12\t\n\x05WRITE\x10\x00\x12\x08\n\x04READ\x10\x01\x12\r\n\tREFERENCE\x10\x02\x42\t\n\x07_offsetB\x0c\n\n_atom_hash"/\n\x0cVariableType\x12\r\n\x05ident\x18\x01 \x01(\t\x12\x10\n\x08var_type\x18\x02 \x01(\t";\n\x0bVar2Unified\x12\x11\n\tvar_ident\x18\x01 \x01(\t\x12\x19\n\x11unified_var_ident\x18\x02 \x01(\t"/\n\x07Phi2Var\x12\x11\n\tphi_ident\x18\x01 \x01(\t\x12\x11\n\tvar_ident\x18\x02 \x01(\t"\xe6\x04\n\x17VariableManagerInternal\x12\x30\n\x08tempvars\x18\x01 \x03(\x0b\x32\x1e.angr.protos.TemporaryVariable\x12.\n\x07regvars\x18\x02 \x03(\x0b\x32\x1d.angr.protos.RegisterVariable\x12,\n\x07memvars\x18\x03 \x03(\x0b\x32\x1b.angr.protos.MemoryVariable\x12-\n\tstackvars\x18\x04 \x03(\x0b\x32\x1a.angr.protos.StackVariable\x12-\n\x08\x61\x63\x63\x65sses\x18\x05 \x03(\x0b\x32\x1b.angr.protos.VariableAccess\x12\x38\n\x10unified_tempvars\x18\x06 \x03(\x0b\x32\x1e.angr.protos.TemporaryVariable\x12\x36\n\x0funified_regvars\x18\x07 \x03(\x0b\x32\x1d.angr.protos.RegisterVariable\x12\x34\n\x0funified_memvars\x18\x08 \x03(\x0b\x32\x1b.angr.protos.MemoryVariable\x12\x35\n\x11unified_stackvars\x18\t \x03(\x0b\x32\x1a.angr.protos.StackVariable\x12-\n\x0bvar2unified\x18\n \x03(\x0b\x32\x18.angr.protos.Var2Unified\x12(\n\x05types\x18\x0b \x03(\x0b\x32\x19.angr.protos.VariableType\x12%\n\x07phi2var\x18\x0c \x03(\x0b\x32\x14.angr.protos.Phi2Varb\x06proto3'
21
+ )
22
+
23
+ _globals = globals()
24
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
25
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "protos.variables_pb2", _globals)
26
+ if not _descriptor._USE_C_DESCRIPTORS:
27
+ DESCRIPTOR._loaded_options = None
28
+ _globals["_VARIABLEBASE"]._serialized_start = 40
29
+ _globals["_VARIABLEBASE"]._serialized_end = 184
30
+ _globals["_TEMPORARYVARIABLE"]._serialized_start = 186
31
+ _globals["_TEMPORARYVARIABLE"]._serialized_end = 262
32
+ _globals["_REGISTERVARIABLE"]._serialized_start = 264
33
+ _globals["_REGISTERVARIABLE"]._serialized_end = 350
34
+ _globals["_MEMORYVARIABLE"]._serialized_start = 352
35
+ _globals["_MEMORYVARIABLE"]._serialized_end = 437
36
+ _globals["_STACKVARIABLE"]._serialized_start = 439
37
+ _globals["_STACKVARIABLE"]._serialized_end = 556
38
+ _globals["_VARIABLEACCESS"]._serialized_start = 559
39
+ _globals["_VARIABLEACCESS"]._serialized_end = 843
40
+ _globals["_VARIABLEACCESS_VARIABLEACCESSSORT"]._serialized_start = 762
41
+ _globals["_VARIABLEACCESS_VARIABLEACCESSSORT"]._serialized_end = 818
42
+ _globals["_VARIABLETYPE"]._serialized_start = 845
43
+ _globals["_VARIABLETYPE"]._serialized_end = 892
44
+ _globals["_VAR2UNIFIED"]._serialized_start = 894
45
+ _globals["_VAR2UNIFIED"]._serialized_end = 953
46
+ _globals["_PHI2VAR"]._serialized_start = 955
47
+ _globals["_PHI2VAR"]._serialized_end = 1002
48
+ _globals["_VARIABLEMANAGERINTERNAL"]._serialized_start = 1005
49
+ _globals["_VARIABLEMANAGERINTERNAL"]._serialized_end = 1619
126
50
  # @@protoc_insertion_point(module_scope)
angr/protos/xrefs_pb2.py CHANGED
@@ -1,11 +1,16 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # NO CHECKED-IN PROTOBUF GENCODE
2
3
  # source: protos/xrefs.proto
4
+ # Protobuf Python Version: 5.28.2
3
5
  """Generated protocol buffer code."""
6
+
4
7
  from google.protobuf import descriptor as _descriptor
5
8
  from google.protobuf import descriptor_pool as _descriptor_pool
6
- from google.protobuf import message as _message
7
- from google.protobuf import reflection as _reflection
9
+ from google.protobuf import runtime_version as _runtime_version
8
10
  from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+
13
+ _runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 28, 2, "", "protos/xrefs.proto")
9
14
  # @@protoc_insertion_point(imports)
10
15
 
11
16
  _sym_db = _symbol_database.Default()
@@ -14,21 +19,15 @@ _sym_db = _symbol_database.Default()
14
19
  from . import primitives_pb2 as protos_dot_primitives__pb2
15
20
 
16
21
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12protos/xrefs.proto\x12\x0b\x61ngr.protos\x1a\x17protos/primitives.proto\"2\n\x05XRefs\x12)\n\x05xrefs\x18\x01 \x03(\x0b\x32\x1a.angr.protos.CodeReferenceb\x06proto3')
18
-
19
-
20
-
21
- _XREFS = DESCRIPTOR.message_types_by_name['XRefs']
22
- XRefs = _reflection.GeneratedProtocolMessageType('XRefs', (_message.Message,), {
23
- 'DESCRIPTOR' : _XREFS,
24
- '__module__' : 'protos.xrefs_pb2'
25
- # @@protoc_insertion_point(class_scope:angr.protos.XRefs)
26
- })
27
- _sym_db.RegisterMessage(XRefs)
28
-
29
- if _descriptor._USE_C_DESCRIPTORS == False:
22
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
23
+ b'\n\x12protos/xrefs.proto\x12\x0b\x61ngr.protos\x1a\x17protos/primitives.proto"2\n\x05XRefs\x12)\n\x05xrefs\x18\x01 \x03(\x0b\x32\x1a.angr.protos.CodeReferenceb\x06proto3'
24
+ )
30
25
 
31
- DESCRIPTOR._options = None
32
- _XREFS._serialized_start=60
33
- _XREFS._serialized_end=110
26
+ _globals = globals()
27
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
28
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "protos.xrefs_pb2", _globals)
29
+ if not _descriptor._USE_C_DESCRIPTORS:
30
+ DESCRIPTOR._loaded_options = None
31
+ _globals["_XREFS"]._serialized_start = 60
32
+ _globals["_XREFS"]._serialized_end = 110
34
33
  # @@protoc_insertion_point(module_scope)
angr/sim_state.py CHANGED
@@ -485,92 +485,18 @@ class SimState(PluginHub):
485
485
  """
486
486
  return self.solver.simplify(*args)
487
487
 
488
- def add_constraints(self, *args, **kwargs):
488
+ def add_constraints(self, *constraints):
489
489
  """
490
490
  Add some constraints to the state.
491
491
 
492
492
  You may pass in any number of symbolic booleans as variadic positional arguments.
493
493
  """
494
- if len(args) > 0 and isinstance(args[0], (list, tuple)):
495
- raise Exception("Tuple or list passed to add_constraints!")
496
-
497
- if o.TRACK_CONSTRAINTS in self.options and len(args) > 0:
498
- constraints = [self.simplify(a) for a in args] if o.SIMPLIFY_CONSTRAINTS in self.options else args
499
-
500
- self._inspect("constraints", BP_BEFORE, added_constraints=constraints)
501
- constraints = self._inspect_getattr("added_constraints", constraints)
502
- added = self.solver.add(*constraints)
503
- self._inspect("constraints", BP_AFTER)
504
-
505
- # add actions for the added constraints
506
- if o.TRACK_CONSTRAINT_ACTIONS in self.options:
507
- for c in added:
508
- sac = SimActionConstraint(self, c)
509
- self.history.add_action(sac)
510
- else:
511
- # preserve the old action logic for when we don't track constraints (why?)
512
- if "action" in kwargs and kwargs["action"] and o.TRACK_CONSTRAINT_ACTIONS in self.options and len(args) > 0:
513
- for arg in args:
514
- if self.solver.symbolic(arg):
515
- sac = SimActionConstraint(self, arg)
516
- self.history.add_action(sac)
517
-
518
- if o.ABSTRACT_SOLVER in self.options and len(args) > 0:
519
- for arg in args:
520
- if self.solver.is_false(arg):
521
- self._satisfiable = False
522
- return
523
-
524
- if self.solver.is_true(arg):
525
- continue
526
-
527
- # It's neither True or False. Let's try to apply the condition
528
-
529
- # We take the argument, extract a list of constrained SIs out of it (if we could, of course), and
530
- # then replace each original SI the intersection of original SI and the constrained one.
531
-
532
- _, converted = claripy.constraint_to_si(arg)
533
-
534
- for original_expr, constrained_si in converted:
535
- if not original_expr.variables:
536
- l.error(
537
- "Incorrect original_expression to replace in add_constraints(). "
538
- "This is due to defects in VSA logics inside claripy. Please report "
539
- "to Fish and he will fix it if he's free."
540
- )
541
- continue
542
-
543
- new_expr = constrained_si
544
- self.registers.replace_all(original_expr, new_expr)
545
- self.memory.replace_all(original_expr, new_expr)
546
- # tmps
547
- temps = self.scratch.temps
548
- for idx in range(len(temps)): # pylint:disable=consider-using-enumerate
549
- t = temps[idx]
550
- if t is None:
551
- continue
552
- if t.variables.intersection(original_expr.variables):
553
- # replace
554
- temps[idx] = t.replace(original_expr, new_expr)
555
-
556
- l.debug("SimState.add_constraints: Applied to final state.")
557
- elif o.SYMBOLIC not in self.options and len(args) > 0:
558
- for arg in args:
559
- if self.solver.is_false(arg):
560
- self._satisfiable = False
561
- return
494
+ return self.solver.add(*constraints)
562
495
 
563
496
  def satisfiable(self, **kwargs):
564
497
  """
565
498
  Whether the state's constraints are satisfiable
566
499
  """
567
- if o.ABSTRACT_SOLVER in self.options or o.SYMBOLIC not in self.options:
568
- extra_constraints = kwargs.pop("extra_constraints", ())
569
- for e in extra_constraints:
570
- if self.solver.is_false(e):
571
- return False
572
-
573
- return self._satisfiable
574
500
  return self.solver.satisfiable(**kwargs)
575
501
 
576
502
  def downsize(self):
@@ -975,5 +901,3 @@ default_state_plugin_preset = PluginPreset()
975
901
  SimState.register_preset("default", default_state_plugin_preset)
976
902
 
977
903
  from .state_plugins.history import SimStateHistory
978
- from .state_plugins.inspect import BP_AFTER, BP_BEFORE
979
- from .state_plugins.sim_action import SimActionConstraint
@@ -1,4 +1,5 @@
1
1
  from __future__ import annotations
2
+
2
3
  import functools
3
4
  import time
4
5
  import logging
@@ -10,8 +11,10 @@ import claripy
10
11
  from angr import sim_options as o
11
12
  from angr.errors import SimValueError, SimUnsatError, SimSolverModeError, SimSolverOptionError
12
13
  from angr.sim_state import SimState
14
+ from .inspect import BP_AFTER, BP_BEFORE
13
15
  from .plugin import SimStatePlugin
14
16
  from .sim_action_object import ast_stripping_decorator, SimActionObject
17
+ from .sim_action import SimActionConstraint
15
18
 
16
19
  l = logging.getLogger(name=__name__)
17
20
 
@@ -407,26 +410,18 @@ class SimSolver(SimStatePlugin):
407
410
  if key is not None and eternal and key in self.eternal_tracked_variables:
408
411
  r = self.eternal_tracked_variables[key]
409
412
  # pylint: disable=too-many-boolean-expressions
410
- if (
411
- size != r.length
412
- or min != r.args[1]
413
- or max != r.args[2]
414
- or stride != r.args[3]
415
- or uninitialized != r.uninitialized
416
- or bool(explicit_name) ^ (r.args[0] == name)
417
- ):
413
+ if size != r.length or uninitialized != r.uninitialized or bool(explicit_name) ^ (r.args[0] == name):
418
414
  l.warning("Variable %s being retrieved with different settings than it was tracked with", name)
419
415
  else:
420
416
  r = claripy.BVS(
421
417
  name,
422
418
  size,
423
- min=min,
424
- max=max,
425
- stride=stride,
426
419
  uninitialized=uninitialized,
427
420
  explicit_name=explicit_name,
428
421
  **kwargs,
429
422
  )
423
+ if any(x is not None for x in (min, max, stride)):
424
+ r = r.annotate(claripy.annotation.StridedIntervalAnnotation(stride, min, max))
430
425
  if key is not None:
431
426
  self.register_variable(r, key, eternal)
432
427
 
@@ -692,6 +687,9 @@ class SimSolver(SimStatePlugin):
692
687
 
693
688
  :return: True if sat, otherwise false
694
689
  """
690
+ if o.ABSTRACT_SOLVER in self.state.options or o.SYMBOLIC not in self.state.options:
691
+ return all(not self.is_false(e) for e in extra_constraints)
692
+
695
693
  if exact is False and o.VALIDATE_APPROXIMATIONS in self.state.options:
696
694
  er = self._solver.satisfiable(extra_constraints=self._adjust_constraint_list(extra_constraints))
697
695
  ar = self._solver.satisfiable(
@@ -711,8 +709,69 @@ class SimSolver(SimStatePlugin):
711
709
 
712
710
  :param constraints: Pass any constraints that you want to add (ASTs) as varargs.
713
711
  """
714
- cc = self._adjust_constraint_list(constraints)
715
- return self._solver.add(cc)
712
+ if len(constraints) > 0 and isinstance(constraints[0], (list, tuple)):
713
+ raise Exception("Tuple or list passed to add!")
714
+
715
+ if o.TRACK_CONSTRAINTS in self.state.options and len(constraints) > 0:
716
+ constraints = (
717
+ [self.simplify(a) for a in constraints] if o.SIMPLIFY_CONSTRAINTS in self.state.options else constraints
718
+ )
719
+
720
+ self.state._inspect("constraints", BP_BEFORE, added_constraints=constraints)
721
+ constraints = self.state._inspect_getattr("added_constraints", constraints)
722
+ cc = self._adjust_constraint_list(constraints)
723
+ added = self._solver.add(cc)
724
+ self.state._inspect("constraints", BP_AFTER)
725
+
726
+ # add actions for the added constraints
727
+ if o.TRACK_CONSTRAINT_ACTIONS in self.state.options:
728
+ for c in added:
729
+ sac = SimActionConstraint(self.state, c)
730
+ self.state.history.add_action(sac)
731
+
732
+ if o.ABSTRACT_SOLVER in self.state.options and len(constraints) > 0:
733
+ for arg in constraints:
734
+ if self.is_false(arg):
735
+ return
736
+
737
+ if self.is_true(arg):
738
+ continue
739
+
740
+ # It's neither True or False. Let's try to apply the condition
741
+
742
+ # We take the argument, extract a list of constrained SIs out of
743
+ # it (if we could, of course), and then replace each original SI
744
+ # the intersection of original SI and the constrained one.
745
+
746
+ _, converted = claripy.constraint_to_si(arg)
747
+
748
+ for original_expr, constrained_si in converted:
749
+ if not original_expr.variables:
750
+ l.error(
751
+ "Incorrect original_expression to replace in add(). "
752
+ "This is due to defects in VSA logics inside claripy. "
753
+ "Please report to Fish and he will fix it if he's free."
754
+ )
755
+ continue
756
+
757
+ new_expr = constrained_si
758
+ self.state.registers.replace_all(original_expr, new_expr)
759
+ self.state.memory.replace_all(original_expr, new_expr)
760
+ # tmps
761
+ temps = self.state.scratch.temps
762
+ for idx in range(len(temps)): # pylint:disable=consider-using-enumerate
763
+ t = temps[idx]
764
+ if t is None:
765
+ continue
766
+ if t.variables.intersection(original_expr.variables):
767
+ # replace
768
+ temps[idx] = claripy.replace(t, original_expr, new_expr)
769
+
770
+ l.debug("SimSolver.add: Applied to final state.")
771
+ elif o.SYMBOLIC not in self.state.options and len(constraints) > 0:
772
+ for arg in constraints:
773
+ if self.is_false(arg):
774
+ return
716
775
 
717
776
  #
718
777
  # And some convenience stuff
@@ -1063,5 +1122,3 @@ class SimSolver(SimStatePlugin):
1063
1122
 
1064
1123
 
1065
1124
  SimState.register_default("solver", SimSolver)
1066
-
1067
- from .inspect import BP_AFTER
angr/storage/__init__.py CHANGED
@@ -4,13 +4,12 @@ DUMMY_SYMBOLIC_READ_VALUE = 0xC0DEB4BE
4
4
 
5
5
  from .file import SimFile
6
6
  from .memory_object import SimMemoryObject
7
- from .memory_mixins import MemoryMixin, DefaultMemory
7
+ from .memory_mixins import DefaultMemory
8
8
 
9
9
 
10
10
  __all__ = (
11
11
  "DUMMY_SYMBOLIC_READ_VALUE",
12
12
  "SimFile",
13
13
  "SimMemoryObject",
14
- "MemoryMixin",
15
14
  "DefaultMemory",
16
15
  )