lief 0.16.5__cp313-cp313-musllinux_1_2_aarch64.whl → 0.17.0__cp313-cp313-musllinux_1_2_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 lief might be problematic. Click here for more details.

@@ -1,12 +1,16 @@
1
1
  from typing import Iterator, Optional, Union
2
2
 
3
- import lief
3
+ import lief.assembly.x86
4
4
 
5
5
 
6
6
  class Immediate(lief.assembly.x86.Operand):
7
7
  @property
8
8
  def value(self) -> int: ...
9
9
 
10
+ class Register(lief.assembly.x86.Operand):
11
+ @property
12
+ def value(self) -> lief.assembly.x86.REG: ...
13
+
10
14
  class Memory(lief.assembly.x86.Operand):
11
15
  @property
12
16
  def base(self) -> lief.assembly.x86.REG: ...
@@ -26,7 +30,3 @@ class Memory(lief.assembly.x86.Operand):
26
30
  class PCRelative(lief.assembly.x86.Operand):
27
31
  @property
28
32
  def value(self) -> int: ...
29
-
30
- class Register(lief.assembly.x86.Operand):
31
- @property
32
- def value(self) -> lief.assembly.x86.REG: ...
lief/dsc/__init__.pyi CHANGED
@@ -4,8 +4,16 @@ import os
4
4
  from typing import Iterator, Optional, Union, overload
5
5
 
6
6
  import lief
7
+ import lief.MachO
8
+ import lief.assembly
7
9
 
8
10
 
11
+ @overload
12
+ def enable_cache() -> bool: ...
13
+
14
+ @overload
15
+ def enable_cache(target_cache_dir: Union[str | os.PathLike]) -> bool: ...
16
+
9
17
  class DyldSharedCache:
10
18
  class VERSION(enum.Enum):
11
19
  UNKNOWN = 0
@@ -26,7 +34,11 @@ class DyldSharedCache:
26
34
 
27
35
  DYLD_1042_1 = 8
28
36
 
29
- UNRELEASED = 9
37
+ DYLD_1231_3 = 9
38
+
39
+ DYLD_1284_13 = 10
40
+
41
+ UNRELEASED = 11
30
42
 
31
43
  class PLATFORM(enum.Enum):
32
44
  UNKNOWN = 0
@@ -142,6 +154,12 @@ class DyldSharedCache:
142
154
 
143
155
  def flush_cache(self) -> None: ...
144
156
 
157
+ @overload
158
+ def load(files: Sequence[str]) -> Optional[DyldSharedCache]: ...
159
+
160
+ @overload
161
+ def load(path: Union[str | os.PathLike], arch: str = '') -> Optional[DyldSharedCache]: ...
162
+
145
163
  class Dylib:
146
164
  class extract_opt_t:
147
165
  def __init__(self) -> None: ...
@@ -175,46 +193,34 @@ class Dylib:
175
193
 
176
194
  def get(self, opt: Dylib.extract_opt_t = ...) -> Optional[lief.MachO.Binary]: ...
177
195
 
178
- class MappingInfo:
196
+ class SubCache:
179
197
  @property
180
- def address(self) -> int: ...
198
+ def uuid(self) -> list[int]: ...
181
199
 
182
200
  @property
183
- def size(self) -> int: ...
201
+ def vm_offset(self) -> int: ...
184
202
 
185
203
  @property
186
- def end_address(self) -> int: ...
204
+ def suffix(self) -> str: ...
187
205
 
188
206
  @property
189
- def file_offset(self) -> int: ...
207
+ def cache(self) -> Optional[DyldSharedCache]: ...
190
208
 
209
+ class MappingInfo:
191
210
  @property
192
- def max_prot(self) -> int: ...
211
+ def address(self) -> int: ...
193
212
 
194
213
  @property
195
- def init_prot(self) -> int: ...
214
+ def size(self) -> int: ...
196
215
 
197
- class SubCache:
198
216
  @property
199
- def uuid(self) -> list[int]: ...
217
+ def end_address(self) -> int: ...
200
218
 
201
219
  @property
202
- def vm_offset(self) -> int: ...
220
+ def file_offset(self) -> int: ...
203
221
 
204
222
  @property
205
- def suffix(self) -> str: ...
223
+ def max_prot(self) -> int: ...
206
224
 
207
225
  @property
208
- def cache(self) -> Optional[DyldSharedCache]: ...
209
-
210
- @overload
211
- def enable_cache() -> bool: ...
212
-
213
- @overload
214
- def enable_cache(target_cache_dir: str) -> bool: ...
215
-
216
- @overload
217
- def load(files: Sequence[str]) -> Optional[DyldSharedCache]: ...
218
-
219
- @overload
220
- def load(path: os.PathLike, arch: str = '') -> Optional[DyldSharedCache]: ...
226
+ def init_prot(self) -> int: ...
lief/dwarf/__init__.pyi CHANGED
@@ -1,113 +1,147 @@
1
1
  import enum
2
+ import os
2
3
  from typing import Iterator, Optional, Union, overload
3
4
 
4
- from . import parameters as parameters, types as types
5
+ from . import (
6
+ editor as editor,
7
+ parameters as parameters,
8
+ types as types
9
+ )
5
10
  import lief
11
+ import lief.assembly
6
12
 
7
13
 
8
- class CompilationUnit:
9
- class Language:
10
- class LANG(enum.Enum):
11
- @staticmethod
12
- def from_value(arg: int, /) -> CompilationUnit.Language.LANG: ...
14
+ def load(path: Union[str | os.PathLike]) -> Optional[DebugInfo]: ...
13
15
 
14
- def __eq__(self, arg, /) -> bool: ...
16
+ class Scope:
17
+ class TYPE(enum.Enum):
18
+ UNKNOWN = 0
15
19
 
16
- def __ne__(self, arg, /) -> bool: ...
20
+ UNION = 1
17
21
 
18
- def __int__(self) -> int: ...
22
+ CLASS = 2
19
23
 
20
- UNKNOWN = 0
24
+ STRUCT = 3
21
25
 
22
- C = 1
26
+ NAMESPACE = 4
23
27
 
24
- CPP = 2
28
+ FUNCTION = 5
25
29
 
26
- RUST = 3
30
+ COMPILATION_UNIT = 6
27
31
 
28
- DART = 4
32
+ @property
33
+ def name(self) -> str: ...
29
34
 
30
- MODULA = 5
35
+ @property
36
+ def parent(self) -> Optional[Scope]: ...
31
37
 
32
- FORTRAN = 6
38
+ @property
39
+ def type(self) -> Scope.TYPE: ...
33
40
 
34
- SWIFT = 7
41
+ def chained(self, sep: str = '::') -> str: ...
35
42
 
36
- D = 8
43
+ class Type:
44
+ class KIND(enum.Enum):
45
+ UNKNOWN = 0
37
46
 
38
- JAVA = 9
47
+ UNSPECIFIED = 1
39
48
 
40
- COBOL = 10
49
+ BASE = 2
41
50
 
42
- lang: lief.dwarf.CompilationUnit.Language.LANG
51
+ CONST_KIND = 3
43
52
 
44
- version: int
53
+ CLASS = 4
45
54
 
46
- @property
47
- def name(self) -> str: ...
55
+ ARRAY = 5
48
56
 
49
- @property
50
- def producer(self) -> str: ...
57
+ POINTER = 6
51
58
 
52
- @property
53
- def compilation_dir(self) -> str: ...
59
+ STRUCT = 7
54
60
 
55
- @property
56
- def language(self) -> CompilationUnit.Language: ...
61
+ UNION = 8
57
62
 
58
- @property
59
- def low_address(self) -> int: ...
63
+ TYPEDEF = 9
60
64
 
61
- @property
62
- def high_address(self) -> int: ...
65
+ REF = 10
63
66
 
64
- @property
65
- def size(self) -> int: ...
67
+ SET_TYPE = 11
66
68
 
67
- @property
68
- def ranges(self) -> list[lief.range_t]: ...
69
+ STRING = 12
69
70
 
70
- @overload
71
- def find_function(self, name: str) -> Optional[Function]: ...
71
+ SUBROUTINE = 13
72
72
 
73
- @overload
74
- def find_function(self, addr: int) -> Optional[Function]: ...
73
+ POINTER_MEMBER = 14
75
74
 
76
- @overload
77
- def find_variable(self, addr: int) -> Optional[Variable]: ...
75
+ PACKED = 15
78
76
 
79
- @overload
80
- def find_variable(self, name: str) -> Optional[Variable]: ...
77
+ FILE = 16
78
+
79
+ THROWN = 17
80
+
81
+ VOLATILE = 18
82
+
83
+ RESTRICT = 19
84
+
85
+ INTERFACE = 20
86
+
87
+ SHARED = 21
88
+
89
+ RVALREF = 22
90
+
91
+ TEMPLATE_ALIAS = 23
92
+
93
+ COARRAY = 24
94
+
95
+ DYNAMIC = 25
96
+
97
+ ATOMIC = 26
98
+
99
+ IMMUTABLE = 27
100
+
101
+ ENUM = 28
81
102
 
82
103
  @property
83
- def types(self) -> Iterator[Optional[Type]]: ...
104
+ def kind(self) -> Type.KIND: ...
84
105
 
85
106
  @property
86
- def functions(self) -> Iterator[Optional[Function]]: ...
107
+ def name(self) -> Optional[str]: ...
87
108
 
88
109
  @property
89
- def imported_functions(self) -> Iterator[Optional[Function]]: ...
110
+ def size(self) -> Optional[int]: ...
90
111
 
91
112
  @property
92
- def variables(self) -> Iterator[Optional[Variable]]: ...
113
+ def location(self) -> lief.debug_location_t: ...
93
114
 
94
- class DebugInfo(lief.DebugInfo):
95
- @overload
96
- def find_function(self, name: str) -> Optional[Function]: ...
115
+ @property
116
+ def is_unspecified(self) -> bool: ...
97
117
 
98
- @overload
99
- def find_function(self, addr: int) -> Optional[Function]: ...
118
+ @property
119
+ def scope(self) -> Optional[Scope]: ...
100
120
 
101
- @overload
102
- def find_variable(self, addr: int) -> Optional[Variable]: ...
121
+ class Variable:
122
+ @property
123
+ def name(self) -> str: ...
103
124
 
104
- @overload
105
- def find_variable(self, name: str) -> Optional[Variable]: ...
125
+ @property
126
+ def linkage_name(self) -> str: ...
106
127
 
107
- def find_type(self, name: str) -> Optional[Type]: ...
128
+ @property
129
+ def address(self) -> Optional[int]: ...
108
130
 
109
131
  @property
110
- def compilation_units(self) -> Iterator[Optional[CompilationUnit]]: ...
132
+ def size(self) -> Optional[int]: ...
133
+
134
+ @property
135
+ def is_constexpr(self) -> bool: ...
136
+
137
+ @property
138
+ def debug_location(self) -> lief.debug_location_t: ...
139
+
140
+ @property
141
+ def type(self) -> Optional[Type]: ...
142
+
143
+ @property
144
+ def scope(self) -> Optional[Scope]: ...
111
145
 
112
146
  class Function:
113
147
  @property
@@ -159,134 +193,114 @@ class Parameter:
159
193
  @property
160
194
  def type(self) -> Optional[Type]: ...
161
195
 
162
- class Scope:
163
- class TYPE(enum.Enum):
164
- UNKNOWN = 0
165
-
166
- UNION = 1
167
-
168
- CLASS = 2
169
-
170
- STRUCT = 3
171
-
172
- NAMESPACE = 4
173
-
174
- FUNCTION = 5
175
-
176
- COMPILATION_UNIT = 6
177
-
178
- @property
179
- def name(self) -> str: ...
180
-
181
- @property
182
- def parent(self) -> Optional[Scope]: ...
183
-
184
- @property
185
- def type(self) -> Scope.TYPE: ...
186
-
187
- def chained(self, sep: str = '::') -> str: ...
188
-
189
- class Type:
190
- class KIND(enum.Enum):
191
- UNKNOWN = 0
192
-
193
- UNSPECIFIED = 1
194
-
195
- BASE = 2
196
+ class CompilationUnit:
197
+ class Language:
198
+ class LANG(enum.Enum):
199
+ @staticmethod
200
+ def from_value(arg: int, /) -> CompilationUnit.Language.LANG: ...
196
201
 
197
- CONST_KIND = 3
202
+ def __eq__(self, arg, /) -> bool: ...
198
203
 
199
- CLASS = 4
204
+ def __ne__(self, arg, /) -> bool: ...
200
205
 
201
- ARRAY = 5
206
+ def __int__(self) -> int: ...
202
207
 
203
- POINTER = 6
208
+ UNKNOWN = 0
204
209
 
205
- STRUCT = 7
210
+ C = 1
206
211
 
207
- UNION = 8
212
+ CPP = 2
208
213
 
209
- TYPEDEF = 9
214
+ RUST = 3
210
215
 
211
- REF = 10
216
+ DART = 4
212
217
 
213
- SET_TYPE = 11
218
+ MODULA = 5
214
219
 
215
- STRING = 12
220
+ FORTRAN = 6
216
221
 
217
- SUBROUTINE = 13
222
+ SWIFT = 7
218
223
 
219
- POINTER_MEMBER = 14
224
+ D = 8
220
225
 
221
- PACKED = 15
226
+ JAVA = 9
222
227
 
223
- FILE = 16
228
+ COBOL = 10
224
229
 
225
- THROWN = 17
230
+ lang: CompilationUnit.Language.LANG
226
231
 
227
- VOLATILE = 18
232
+ version: int
228
233
 
229
- RESTRICT = 19
234
+ @property
235
+ def name(self) -> str: ...
230
236
 
231
- INTERFACE = 20
237
+ @property
238
+ def producer(self) -> str: ...
232
239
 
233
- SHARED = 21
240
+ @property
241
+ def compilation_dir(self) -> str: ...
234
242
 
235
- RVALREF = 22
243
+ @property
244
+ def language(self) -> CompilationUnit.Language: ...
236
245
 
237
- TEMPLATE_ALIAS = 23
246
+ @property
247
+ def low_address(self) -> int: ...
238
248
 
239
- COARRAY = 24
249
+ @property
250
+ def high_address(self) -> int: ...
240
251
 
241
- DYNAMIC = 25
252
+ @property
253
+ def size(self) -> int: ...
242
254
 
243
- ATOMIC = 26
255
+ @property
256
+ def ranges(self) -> list[lief.range_t]: ...
244
257
 
245
- IMMUTABLE = 27
258
+ @overload
259
+ def find_function(self, name: str) -> Optional[Function]: ...
246
260
 
247
- ENUM = 28
261
+ @overload
262
+ def find_function(self, addr: int) -> Optional[Function]: ...
248
263
 
249
- @property
250
- def kind(self) -> Type.KIND: ...
264
+ @overload
265
+ def find_variable(self, addr: int) -> Optional[Variable]: ...
251
266
 
252
- @property
253
- def name(self) -> Optional[str]: ...
267
+ @overload
268
+ def find_variable(self, name: str) -> Optional[Variable]: ...
254
269
 
255
270
  @property
256
- def size(self) -> Optional[int]: ...
271
+ def types(self) -> Iterator[Optional[Type]]: ...
257
272
 
258
273
  @property
259
- def location(self) -> lief.debug_location_t: ...
274
+ def functions(self) -> Iterator[Optional[Function]]: ...
260
275
 
261
276
  @property
262
- def is_unspecified(self) -> bool: ...
277
+ def imported_functions(self) -> Iterator[Optional[Function]]: ...
263
278
 
264
279
  @property
265
- def scope(self) -> Optional[Scope]: ...
280
+ def variables(self) -> Iterator[Optional[Variable]]: ...
266
281
 
267
- class Variable:
268
- @property
269
- def name(self) -> str: ...
282
+ class DebugInfo(lief.DebugInfo):
283
+ @overload
284
+ def find_function(self, name: str) -> Optional[Function]: ...
270
285
 
271
- @property
272
- def linkage_name(self) -> str: ...
286
+ @overload
287
+ def find_function(self, addr: int) -> Optional[Function]: ...
273
288
 
274
- @property
275
- def address(self) -> Optional[int]: ...
289
+ @overload
290
+ def find_variable(self, addr: int) -> Optional[Variable]: ...
276
291
 
277
- @property
278
- def size(self) -> Optional[int]: ...
292
+ @overload
293
+ def find_variable(self, name: str) -> Optional[Variable]: ...
279
294
 
280
- @property
281
- def is_constexpr(self) -> bool: ...
295
+ def find_type(self, name: str) -> Optional[Type]: ...
282
296
 
283
297
  @property
284
- def debug_location(self) -> lief.debug_location_t: ...
298
+ def compilation_units(self) -> Iterator[Optional[CompilationUnit]]: ...
285
299
 
286
- @property
287
- def type(self) -> Optional[Type]: ...
300
+ class Editor:
301
+ @staticmethod
302
+ def from_binary(bin: lief.Binary) -> Optional[Editor]: ...
288
303
 
289
- @property
290
- def scope(self) -> Optional[Scope]: ...
304
+ def create_compilation_unit(self) -> Optional[editor.CompilationUnit]: ...
291
305
 
292
- def load(path: str) -> Optional[DebugInfo]: ...
306
+ def write(self, output: Union[str | os.PathLike]) -> None: ...
@@ -0,0 +1,138 @@
1
+ from collections.abc import Sequence
2
+ import enum
3
+ from typing import Iterator, Optional, Union, overload
4
+
5
+
6
+ class Type:
7
+ def pointer_to(self) -> Optional[PointerType]: ...
8
+
9
+ class PointerType(Type):
10
+ pass
11
+
12
+ class EnumType(Type):
13
+ class Value:
14
+ pass
15
+
16
+ def set_size(self, size: int) -> EnumType: ...
17
+
18
+ def add_value(self, name: str, value: int) -> Optional[EnumType.Value]: ...
19
+
20
+ class BaseType(Type):
21
+ class ENCODING(enum.Enum):
22
+ NONE = 0
23
+
24
+ ADDRESS = 1
25
+
26
+ SIGNED = 2
27
+
28
+ SIGNED_CHAR = 3
29
+
30
+ UNSIGNED = 4
31
+
32
+ UNSIGNED_CHAR = 5
33
+
34
+ BOOLEAN = 6
35
+
36
+ FLOAT = 7
37
+
38
+ class ArrayType(Type):
39
+ pass
40
+
41
+ class FunctionType(Type):
42
+ class Parameter:
43
+ pass
44
+
45
+ def set_return_type(self, type: Type) -> FunctionType: ...
46
+
47
+ def add_parameter(self, type: Type) -> Optional[FunctionType.Parameter]: ...
48
+
49
+ class TypeDef(Type):
50
+ pass
51
+
52
+ class StructType(Type):
53
+ class TYPE(enum.Enum):
54
+ CLASS = 0
55
+
56
+ STRUCT = 1
57
+
58
+ UNION = 2
59
+
60
+ class Member:
61
+ pass
62
+
63
+ def set_size(self, size: int) -> StructType: ...
64
+
65
+ def add_member(self, name: str, type: Type, offset: int = -1) -> Optional[StructType.Member]: ...
66
+
67
+ class Function:
68
+ class range_t:
69
+ @overload
70
+ def __init__(self) -> None: ...
71
+
72
+ @overload
73
+ def __init__(self, start: int, end: int) -> None: ...
74
+
75
+ start: int
76
+
77
+ end: int
78
+
79
+ class Parameter:
80
+ pass
81
+
82
+ class LexicalBlock:
83
+ pass
84
+
85
+ class Label:
86
+ pass
87
+
88
+ def set_address(self, addr: int) -> Function: ...
89
+
90
+ def set_low_high(self, low: int, high: int) -> Function: ...
91
+
92
+ def set_ranges(self, ranges: Sequence[Function.range_t]) -> Function: ...
93
+
94
+ def set_external(self) -> Function: ...
95
+
96
+ def set_return_type(self, type: Type) -> Function: ...
97
+
98
+ def add_parameter(self, name: str, type: Type) -> Optional[Function.Parameter]: ...
99
+
100
+ def create_stack_variable(self, name: str) -> Optional[Variable]: ...
101
+
102
+ def add_lexical_block(self, start: int, end: int) -> Optional[Function.LexicalBlock]: ...
103
+
104
+ def add_label(self, addr: int, label: str) -> Optional[Function.Label]: ...
105
+
106
+ class Variable:
107
+ def set_addr(self, addr: int) -> Variable: ...
108
+
109
+ def set_stack_offset(self, offset: int) -> Variable: ...
110
+
111
+ def set_external(self) -> Variable: ...
112
+
113
+ def set_type(self, type: Type) -> Variable: ...
114
+
115
+ class CompilationUnit:
116
+ def set_producer(self, arg: str, /) -> CompilationUnit: ...
117
+
118
+ def create_function(self, name: str) -> Optional[Function]: ...
119
+
120
+ def create_variable(self, name: str) -> Optional[Variable]: ...
121
+
122
+ def create_generic_type(self, name: str) -> Optional[Type]: ...
123
+
124
+ def create_enum(self, name: str) -> Optional[EnumType]: ...
125
+
126
+ def create_typedef(self, name: str, ty: Type) -> Optional[TypeDef]: ...
127
+
128
+ def create_structure(self, name: str, kind: StructType.TYPE = StructType.TYPE.STRUCT) -> Optional[StructType]: ...
129
+
130
+ def create_base_type(self, name: str, size: int, encoding: BaseType.ENCODING = BaseType.ENCODING.NONE) -> Optional[BaseType]: ...
131
+
132
+ def create_function_type(self, name: str) -> Optional[FunctionType]: ...
133
+
134
+ def create_pointer_type(self, ty: Type) -> Optional[PointerType]: ...
135
+
136
+ def create_void_type(self) -> Optional[Type]: ...
137
+
138
+ def create_array(self, name: str, ty: Type, count: int) -> Optional[ArrayType]: ...
@@ -1,14 +1,14 @@
1
1
  from typing import Iterator, Optional, Union
2
2
 
3
- import lief
3
+ import lief.dwarf
4
4
 
5
5
 
6
6
  class Formal(lief.dwarf.Parameter):
7
7
  @property
8
8
  def type(self) -> Optional[lief.dwarf.Type]: ...
9
9
 
10
- class TemplateType(lief.dwarf.Parameter):
10
+ class TemplateValue(lief.dwarf.Parameter):
11
11
  pass
12
12
 
13
- class TemplateValue(lief.dwarf.Parameter):
13
+ class TemplateType(lief.dwarf.Parameter):
14
14
  pass