lief 0.15.1__cp313-cp313-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 lief might be problematic. Click here for more details.
- lief/ART.pyi +81 -0
- lief/Android.pyi +29 -0
- lief/DEX.pyi +382 -0
- lief/ELF.pyi +3179 -0
- lief/MachO.pyi +1717 -0
- lief/OAT.pyi +271 -0
- lief/PE.pyi +2951 -0
- lief/VDEX.pyi +49 -0
- lief/__init__.py +13 -0
- lief/__init__.pyi +428 -0
- lief/_lief.so +0 -0
- lief/dwarf/__init__.pyi +193 -0
- lief/dwarf/types.pyi +72 -0
- lief/logging.pyi +27 -0
- lief/objc.pyi +68 -0
- lief/pdb/__init__.pyi +86 -0
- lief/pdb/types.pyi +68 -0
- lief/py.typed +0 -0
- lief-0.15.1.dist-info/METADATA +157 -0
- lief-0.15.1.dist-info/RECORD +21 -0
- lief-0.15.1.dist-info/WHEEL +5 -0
lief/VDEX.pyi
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Optional, Union
|
|
2
|
+
|
|
3
|
+
from typing import overload
|
|
4
|
+
import io
|
|
5
|
+
import lief.Android # type: ignore
|
|
6
|
+
import lief.DEX # type: ignore
|
|
7
|
+
import lief.OAT.Binary # type: ignore
|
|
8
|
+
import lief.VDEX # type: ignore
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
class File(lief.Object):
|
|
12
|
+
class it_dex_files:
|
|
13
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
14
|
+
def __getitem__(self, arg: int, /) -> lief.DEX.File: ...
|
|
15
|
+
def __iter__(self) -> lief.OAT.Binary.it_dex_files: ...
|
|
16
|
+
def __len__(self) -> int: ...
|
|
17
|
+
def __next__(self) -> lief.DEX.File: ...
|
|
18
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
19
|
+
@property
|
|
20
|
+
def dex2dex_json_info(self) -> str: ...
|
|
21
|
+
@property
|
|
22
|
+
def dex_files(self) -> lief.OAT.Binary.it_dex_files: ...
|
|
23
|
+
@property
|
|
24
|
+
def header(self) -> lief.VDEX.Header: ...
|
|
25
|
+
|
|
26
|
+
class Header(lief.Object):
|
|
27
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
28
|
+
@property
|
|
29
|
+
def dex_size(self) -> int: ...
|
|
30
|
+
@property
|
|
31
|
+
def magic(self) -> list[int]: ...
|
|
32
|
+
@property
|
|
33
|
+
def nb_dex_files(self) -> int: ...
|
|
34
|
+
@property
|
|
35
|
+
def quickening_info_size(self) -> int: ...
|
|
36
|
+
@property
|
|
37
|
+
def verifier_deps_size(self) -> int: ...
|
|
38
|
+
@property
|
|
39
|
+
def version(self) -> int: ...
|
|
40
|
+
|
|
41
|
+
def android_version(vdex_version: int) -> lief.Android.ANDROID_VERSIONS: ...
|
|
42
|
+
@overload
|
|
43
|
+
def parse(filename: str) -> Optional[lief.VDEX.File]: ...
|
|
44
|
+
@overload
|
|
45
|
+
def parse(obj: Union[io.IOBase|os.PathLike], name: str = ...) -> Optional[lief.VDEX.File]: ...
|
|
46
|
+
@overload
|
|
47
|
+
def version(file: str) -> int: ...
|
|
48
|
+
@overload
|
|
49
|
+
def version(raw: list[int]) -> int: ...
|
lief/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import traceback
|
|
4
|
+
if len(__path__) > 0 and __path__[0] not in sys.path:
|
|
5
|
+
from . import _lief
|
|
6
|
+
from ._lief import *
|
|
7
|
+
from ._lief import __version__, __tag__, __commit__, __is_tagged__, __extended__
|
|
8
|
+
|
|
9
|
+
# cf. https://github.com/pytorch/pytorch/blob/60a3b7425dde97fe8b46183c154a9c3b24f0c733/torch/__init__.py#L467-L470
|
|
10
|
+
for attr in dir(_lief):
|
|
11
|
+
candidate = getattr(_lief, attr)
|
|
12
|
+
if type(candidate) is type(_lief):
|
|
13
|
+
sys.modules.setdefault(f"lief.{attr}", candidate)
|
lief/__init__.pyi
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
from typing import Any, ClassVar, Optional, Union
|
|
2
|
+
|
|
3
|
+
from . import ART, Android, DEX, ELF, MachO, OAT, PE, VDEX, dwarf, logging, objc, pdb # type: ignore
|
|
4
|
+
from typing import overload
|
|
5
|
+
import io
|
|
6
|
+
import lief # type: ignore
|
|
7
|
+
import lief.Binary # type: ignore
|
|
8
|
+
import lief.DebugInfo # type: ignore
|
|
9
|
+
import lief.ELF # type: ignore
|
|
10
|
+
import lief.Function # type: ignore
|
|
11
|
+
import lief.MachO # type: ignore
|
|
12
|
+
import lief.PE # type: ignore
|
|
13
|
+
import lief.logging # type: ignore
|
|
14
|
+
import os
|
|
15
|
+
|
|
16
|
+
class ARCHITECTURES:
|
|
17
|
+
ARM: ClassVar[ARCHITECTURES] = ...
|
|
18
|
+
ARM64: ClassVar[ARCHITECTURES] = ...
|
|
19
|
+
INTEL: ClassVar[ARCHITECTURES] = ...
|
|
20
|
+
LOONGARCH: ClassVar[ARCHITECTURES] = ...
|
|
21
|
+
MIPS: ClassVar[ARCHITECTURES] = ...
|
|
22
|
+
NONE: ClassVar[ARCHITECTURES] = ...
|
|
23
|
+
PPC: ClassVar[ARCHITECTURES] = ...
|
|
24
|
+
RISCV: ClassVar[ARCHITECTURES] = ...
|
|
25
|
+
SPARC: ClassVar[ARCHITECTURES] = ...
|
|
26
|
+
SYSZ: ClassVar[ARCHITECTURES] = ...
|
|
27
|
+
X86: ClassVar[ARCHITECTURES] = ...
|
|
28
|
+
XCORE: ClassVar[ARCHITECTURES] = ...
|
|
29
|
+
__name__: str
|
|
30
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
31
|
+
@staticmethod
|
|
32
|
+
def from_value(arg: int, /) -> lief.ARCHITECTURES: ...
|
|
33
|
+
def __ge__(self, other) -> bool: ...
|
|
34
|
+
def __gt__(self, other) -> bool: ...
|
|
35
|
+
def __hash__(self) -> int: ...
|
|
36
|
+
def __index__(self) -> Any: ...
|
|
37
|
+
def __int__(self) -> int: ...
|
|
38
|
+
def __le__(self, other) -> bool: ...
|
|
39
|
+
def __lt__(self, other) -> bool: ...
|
|
40
|
+
@property
|
|
41
|
+
def value(self) -> int: ...
|
|
42
|
+
|
|
43
|
+
class Binary(Object):
|
|
44
|
+
class FORMATS:
|
|
45
|
+
ELF: ClassVar[Binary.FORMATS] = ...
|
|
46
|
+
MACHO: ClassVar[Binary.FORMATS] = ...
|
|
47
|
+
OAT: ClassVar[Binary.FORMATS] = ...
|
|
48
|
+
PE: ClassVar[Binary.FORMATS] = ...
|
|
49
|
+
UNKNOWN: ClassVar[Binary.FORMATS] = ...
|
|
50
|
+
__name__: str
|
|
51
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
52
|
+
def __ge__(self, other) -> bool: ...
|
|
53
|
+
def __gt__(self, other) -> bool: ...
|
|
54
|
+
def __hash__(self) -> int: ...
|
|
55
|
+
def __index__(self) -> Any: ...
|
|
56
|
+
def __int__(self) -> int: ...
|
|
57
|
+
def __le__(self, other) -> bool: ...
|
|
58
|
+
def __lt__(self, other) -> bool: ...
|
|
59
|
+
|
|
60
|
+
class VA_TYPES:
|
|
61
|
+
AUTO: ClassVar[Binary.VA_TYPES] = ...
|
|
62
|
+
RVA: ClassVar[Binary.VA_TYPES] = ...
|
|
63
|
+
VA: ClassVar[Binary.VA_TYPES] = ...
|
|
64
|
+
__name__: str
|
|
65
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
66
|
+
def __ge__(self, other) -> bool: ...
|
|
67
|
+
def __gt__(self, other) -> bool: ...
|
|
68
|
+
def __hash__(self) -> int: ...
|
|
69
|
+
def __index__(self) -> Any: ...
|
|
70
|
+
def __int__(self) -> int: ...
|
|
71
|
+
def __le__(self, other) -> bool: ...
|
|
72
|
+
def __lt__(self, other) -> bool: ...
|
|
73
|
+
|
|
74
|
+
class it_relocations:
|
|
75
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
76
|
+
def __getitem__(self, arg: int, /) -> lief.Relocation: ...
|
|
77
|
+
def __iter__(self) -> lief.Binary.it_relocations: ...
|
|
78
|
+
def __len__(self) -> int: ...
|
|
79
|
+
def __next__(self) -> lief.Relocation: ...
|
|
80
|
+
|
|
81
|
+
class it_sections:
|
|
82
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
83
|
+
def __getitem__(self, arg: int, /) -> lief.Section: ...
|
|
84
|
+
def __iter__(self) -> lief.Binary.it_sections: ...
|
|
85
|
+
def __len__(self) -> int: ...
|
|
86
|
+
def __next__(self) -> lief.Section: ...
|
|
87
|
+
|
|
88
|
+
class it_symbols:
|
|
89
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
90
|
+
def __getitem__(self, arg: int, /) -> lief.Symbol: ...
|
|
91
|
+
def __iter__(self) -> lief.Binary.it_symbols: ...
|
|
92
|
+
def __len__(self) -> int: ...
|
|
93
|
+
def __next__(self) -> lief.Symbol: ...
|
|
94
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
95
|
+
def get_content_from_virtual_address(self, virtual_address: int, size: int, va_type: lief.Binary.VA_TYPES = ...) -> memoryview: ...
|
|
96
|
+
def get_function_address(self, function_name: str) -> Union[int,lief.lief_errors]: ...
|
|
97
|
+
def get_symbol(self, symbol_name: str) -> lief.Symbol: ...
|
|
98
|
+
def has_symbol(self, symbol_name: str) -> bool: ...
|
|
99
|
+
def offset_to_virtual_address(self, offset: int, slide: int = ...) -> Union[int,lief.lief_errors]: ...
|
|
100
|
+
@overload
|
|
101
|
+
def patch_address(self, address: int, patch_value: list[int], va_type: lief.Binary.VA_TYPES = ...) -> None: ...
|
|
102
|
+
@overload
|
|
103
|
+
def patch_address(self, address: int, patch_value: int, size: int = ..., va_type: lief.Binary.VA_TYPES = ...) -> None: ...
|
|
104
|
+
def remove_section(self, name: str, clear: bool = ...) -> None: ...
|
|
105
|
+
def xref(self, virtual_address: int) -> list[int]: ...
|
|
106
|
+
@property
|
|
107
|
+
def abstract(self) -> lief.Binary: ...
|
|
108
|
+
@property
|
|
109
|
+
def concrete(self) -> lief.ELF.Binary | lief.PE.Binary | lief.MachO.Binary: ...
|
|
110
|
+
@property
|
|
111
|
+
def ctor_functions(self) -> list[lief.Function]: ...
|
|
112
|
+
@property
|
|
113
|
+
def debug_info(self) -> lief.DebugInfo: ...
|
|
114
|
+
@property
|
|
115
|
+
def entrypoint(self) -> int: ...
|
|
116
|
+
@property
|
|
117
|
+
def exported_functions(self) -> list[lief.Function]: ...
|
|
118
|
+
@property
|
|
119
|
+
def format(self) -> lief.Binary.FORMATS: ...
|
|
120
|
+
@property
|
|
121
|
+
def has_nx(self) -> bool: ...
|
|
122
|
+
@property
|
|
123
|
+
def header(self) -> lief.Header: ...
|
|
124
|
+
@property
|
|
125
|
+
def imagebase(self) -> int: ...
|
|
126
|
+
@property
|
|
127
|
+
def imported_functions(self) -> list[lief.Function]: ...
|
|
128
|
+
@property
|
|
129
|
+
def is_pie(self) -> bool: ...
|
|
130
|
+
@property
|
|
131
|
+
def libraries(self) -> list[Union[str,bytes]]: ...
|
|
132
|
+
@property
|
|
133
|
+
def original_size(self) -> int: ...
|
|
134
|
+
@property
|
|
135
|
+
def relocations(self) -> lief.Binary.it_relocations: ...
|
|
136
|
+
@property
|
|
137
|
+
def sections(self) -> lief.Binary.it_sections: ...
|
|
138
|
+
@property
|
|
139
|
+
def symbols(self) -> lief.Binary.it_symbols: ...
|
|
140
|
+
|
|
141
|
+
class DebugInfo:
|
|
142
|
+
class FORMAT:
|
|
143
|
+
DWARF: ClassVar[DebugInfo.FORMAT] = ...
|
|
144
|
+
PDB: ClassVar[DebugInfo.FORMAT] = ...
|
|
145
|
+
UNKNOWN: ClassVar[DebugInfo.FORMAT] = ...
|
|
146
|
+
__name__: str
|
|
147
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
148
|
+
@staticmethod
|
|
149
|
+
def from_value(arg: int, /) -> lief.DebugInfo.FORMAT: ...
|
|
150
|
+
def __ge__(self, other) -> bool: ...
|
|
151
|
+
def __gt__(self, other) -> bool: ...
|
|
152
|
+
def __hash__(self) -> int: ...
|
|
153
|
+
def __index__(self) -> Any: ...
|
|
154
|
+
def __int__(self) -> int: ...
|
|
155
|
+
def __le__(self, other) -> bool: ...
|
|
156
|
+
def __lt__(self, other) -> bool: ...
|
|
157
|
+
@property
|
|
158
|
+
def value(self) -> int: ...
|
|
159
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
160
|
+
@property
|
|
161
|
+
def format(self) -> lief.DebugInfo.FORMAT: ...
|
|
162
|
+
|
|
163
|
+
class ENDIANNESS:
|
|
164
|
+
BIG: ClassVar[ENDIANNESS] = ...
|
|
165
|
+
LITTLE: ClassVar[ENDIANNESS] = ...
|
|
166
|
+
NONE: ClassVar[ENDIANNESS] = ...
|
|
167
|
+
__name__: str
|
|
168
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
169
|
+
@staticmethod
|
|
170
|
+
def from_value(arg: int, /) -> lief.ENDIANNESS: ...
|
|
171
|
+
def __ge__(self, other) -> bool: ...
|
|
172
|
+
def __gt__(self, other) -> bool: ...
|
|
173
|
+
def __hash__(self) -> int: ...
|
|
174
|
+
def __index__(self) -> Any: ...
|
|
175
|
+
def __int__(self) -> int: ...
|
|
176
|
+
def __le__(self, other) -> bool: ...
|
|
177
|
+
def __lt__(self, other) -> bool: ...
|
|
178
|
+
@property
|
|
179
|
+
def value(self) -> int: ...
|
|
180
|
+
|
|
181
|
+
class Function(Symbol):
|
|
182
|
+
class FLAGS:
|
|
183
|
+
CONSTRUCTOR: ClassVar[Function.FLAGS] = ...
|
|
184
|
+
DEBUG_INFO: ClassVar[Function.FLAGS] = ...
|
|
185
|
+
DESTRUCTOR: ClassVar[Function.FLAGS] = ...
|
|
186
|
+
EXPORTED: ClassVar[Function.FLAGS] = ...
|
|
187
|
+
IMPORTED: ClassVar[Function.FLAGS] = ...
|
|
188
|
+
__name__: str
|
|
189
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
190
|
+
def __ge__(self, other) -> bool: ...
|
|
191
|
+
def __gt__(self, other) -> bool: ...
|
|
192
|
+
def __hash__(self) -> int: ...
|
|
193
|
+
def __index__(self) -> Any: ...
|
|
194
|
+
def __int__(self) -> int: ...
|
|
195
|
+
def __le__(self, other) -> bool: ...
|
|
196
|
+
def __lt__(self, other) -> bool: ...
|
|
197
|
+
address: int
|
|
198
|
+
@overload
|
|
199
|
+
def __init__(self) -> None: ...
|
|
200
|
+
@overload
|
|
201
|
+
def __init__(self, arg: str, /) -> None: ...
|
|
202
|
+
@overload
|
|
203
|
+
def __init__(self, arg: int, /) -> None: ...
|
|
204
|
+
@overload
|
|
205
|
+
def __init__(self, arg0: str, arg1: int, /) -> None: ...
|
|
206
|
+
def add(self, flag: lief.Function.FLAGS) -> lief.Function: ...
|
|
207
|
+
@property
|
|
208
|
+
def flags(self) -> list[lief.Function.FLAGS]: ...
|
|
209
|
+
|
|
210
|
+
class Header(Object):
|
|
211
|
+
architecture: lief.ARCHITECTURES
|
|
212
|
+
endianness: lief.ENDIANNESS
|
|
213
|
+
entrypoint: int
|
|
214
|
+
modes: set[lief.MODES]
|
|
215
|
+
object_type: lief.OBJECT_TYPES
|
|
216
|
+
def __init__(self) -> None: ...
|
|
217
|
+
@property
|
|
218
|
+
def is_32(self) -> bool: ...
|
|
219
|
+
@property
|
|
220
|
+
def is_64(self) -> bool: ...
|
|
221
|
+
|
|
222
|
+
class MODES:
|
|
223
|
+
ARM: ClassVar[MODES] = ...
|
|
224
|
+
M16: ClassVar[MODES] = ...
|
|
225
|
+
M32: ClassVar[MODES] = ...
|
|
226
|
+
M64: ClassVar[MODES] = ...
|
|
227
|
+
MCLASS: ClassVar[MODES] = ...
|
|
228
|
+
MIPS3: ClassVar[MODES] = ...
|
|
229
|
+
MIPS32: ClassVar[MODES] = ...
|
|
230
|
+
MIPS32R6: ClassVar[MODES] = ...
|
|
231
|
+
MIPS64: ClassVar[MODES] = ...
|
|
232
|
+
MIPSGP64: ClassVar[MODES] = ...
|
|
233
|
+
NONE: ClassVar[MODES] = ...
|
|
234
|
+
THUMB: ClassVar[MODES] = ...
|
|
235
|
+
UNDEFINED: ClassVar[MODES] = ...
|
|
236
|
+
V7: ClassVar[MODES] = ...
|
|
237
|
+
V8: ClassVar[MODES] = ...
|
|
238
|
+
V9: ClassVar[MODES] = ...
|
|
239
|
+
__name__: str
|
|
240
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
241
|
+
@staticmethod
|
|
242
|
+
def from_value(arg: int, /) -> lief.MODES: ...
|
|
243
|
+
def __ge__(self, other) -> bool: ...
|
|
244
|
+
def __gt__(self, other) -> bool: ...
|
|
245
|
+
def __hash__(self) -> int: ...
|
|
246
|
+
def __index__(self) -> Any: ...
|
|
247
|
+
def __int__(self) -> int: ...
|
|
248
|
+
def __le__(self, other) -> bool: ...
|
|
249
|
+
def __lt__(self, other) -> bool: ...
|
|
250
|
+
@property
|
|
251
|
+
def value(self) -> int: ...
|
|
252
|
+
|
|
253
|
+
class OBJECT_TYPES:
|
|
254
|
+
EXECUTABLE: ClassVar[OBJECT_TYPES] = ...
|
|
255
|
+
LIBRARY: ClassVar[OBJECT_TYPES] = ...
|
|
256
|
+
NONE: ClassVar[OBJECT_TYPES] = ...
|
|
257
|
+
OBJECT: ClassVar[OBJECT_TYPES] = ...
|
|
258
|
+
__name__: str
|
|
259
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
260
|
+
@staticmethod
|
|
261
|
+
def from_value(arg: int, /) -> lief.OBJECT_TYPES: ...
|
|
262
|
+
def __ge__(self, other) -> bool: ...
|
|
263
|
+
def __gt__(self, other) -> bool: ...
|
|
264
|
+
def __hash__(self) -> int: ...
|
|
265
|
+
def __index__(self) -> Any: ...
|
|
266
|
+
def __int__(self) -> int: ...
|
|
267
|
+
def __le__(self, other) -> bool: ...
|
|
268
|
+
def __lt__(self, other) -> bool: ...
|
|
269
|
+
@property
|
|
270
|
+
def value(self) -> int: ...
|
|
271
|
+
|
|
272
|
+
class Object:
|
|
273
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
274
|
+
def __hash__(self) -> int: ...
|
|
275
|
+
|
|
276
|
+
class PLATFORMS:
|
|
277
|
+
ANDROID: ClassVar[PLATFORMS] = ...
|
|
278
|
+
IOS: ClassVar[PLATFORMS] = ...
|
|
279
|
+
LINUX: ClassVar[PLATFORMS] = ...
|
|
280
|
+
OSX: ClassVar[PLATFORMS] = ...
|
|
281
|
+
UNKNOWN: ClassVar[PLATFORMS] = ...
|
|
282
|
+
WINDOWS: ClassVar[PLATFORMS] = ...
|
|
283
|
+
__name__: str
|
|
284
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
285
|
+
@staticmethod
|
|
286
|
+
def from_value(arg: int, /) -> lief.PLATFORMS: ...
|
|
287
|
+
def __ge__(self, other) -> bool: ...
|
|
288
|
+
def __gt__(self, other) -> bool: ...
|
|
289
|
+
def __hash__(self) -> int: ...
|
|
290
|
+
def __index__(self) -> Any: ...
|
|
291
|
+
def __int__(self) -> int: ...
|
|
292
|
+
def __le__(self, other) -> bool: ...
|
|
293
|
+
def __lt__(self, other) -> bool: ...
|
|
294
|
+
@property
|
|
295
|
+
def value(self) -> int: ...
|
|
296
|
+
|
|
297
|
+
class Relocation(Object):
|
|
298
|
+
address: int
|
|
299
|
+
size: int
|
|
300
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
301
|
+
|
|
302
|
+
class Section(Object):
|
|
303
|
+
content: memoryview
|
|
304
|
+
name: Union[str,bytes]
|
|
305
|
+
offset: int
|
|
306
|
+
size: int
|
|
307
|
+
virtual_address: int
|
|
308
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
309
|
+
@overload
|
|
310
|
+
def search(self, number: int, pos: int = ..., size: int = ...) -> Optional[int]: ...
|
|
311
|
+
@overload
|
|
312
|
+
def search(self, str: str, pos: int = ...) -> Optional[int]: ...
|
|
313
|
+
@overload
|
|
314
|
+
def search(self, bytes: bytes, pos: int = ...) -> Optional[int]: ...
|
|
315
|
+
@overload
|
|
316
|
+
def search_all(self, number: int, size: int = ...) -> list[int]: ...
|
|
317
|
+
@overload
|
|
318
|
+
def search_all(self, str: str) -> list[int]: ...
|
|
319
|
+
@property
|
|
320
|
+
def entropy(self) -> float: ...
|
|
321
|
+
@property
|
|
322
|
+
def fullname(self) -> bytes: ...
|
|
323
|
+
|
|
324
|
+
class Symbol(Object):
|
|
325
|
+
name: Union[str,bytes]
|
|
326
|
+
size: int
|
|
327
|
+
value: int
|
|
328
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
329
|
+
|
|
330
|
+
class debug_location_t:
|
|
331
|
+
file: str
|
|
332
|
+
line: int
|
|
333
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
334
|
+
|
|
335
|
+
class lief_errors:
|
|
336
|
+
asn1_bad_tag: ClassVar[lief_errors] = ...
|
|
337
|
+
build_error: ClassVar[lief_errors] = ...
|
|
338
|
+
conversion_error: ClassVar[lief_errors] = ...
|
|
339
|
+
corrupted: ClassVar[lief_errors] = ...
|
|
340
|
+
data_too_large: ClassVar[lief_errors] = ...
|
|
341
|
+
file_error: ClassVar[lief_errors] = ...
|
|
342
|
+
file_format_error: ClassVar[lief_errors] = ...
|
|
343
|
+
not_found: ClassVar[lief_errors] = ...
|
|
344
|
+
not_implemented: ClassVar[lief_errors] = ...
|
|
345
|
+
not_supported: ClassVar[lief_errors] = ...
|
|
346
|
+
parsing_error: ClassVar[lief_errors] = ...
|
|
347
|
+
read_error: ClassVar[lief_errors] = ...
|
|
348
|
+
read_out_of_bound: ClassVar[lief_errors] = ...
|
|
349
|
+
__name__: str
|
|
350
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
351
|
+
def __ge__(self, other) -> bool: ...
|
|
352
|
+
def __gt__(self, other) -> bool: ...
|
|
353
|
+
def __hash__(self) -> int: ...
|
|
354
|
+
def __index__(self) -> Any: ...
|
|
355
|
+
def __int__(self) -> int: ...
|
|
356
|
+
def __le__(self, other) -> bool: ...
|
|
357
|
+
def __lt__(self, other) -> bool: ...
|
|
358
|
+
|
|
359
|
+
class ok_error_t:
|
|
360
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
361
|
+
def __bool__(self) -> bool: ...
|
|
362
|
+
@property
|
|
363
|
+
def error(self) -> lief_errors: ...
|
|
364
|
+
@property
|
|
365
|
+
def is_error(self) -> bool: ...
|
|
366
|
+
@property
|
|
367
|
+
def is_value(self) -> bool: ...
|
|
368
|
+
@property
|
|
369
|
+
def value(self) -> lief.ok_t: ...
|
|
370
|
+
|
|
371
|
+
class ok_t:
|
|
372
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
373
|
+
def __bool__(self) -> bool: ...
|
|
374
|
+
|
|
375
|
+
class range_t:
|
|
376
|
+
high: int
|
|
377
|
+
low: int
|
|
378
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
379
|
+
@property
|
|
380
|
+
def size(self) -> int: ...
|
|
381
|
+
|
|
382
|
+
def current_platform() -> lief.PLATFORMS: ...
|
|
383
|
+
def disable_leak_warning() -> None: ...
|
|
384
|
+
@overload
|
|
385
|
+
def hash(arg: lief.Object, /) -> int: ...
|
|
386
|
+
@overload
|
|
387
|
+
def hash(arg: list[int], /) -> int: ...
|
|
388
|
+
@overload
|
|
389
|
+
def hash(arg: bytes, /) -> int: ...
|
|
390
|
+
@overload
|
|
391
|
+
def hash(arg: str, /) -> int: ...
|
|
392
|
+
@overload
|
|
393
|
+
def is_art(path: str) -> bool: ...
|
|
394
|
+
@overload
|
|
395
|
+
def is_art(raw: list[int]) -> bool: ...
|
|
396
|
+
@overload
|
|
397
|
+
def is_dex(path: str) -> bool: ...
|
|
398
|
+
@overload
|
|
399
|
+
def is_dex(raw: list[int]) -> bool: ...
|
|
400
|
+
@overload
|
|
401
|
+
def is_elf(filename: str) -> bool: ...
|
|
402
|
+
@overload
|
|
403
|
+
def is_elf(raw: list[int]) -> bool: ...
|
|
404
|
+
@overload
|
|
405
|
+
def is_macho(filename: str) -> bool: ...
|
|
406
|
+
@overload
|
|
407
|
+
def is_macho(raw: list[int]) -> bool: ...
|
|
408
|
+
@overload
|
|
409
|
+
def is_oat(binary: lief.ELF.Binary) -> bool: ...
|
|
410
|
+
@overload
|
|
411
|
+
def is_oat(path: str) -> bool: ...
|
|
412
|
+
@overload
|
|
413
|
+
def is_oat(raw: list[int]) -> bool: ...
|
|
414
|
+
@overload
|
|
415
|
+
def is_pe(file: str) -> bool: ...
|
|
416
|
+
@overload
|
|
417
|
+
def is_pe(raw: list[int]) -> bool: ...
|
|
418
|
+
@overload
|
|
419
|
+
def is_vdex(path: str) -> bool: ...
|
|
420
|
+
@overload
|
|
421
|
+
def is_vdex(raw: list[int]) -> bool: ...
|
|
422
|
+
@overload
|
|
423
|
+
def parse(raw: bytes) -> Optional[lief.Binary]: ...
|
|
424
|
+
@overload
|
|
425
|
+
def parse(filepath: str) -> Optional[lief.Binary]: ...
|
|
426
|
+
@overload
|
|
427
|
+
def parse(obj: Union[io.IOBase|os.PathLike]) -> Optional[lief.Binary]: ...
|
|
428
|
+
def to_json(arg: lief.Object, /) -> str: ...
|
lief/_lief.so
ADDED
|
Binary file
|
lief/dwarf/__init__.pyi
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
from typing import Any, ClassVar, Iterator, Optional
|
|
2
|
+
|
|
3
|
+
from typing import overload
|
|
4
|
+
import lief # type: ignore
|
|
5
|
+
import lief.dwarf # type: ignore
|
|
6
|
+
import lief.dwarf.CompilationUnit # type: ignore
|
|
7
|
+
import lief.dwarf.CompilationUnit.Language # type: ignore
|
|
8
|
+
import lief.dwarf.Function # type: ignore
|
|
9
|
+
import lief.dwarf.Scope # type: ignore
|
|
10
|
+
import lief.dwarf.Type # type: ignore
|
|
11
|
+
|
|
12
|
+
class CompilationUnit:
|
|
13
|
+
class Language:
|
|
14
|
+
class LANG:
|
|
15
|
+
C: ClassVar[CompilationUnit.Language.LANG] = ...
|
|
16
|
+
CPP: ClassVar[CompilationUnit.Language.LANG] = ...
|
|
17
|
+
DART: ClassVar[CompilationUnit.Language.LANG] = ...
|
|
18
|
+
RUST: ClassVar[CompilationUnit.Language.LANG] = ...
|
|
19
|
+
UNKNOWN: ClassVar[CompilationUnit.Language.LANG] = ...
|
|
20
|
+
__name__: str
|
|
21
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
22
|
+
@staticmethod
|
|
23
|
+
def from_value(arg: int, /) -> lief.dwarf.CompilationUnit.Language.LANG: ...
|
|
24
|
+
def __ge__(self, other) -> bool: ...
|
|
25
|
+
def __gt__(self, other) -> bool: ...
|
|
26
|
+
def __hash__(self) -> int: ...
|
|
27
|
+
def __index__(self) -> Any: ...
|
|
28
|
+
def __int__(self) -> int: ...
|
|
29
|
+
def __le__(self, other) -> bool: ...
|
|
30
|
+
def __lt__(self, other) -> bool: ...
|
|
31
|
+
@property
|
|
32
|
+
def value(self) -> int: ...
|
|
33
|
+
lang: lief.dwarf.CompilationUnit.Language.LANG
|
|
34
|
+
version: int
|
|
35
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
36
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
37
|
+
@overload
|
|
38
|
+
def find_function(self, name: str) -> Optional[lief.dwarf.Function]: ...
|
|
39
|
+
@overload
|
|
40
|
+
def find_function(self, addr: int) -> Optional[lief.dwarf.Function]: ...
|
|
41
|
+
@overload
|
|
42
|
+
def find_variable(self, addr: int) -> Optional[lief.dwarf.Variable]: ...
|
|
43
|
+
@overload
|
|
44
|
+
def find_variable(self, name: str) -> Optional[lief.dwarf.Variable]: ...
|
|
45
|
+
@property
|
|
46
|
+
def compilation_dir(self) -> str: ...
|
|
47
|
+
@property
|
|
48
|
+
def functions(self) -> Iterator[Optional[lief.dwarf.Function]]: ...
|
|
49
|
+
@property
|
|
50
|
+
def high_address(self) -> int: ...
|
|
51
|
+
@property
|
|
52
|
+
def language(self) -> lief.dwarf.CompilationUnit.Language: ...
|
|
53
|
+
@property
|
|
54
|
+
def low_address(self) -> int: ...
|
|
55
|
+
@property
|
|
56
|
+
def name(self) -> str: ...
|
|
57
|
+
@property
|
|
58
|
+
def producer(self) -> str: ...
|
|
59
|
+
@property
|
|
60
|
+
def ranges(self) -> list[lief.range_t]: ...
|
|
61
|
+
@property
|
|
62
|
+
def size(self) -> int: ...
|
|
63
|
+
@property
|
|
64
|
+
def types(self) -> Iterator[Optional[lief.dwarf.Type]]: ...
|
|
65
|
+
@property
|
|
66
|
+
def variables(self) -> Iterator[Optional[lief.dwarf.Variable]]: ...
|
|
67
|
+
|
|
68
|
+
class DebugInfo(lief.DebugInfo):
|
|
69
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
70
|
+
@overload
|
|
71
|
+
def find_function(self, name: str) -> Optional[lief.dwarf.Function]: ...
|
|
72
|
+
@overload
|
|
73
|
+
def find_function(self, addr: int) -> Optional[lief.dwarf.Function]: ...
|
|
74
|
+
def find_type(self, name: str) -> Optional[lief.dwarf.Type]: ...
|
|
75
|
+
@overload
|
|
76
|
+
def find_variable(self, addr: int) -> Optional[lief.dwarf.Variable]: ...
|
|
77
|
+
@overload
|
|
78
|
+
def find_variable(self, name: str) -> Optional[lief.dwarf.Variable]: ...
|
|
79
|
+
@property
|
|
80
|
+
def compilation_units(self) -> Iterator[Optional[lief.dwarf.CompilationUnit]]: ...
|
|
81
|
+
|
|
82
|
+
class Function:
|
|
83
|
+
class Parameter:
|
|
84
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
85
|
+
@property
|
|
86
|
+
def name(self) -> str: ...
|
|
87
|
+
@property
|
|
88
|
+
def type(self) -> Optional[lief.dwarf.Type]: ...
|
|
89
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
90
|
+
@property
|
|
91
|
+
def address(self) -> Optional[int]: ...
|
|
92
|
+
@property
|
|
93
|
+
def debug_location(self) -> lief.debug_location_t: ...
|
|
94
|
+
@property
|
|
95
|
+
def is_artificial(self) -> bool: ...
|
|
96
|
+
@property
|
|
97
|
+
def linkage_name(self) -> str: ...
|
|
98
|
+
@property
|
|
99
|
+
def name(self) -> str: ...
|
|
100
|
+
@property
|
|
101
|
+
def parameters(self) -> list[lief.dwarf.Function.Parameter]: ...
|
|
102
|
+
@property
|
|
103
|
+
def ranges(self) -> list[lief.range_t]: ...
|
|
104
|
+
@property
|
|
105
|
+
def scope(self) -> Optional[lief.dwarf.Scope]: ...
|
|
106
|
+
@property
|
|
107
|
+
def size(self) -> int: ...
|
|
108
|
+
@property
|
|
109
|
+
def type(self) -> Optional[lief.dwarf.Type]: ...
|
|
110
|
+
@property
|
|
111
|
+
def variables(self) -> Iterator[Optional[lief.dwarf.Variable]]: ...
|
|
112
|
+
|
|
113
|
+
class Scope:
|
|
114
|
+
class TYPE:
|
|
115
|
+
CLASS: ClassVar[Scope.TYPE] = ...
|
|
116
|
+
COMPILATION_UNIT: ClassVar[Scope.TYPE] = ...
|
|
117
|
+
FUNCTION: ClassVar[Scope.TYPE] = ...
|
|
118
|
+
NAMESPACE: ClassVar[Scope.TYPE] = ...
|
|
119
|
+
STRUCT: ClassVar[Scope.TYPE] = ...
|
|
120
|
+
UNION: ClassVar[Scope.TYPE] = ...
|
|
121
|
+
UNKNOWN: ClassVar[Scope.TYPE] = ...
|
|
122
|
+
__name__: str
|
|
123
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
124
|
+
def __ge__(self, other) -> bool: ...
|
|
125
|
+
def __gt__(self, other) -> bool: ...
|
|
126
|
+
def __hash__(self) -> int: ...
|
|
127
|
+
def __index__(self) -> Any: ...
|
|
128
|
+
def __int__(self) -> int: ...
|
|
129
|
+
def __le__(self, other) -> bool: ...
|
|
130
|
+
def __lt__(self, other) -> bool: ...
|
|
131
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
132
|
+
def chained(self, sep: str = ...) -> str: ...
|
|
133
|
+
@property
|
|
134
|
+
def name(self) -> str: ...
|
|
135
|
+
@property
|
|
136
|
+
def parent(self) -> Optional[lief.dwarf.Scope]: ...
|
|
137
|
+
@property
|
|
138
|
+
def type(self) -> lief.dwarf.Scope.TYPE: ...
|
|
139
|
+
|
|
140
|
+
class Type:
|
|
141
|
+
class KIND:
|
|
142
|
+
ARRAY: ClassVar[Type.KIND] = ...
|
|
143
|
+
BASE: ClassVar[Type.KIND] = ...
|
|
144
|
+
CLASS: ClassVar[Type.KIND] = ...
|
|
145
|
+
CONST: ClassVar[Type.KIND] = ...
|
|
146
|
+
POINTER: ClassVar[Type.KIND] = ...
|
|
147
|
+
STRUCT: ClassVar[Type.KIND] = ...
|
|
148
|
+
UNION: ClassVar[Type.KIND] = ...
|
|
149
|
+
UNKNOWN: ClassVar[Type.KIND] = ...
|
|
150
|
+
UNSPECIFIED: ClassVar[Type.KIND] = ...
|
|
151
|
+
__name__: str
|
|
152
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
153
|
+
def __ge__(self, other) -> bool: ...
|
|
154
|
+
def __gt__(self, other) -> bool: ...
|
|
155
|
+
def __hash__(self) -> int: ...
|
|
156
|
+
def __index__(self) -> Any: ...
|
|
157
|
+
def __int__(self) -> int: ...
|
|
158
|
+
def __le__(self, other) -> bool: ...
|
|
159
|
+
def __lt__(self, other) -> bool: ...
|
|
160
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
161
|
+
@property
|
|
162
|
+
def is_unspecified(self) -> bool: ...
|
|
163
|
+
@property
|
|
164
|
+
def kind(self) -> lief.dwarf.Type.KIND: ...
|
|
165
|
+
@property
|
|
166
|
+
def location(self) -> lief.debug_location_t: ...
|
|
167
|
+
@property
|
|
168
|
+
def name(self) -> Optional[str]: ...
|
|
169
|
+
@property
|
|
170
|
+
def scope(self) -> Optional[lief.dwarf.Scope]: ...
|
|
171
|
+
@property
|
|
172
|
+
def size(self) -> Optional[int]: ...
|
|
173
|
+
|
|
174
|
+
class Variable:
|
|
175
|
+
def __init__(self, *args, **kwargs) -> None: ...
|
|
176
|
+
@property
|
|
177
|
+
def address(self) -> Optional[int]: ...
|
|
178
|
+
@property
|
|
179
|
+
def debug_location(self) -> lief.debug_location_t: ...
|
|
180
|
+
@property
|
|
181
|
+
def is_constexpr(self) -> bool: ...
|
|
182
|
+
@property
|
|
183
|
+
def linkage_name(self) -> str: ...
|
|
184
|
+
@property
|
|
185
|
+
def name(self) -> str: ...
|
|
186
|
+
@property
|
|
187
|
+
def scope(self) -> Optional[lief.dwarf.Scope]: ...
|
|
188
|
+
@property
|
|
189
|
+
def size(self) -> Optional[int]: ...
|
|
190
|
+
@property
|
|
191
|
+
def type(self) -> Optional[lief.dwarf.Type]: ...
|
|
192
|
+
|
|
193
|
+
def load(path: str) -> Optional[lief.dwarf.DebugInfo]: ...
|