cle 9.3.0__tar.gz → 9.3.2__tar.gz
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.
- {cle-9.3.0/cle.egg-info → cle-9.3.2}/PKG-INFO +5 -5
- {cle-9.3.0 → cle-9.3.2}/cle/__init__.py +1 -1
- {cle-9.3.0 → cle-9.3.2}/cle/backends/binja.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/coff.py +16 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/amd64.py +23 -9
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/arm.py +34 -14
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/arm64.py +31 -9
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/elfreloc.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/generic.py +29 -1
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/i386.py +24 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/mips.py +18 -12
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/ppc.py +49 -7
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/ppc64.py +19 -7
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/s390x.py +7 -7
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/sparc.py +6 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/__init__.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/simdata/common.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/binding.py +4 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/pe.py +85 -11
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/arm.py +2 -2
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/generic.py +13 -1
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/mips.py +2 -2
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/pereloc.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/riscv.py +3 -3
- {cle-9.3.0 → cle-9.3.2}/cle/backends/relocation.py +6 -1
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/tls_object.py +2 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/uefi_firmware.py +37 -33
- {cle-9.3.0 → cle-9.3.2/cle.egg-info}/PKG-INFO +5 -5
- {cle-9.3.0 → cle-9.3.2}/cle.egg-info/SOURCES.txt +3 -0
- {cle-9.3.0 → cle-9.3.2}/cle.egg-info/requires.txt +5 -3
- {cle-9.3.0 → cle-9.3.2}/pyproject.toml +4 -4
- cle-9.3.2/tests/test_optional_backends.py +18 -0
- cle-9.3.2/tests/test_pe_coff_symbols.py +83 -0
- cle-9.3.2/tests/test_pe_delay_imports.py +64 -0
- {cle-9.3.0 → cle-9.3.2}/LICENSE +0 -0
- {cle-9.3.0 → cle-9.3.2}/MANIFEST.in +0 -0
- {cle-9.3.0 → cle-9.3.2}/README.md +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/address_translator.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/backend.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/blob.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/cartfile.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/cgc/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/cgc/backedcgc.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/cgc/cgc.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/compilation_unit.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/elf.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/elfcore.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/hashtable.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/lsda.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/metaelf.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/relocation/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/subprogram.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/symbol.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/symbol_type.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/variable.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/elf/variable_type.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/simdata/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/simdata/glibc_startup.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/simdata/io_file.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/externs/simdata/simdata.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/ihex.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/inlined_function.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/java/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/java/android_lifecycle.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/java/apk.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/java/jar.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/java/soot.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/encrypted_sentinel_backer.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/macho.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/macho_enums.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/section.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/segment.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/structs.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/macho/symbol.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/minidump/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/named_region.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/relocation/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/stubs.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/symbol.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/pe/symbolserver.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/region.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/srec.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/static_archive.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/stm32.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/symbol.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/te.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/elf_tls.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/elfcore_tls.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/minidump_tls.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/tls/pe_tls.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/universal2.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/backends/xbe.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/errors.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/gdb.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/loader.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/memory.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/patched_stream.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/py.typed +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/structs/__init__.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/structs/mem_regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle/utils.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle.egg-info/dependency_links.txt +0 -0
- {cle-9.3.0 → cle-9.3.2}/cle.egg-info/top_level.txt +0 -0
- {cle-9.3.0 → cle-9.3.2}/setup.cfg +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_aarch64_relocations.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_address_translator.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_amd64_relocations.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_arch_detect.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_arm_firmware.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_blob.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_cart.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_clemory.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_coff.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_compiler_detection.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_dwarf.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_dwarf_resiliency.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_elfcore.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_exceptions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_extern.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_gdb.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_got.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_hex.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho_bindinghelper.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho_dyld.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho_dyld_structs.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho_libs.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_macho_reloc.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_minidump.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_mips_relocations.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_namedregion.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_overlap.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_patched_stream.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_pe.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_pe_meta_regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_plt.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_ppc64_initial_rtoc.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_ppc_relocations.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_preload.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_regions.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_relocated.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_runpath.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_simdata.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_stream.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_symbolserver.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_tls_resiliency.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_universal2.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_unpackword.py +0 -0
- {cle-9.3.0 → cle-9.3.2}/tests/test_xbe.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cle
|
|
3
|
-
Version: 9.3.
|
|
3
|
+
Version: 9.3.2
|
|
4
4
|
Summary: CLE Loads Everything (at least, many binary formats!) and provides a pythonic interface to analyze what they are and what they would look like in memory.
|
|
5
5
|
License-Expression: BSD-2-Clause
|
|
6
6
|
Project-URL: Homepage, https://api.angr.io/projects/cle/en/latest/
|
|
@@ -13,17 +13,17 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
13
13
|
Requires-Python: >=3.12
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
-
Requires-Dist: archinfo==9.3.
|
|
16
|
+
Requires-Dist: archinfo==9.3.2
|
|
17
17
|
Requires-Dist: arpy==1.1.1
|
|
18
18
|
Requires-Dist: cart
|
|
19
19
|
Requires-Dist: minidump>=0.0.10
|
|
20
20
|
Requires-Dist: pefile==2024.8.26
|
|
21
21
|
Requires-Dist: pyelftools>=0.29
|
|
22
|
-
Requires-Dist: pyvex==9.3.
|
|
22
|
+
Requires-Dist: pyvex==9.3.2
|
|
23
23
|
Requires-Dist: pyxbe~=1.0.3
|
|
24
|
-
Requires-Dist: pyxdia~=0.1
|
|
24
|
+
Requires-Dist: pyxdia~=0.1; sys_platform != "emscripten"
|
|
25
25
|
Requires-Dist: sortedcontainers>=2.0
|
|
26
|
-
Requires-Dist: uefi-firmware~=1.16
|
|
26
|
+
Requires-Dist: uefi-firmware~=1.16; sys_platform != "emscripten"
|
|
27
27
|
Provides-Extra: pcode
|
|
28
28
|
Requires-Dist: pypcode>=1.1; extra == "pcode"
|
|
29
29
|
Dynamic: license-file
|
|
@@ -286,6 +286,8 @@ class CoffRelocation(Relocation):
|
|
|
286
286
|
Relocation for a COFF object.
|
|
287
287
|
"""
|
|
288
288
|
|
|
289
|
+
__slots__ = ()
|
|
290
|
+
|
|
289
291
|
PACK_FORMAT = "<i"
|
|
290
292
|
|
|
291
293
|
def relocate(self):
|
|
@@ -302,6 +304,8 @@ class CoffRelocationREL32(CoffRelocation):
|
|
|
302
304
|
Relocation for IMAGE_REL_*_REL32
|
|
303
305
|
"""
|
|
304
306
|
|
|
307
|
+
__slots__ = ()
|
|
308
|
+
|
|
305
309
|
@property
|
|
306
310
|
def value(self):
|
|
307
311
|
assert self.resolvedby is not None
|
|
@@ -315,6 +319,8 @@ class CoffRelocationDIR32(CoffRelocation):
|
|
|
315
319
|
Relocation for IMAGE_REL_*_DIR32
|
|
316
320
|
"""
|
|
317
321
|
|
|
322
|
+
__slots__ = ()
|
|
323
|
+
|
|
318
324
|
@property
|
|
319
325
|
def value(self):
|
|
320
326
|
assert self.resolvedby is not None
|
|
@@ -328,6 +334,8 @@ class CoffRelocationDIR32NB(CoffRelocation):
|
|
|
328
334
|
Relocation for IMAGE_REL_*_DIR32
|
|
329
335
|
"""
|
|
330
336
|
|
|
337
|
+
__slots__ = ()
|
|
338
|
+
|
|
331
339
|
@property
|
|
332
340
|
def value(self):
|
|
333
341
|
assert self.resolvedby is not None
|
|
@@ -341,6 +349,8 @@ class CoffRelocationADDR32NB(CoffRelocation):
|
|
|
341
349
|
Relocation for IMAGE_REL_AMD64_ADDR32NB
|
|
342
350
|
"""
|
|
343
351
|
|
|
352
|
+
__slots__ = ()
|
|
353
|
+
|
|
344
354
|
PACK_FORMAT = "<I"
|
|
345
355
|
|
|
346
356
|
@property
|
|
@@ -354,6 +364,8 @@ class CoffRelocationADDR64(CoffRelocation):
|
|
|
354
364
|
Relocation for IMAGE_REL_AMD64_ADDR64
|
|
355
365
|
"""
|
|
356
366
|
|
|
367
|
+
__slots__ = ()
|
|
368
|
+
|
|
357
369
|
PACK_FORMAT = "<Q"
|
|
358
370
|
|
|
359
371
|
@property
|
|
@@ -367,6 +379,8 @@ class CoffRelocationSECTION(CoffRelocation):
|
|
|
367
379
|
Relocation for IMAGE_REL_*_SECTION
|
|
368
380
|
"""
|
|
369
381
|
|
|
382
|
+
__slots__ = ()
|
|
383
|
+
|
|
370
384
|
PACK_FORMAT = "<H"
|
|
371
385
|
|
|
372
386
|
@property
|
|
@@ -381,6 +395,8 @@ class CoffRelocationSECREL(CoffRelocation):
|
|
|
381
395
|
Relocation for IMAGE_REL_*_SECREL
|
|
382
396
|
"""
|
|
383
397
|
|
|
398
|
+
__slots__ = ()
|
|
399
|
+
|
|
384
400
|
PACK_FORMAT = "<I"
|
|
385
401
|
|
|
386
402
|
@property
|
|
@@ -21,66 +21,80 @@ from .generic import (
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class R_X86_64_64(GenericAbsoluteAddendReloc):
|
|
24
|
-
|
|
24
|
+
__slots__ = ()
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class R_X86_64_COPY(GenericCopyReloc):
|
|
28
|
-
|
|
28
|
+
__slots__ = ()
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class R_X86_64_RELATIVE(GenericRelativeReloc):
|
|
32
|
-
|
|
32
|
+
__slots__ = ()
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class R_X86_64_IRELATIVE(GenericIRelativeReloc):
|
|
36
|
-
|
|
36
|
+
__slots__ = ()
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class R_X86_64_GLOB_DAT(GenericAbsoluteReloc):
|
|
40
|
-
|
|
40
|
+
__slots__ = ()
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class R_X86_64_JUMP_SLOT(GenericAbsoluteReloc):
|
|
44
|
-
|
|
44
|
+
__slots__ = ()
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class R_X86_64_DTPMOD64(GenericTLSModIdReloc):
|
|
48
|
-
|
|
48
|
+
__slots__ = ()
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class R_X86_64_DTPOFF64(GenericTLSDoffsetReloc):
|
|
52
|
-
|
|
52
|
+
__slots__ = ()
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
class R_X86_64_TPOFF64(GenericTLSOffsetReloc):
|
|
56
|
-
|
|
56
|
+
__slots__ = ()
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
class R_X86_64_PC32(RelocTruncate32Mixin, GenericPCRelativeAddendReloc):
|
|
60
|
+
__slots__ = ()
|
|
61
|
+
|
|
60
62
|
check_sign_extend = True
|
|
61
63
|
|
|
62
64
|
|
|
63
65
|
class R_X86_64_32(RelocTruncate32Mixin, GenericAbsoluteAddendReloc):
|
|
66
|
+
__slots__ = ()
|
|
67
|
+
|
|
64
68
|
check_zero_extend = True
|
|
65
69
|
|
|
66
70
|
|
|
67
71
|
class R_X86_64_32S(RelocTruncate32Mixin, GenericAbsoluteAddendReloc):
|
|
72
|
+
__slots__ = ()
|
|
73
|
+
|
|
68
74
|
check_sign_extend = True
|
|
69
75
|
|
|
70
76
|
|
|
71
77
|
class R_X86_64_PLT32(RelocTruncate32Mixin, GenericPCRelativeAddendReloc):
|
|
78
|
+
__slots__ = ()
|
|
79
|
+
|
|
72
80
|
check_sign_extend = True
|
|
73
81
|
|
|
74
82
|
|
|
75
83
|
class R_X86_64_GOTPCREL(RelocGOTMixin, RelocTruncate32Mixin, GenericPCRelativeAddendReloc):
|
|
84
|
+
__slots__ = ()
|
|
85
|
+
|
|
76
86
|
check_sign_extend = True
|
|
77
87
|
|
|
78
88
|
|
|
79
89
|
class R_X86_64_GOTPCRELX(RelocGOTMixin, RelocTruncate32Mixin, GenericPCRelativeAddendReloc):
|
|
90
|
+
__slots__ = ()
|
|
91
|
+
|
|
80
92
|
check_sign_extend = True
|
|
81
93
|
|
|
82
94
|
|
|
83
95
|
class R_X86_64_REX_GOTPCRELX(RelocGOTMixin, RelocTruncate32Mixin, GenericPCRelativeAddendReloc):
|
|
96
|
+
__slots__ = ()
|
|
97
|
+
|
|
84
98
|
check_sign_extend = True
|
|
85
99
|
|
|
86
100
|
|
|
@@ -68,6 +68,8 @@ class R_ARM_CALL(ELFReloc):
|
|
|
68
68
|
- T is 1 if the symbol is of type STT_FUNC and addresses a Thumb instruction
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
|
+
__slots__ = ()
|
|
72
|
+
|
|
71
73
|
@property
|
|
72
74
|
def value(self):
|
|
73
75
|
P = self.rebased_addr # Location of this instruction
|
|
@@ -108,6 +110,8 @@ class R_ARM_PREL31(ELFReloc):
|
|
|
108
110
|
- T is 1 if the symbol is of type STT_FUNC and addresses a Thumb instruction
|
|
109
111
|
"""
|
|
110
112
|
|
|
113
|
+
__slots__ = ()
|
|
114
|
+
|
|
111
115
|
@property
|
|
112
116
|
def value(self):
|
|
113
117
|
P = self.rebased_addr # Location of this instruction
|
|
@@ -141,6 +145,8 @@ class R_ARM_REL32(ELFReloc):
|
|
|
141
145
|
- T is 1 if the symbol is of type STT_FUNC and addresses a Thumb instruction
|
|
142
146
|
"""
|
|
143
147
|
|
|
148
|
+
__slots__ = ()
|
|
149
|
+
|
|
144
150
|
@property
|
|
145
151
|
def value(self):
|
|
146
152
|
P = self.rebased_addr # Location of this instruction
|
|
@@ -167,6 +173,8 @@ class R_ARM_ABS32(ELFReloc):
|
|
|
167
173
|
- T is 1 if the symbol is of type STT_FUNC and addresses a Thumb instruction
|
|
168
174
|
"""
|
|
169
175
|
|
|
176
|
+
__slots__ = ()
|
|
177
|
+
|
|
170
178
|
@property
|
|
171
179
|
def value(self):
|
|
172
180
|
A = self.addend # The instruction
|
|
@@ -190,6 +198,8 @@ class R_ARM_MOVW_ABS_NC(ELFReloc):
|
|
|
190
198
|
- T is 1 if the symbol is of type STT_FUNC and addresses a Thumb instruction
|
|
191
199
|
"""
|
|
192
200
|
|
|
201
|
+
__slots__ = ()
|
|
202
|
+
|
|
193
203
|
@property
|
|
194
204
|
def value(self):
|
|
195
205
|
inst = self.addend # The instruction
|
|
@@ -225,6 +235,8 @@ class R_ARM_MOVT_ABS(ELFReloc):
|
|
|
225
235
|
- A is the addend
|
|
226
236
|
"""
|
|
227
237
|
|
|
238
|
+
__slots__ = ()
|
|
239
|
+
|
|
228
240
|
@property
|
|
229
241
|
def value(self):
|
|
230
242
|
inst = self.addend # The instruction
|
|
@@ -274,6 +286,8 @@ class R_ARM_THM_CALL(ELFReloc):
|
|
|
274
286
|
- Implementation appears correct with the bits placed into offset[23:22]
|
|
275
287
|
"""
|
|
276
288
|
|
|
289
|
+
__slots__ = ("_insn_bytes",)
|
|
290
|
+
|
|
277
291
|
def __init__(self, *args, **kwargs):
|
|
278
292
|
super().__init__(*args, **kwargs)
|
|
279
293
|
self._insn_bytes = None
|
|
@@ -374,61 +388,61 @@ class R_ARM_THM_CALL(ELFReloc):
|
|
|
374
388
|
|
|
375
389
|
|
|
376
390
|
class R_ARM_COPY(GenericCopyReloc):
|
|
377
|
-
|
|
391
|
+
__slots__ = ()
|
|
378
392
|
|
|
379
393
|
|
|
380
394
|
class R_ARM_GLOB_DAT(GenericJumpslotReloc):
|
|
381
|
-
|
|
395
|
+
__slots__ = ()
|
|
382
396
|
|
|
383
397
|
|
|
384
398
|
class R_ARM_JUMP_SLOT(GenericJumpslotReloc):
|
|
385
|
-
|
|
399
|
+
__slots__ = ()
|
|
386
400
|
|
|
387
401
|
|
|
388
402
|
class R_ARM_RELATIVE(GenericRelativeReloc):
|
|
389
|
-
|
|
403
|
+
__slots__ = ()
|
|
390
404
|
|
|
391
405
|
|
|
392
406
|
class R_ARM_ABS32_NOI(GenericAbsoluteAddendReloc):
|
|
393
|
-
|
|
407
|
+
__slots__ = ()
|
|
394
408
|
|
|
395
409
|
|
|
396
410
|
class R_ARM_REL32_NOI(GenericPCRelativeAddendReloc):
|
|
397
|
-
|
|
411
|
+
__slots__ = ()
|
|
398
412
|
|
|
399
413
|
|
|
400
414
|
class R_ARM_TLS_DTPMOD32(GenericTLSModIdReloc):
|
|
401
|
-
|
|
415
|
+
__slots__ = ()
|
|
402
416
|
|
|
403
417
|
|
|
404
418
|
class R_ARM_TLS_DTPOFF32(GenericTLSDoffsetReloc):
|
|
405
|
-
|
|
419
|
+
__slots__ = ()
|
|
406
420
|
|
|
407
421
|
|
|
408
422
|
class R_ARM_TLS_TPOFF32(GenericTLSOffsetReloc):
|
|
409
|
-
|
|
423
|
+
__slots__ = ()
|
|
410
424
|
|
|
411
425
|
|
|
412
426
|
class R_ARM_JUMP24(R_ARM_CALL):
|
|
413
|
-
|
|
427
|
+
__slots__ = ()
|
|
414
428
|
|
|
415
429
|
|
|
416
430
|
class R_ARM_PC24(R_ARM_CALL):
|
|
417
|
-
|
|
431
|
+
__slots__ = ()
|
|
418
432
|
|
|
419
433
|
|
|
420
434
|
# EDG says: Implementing these the easy way.
|
|
421
435
|
# Inaccuracies may exist. This is ARM, after all.
|
|
422
436
|
class R_ARM_THM_JUMP24(R_ARM_THM_CALL):
|
|
423
|
-
|
|
437
|
+
__slots__ = ()
|
|
424
438
|
|
|
425
439
|
|
|
426
440
|
class R_ARM_THM_JUMP19(R_ARM_THM_CALL):
|
|
427
|
-
|
|
441
|
+
__slots__ = ()
|
|
428
442
|
|
|
429
443
|
|
|
430
444
|
class R_ARM_THM_JUMP6(R_ARM_THM_CALL):
|
|
431
|
-
|
|
445
|
+
__slots__ = ()
|
|
432
446
|
|
|
433
447
|
|
|
434
448
|
class R_ARM_THM_MOVW_ABS_NC(ELFReloc):
|
|
@@ -437,6 +451,8 @@ class R_ARM_THM_MOVW_ABS_NC(ELFReloc):
|
|
|
437
451
|
Ref: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst
|
|
438
452
|
"""
|
|
439
453
|
|
|
454
|
+
__slots__ = ()
|
|
455
|
+
|
|
440
456
|
@property
|
|
441
457
|
def value(self):
|
|
442
458
|
insn_bytes = self.owner.memory.load(self.relative_addr, 4)
|
|
@@ -478,6 +494,8 @@ class R_ARM_THM_MOVT_ABS(ELFReloc):
|
|
|
478
494
|
Ref: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst
|
|
479
495
|
"""
|
|
480
496
|
|
|
497
|
+
__slots__ = ()
|
|
498
|
+
|
|
481
499
|
@property
|
|
482
500
|
def value(self):
|
|
483
501
|
insn_bytes = self.owner.memory.load(self.relative_addr, 4)
|
|
@@ -518,6 +536,8 @@ class R_ARM_GOT_PREL(GenericPCRelativeAddendReloc, RelocTruncate32Mixin, RelocGO
|
|
|
518
536
|
Ref: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst
|
|
519
537
|
"""
|
|
520
538
|
|
|
539
|
+
__slots__ = ()
|
|
540
|
+
|
|
521
541
|
|
|
522
542
|
relocation_table_arm = {
|
|
523
543
|
1: R_ARM_PC24,
|
|
@@ -25,42 +25,44 @@ log = logging.getLogger(name=__name__)
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class R_AARCH64_ABS64(GenericAbsoluteAddendReloc):
|
|
28
|
-
|
|
28
|
+
__slots__ = ()
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class R_AARCH64_COPY(GenericCopyReloc):
|
|
32
|
-
|
|
32
|
+
__slots__ = ()
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class R_AARCH64_GLOB_DAT(GenericJumpslotReloc):
|
|
36
|
-
|
|
36
|
+
__slots__ = ()
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class R_AARCH64_JUMP_SLOT(GenericJumpslotReloc):
|
|
40
|
-
|
|
40
|
+
__slots__ = ()
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class R_AARCH64_RELATIVE(GenericRelativeReloc):
|
|
44
|
-
|
|
44
|
+
__slots__ = ()
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
class R_AARCH64_IRELATIVE(GenericIRelativeReloc):
|
|
48
|
-
|
|
48
|
+
__slots__ = ()
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class R_AARCH64_TLS_DTPREL(GenericTLSDoffsetReloc):
|
|
52
|
-
|
|
52
|
+
__slots__ = ()
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
class R_AARCH64_TLS_DTPMOD(GenericTLSModIdReloc):
|
|
56
|
-
|
|
56
|
+
__slots__ = ()
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
class R_AARCH64_TLS_TPREL(GenericTLSOffsetReloc):
|
|
60
|
-
|
|
60
|
+
__slots__ = ()
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
class R_AARCH64_TLSDESC(GenericTLSDescriptorReloc):
|
|
64
|
+
__slots__ = ()
|
|
65
|
+
|
|
64
66
|
RESOLVER_ADDR = 0xFFFF_FFFF_FFFF_FE00
|
|
65
67
|
|
|
66
68
|
|
|
@@ -70,6 +72,8 @@ class R_AARCH64_PREL32(GenericPCRelativeAddendReloc):
|
|
|
70
72
|
Calculation: (S + A - P)
|
|
71
73
|
"""
|
|
72
74
|
|
|
75
|
+
__slots__ = ()
|
|
76
|
+
|
|
73
77
|
|
|
74
78
|
class R_AARCH64_JUMP26(ELFReloc):
|
|
75
79
|
"""
|
|
@@ -77,6 +81,8 @@ class R_AARCH64_JUMP26(ELFReloc):
|
|
|
77
81
|
Calculation: (S + A - P)
|
|
78
82
|
"""
|
|
79
83
|
|
|
84
|
+
__slots__ = ()
|
|
85
|
+
|
|
80
86
|
@property
|
|
81
87
|
def value(self):
|
|
82
88
|
A = self.addend
|
|
@@ -101,6 +107,8 @@ class R_AARCH64_CALL26(ELFReloc):
|
|
|
101
107
|
Calculation: (S + A - P)
|
|
102
108
|
"""
|
|
103
109
|
|
|
110
|
+
__slots__ = ()
|
|
111
|
+
|
|
104
112
|
@property
|
|
105
113
|
def value(self):
|
|
106
114
|
A = self.addend
|
|
@@ -125,6 +133,8 @@ class R_AARCH64_ADR_PREL_PG_HI21(ELFReloc):
|
|
|
125
133
|
Calculation: Page(S + A) - Page(P)
|
|
126
134
|
"""
|
|
127
135
|
|
|
136
|
+
__slots__ = ()
|
|
137
|
+
|
|
128
138
|
@property
|
|
129
139
|
def value(self):
|
|
130
140
|
A = self.addend
|
|
@@ -151,6 +161,8 @@ class R_AARCH64_ADD_ABS_LO12_NC(ELFReloc):
|
|
|
151
161
|
Calculation: (S + A)
|
|
152
162
|
"""
|
|
153
163
|
|
|
164
|
+
__slots__ = ()
|
|
165
|
+
|
|
154
166
|
@property
|
|
155
167
|
def value(self):
|
|
156
168
|
A = self.addend
|
|
@@ -172,6 +184,8 @@ class R_AARCH64_LDST8_ABS_LO12_NC(ELFReloc):
|
|
|
172
184
|
Calculation: (S + A)
|
|
173
185
|
"""
|
|
174
186
|
|
|
187
|
+
__slots__ = ()
|
|
188
|
+
|
|
175
189
|
@property
|
|
176
190
|
def value(self):
|
|
177
191
|
A = self.addend
|
|
@@ -193,6 +207,8 @@ class R_AARCH64_LDST16_ABS_LO12_NC(ELFReloc):
|
|
|
193
207
|
Calculation: (S + A)
|
|
194
208
|
"""
|
|
195
209
|
|
|
210
|
+
__slots__ = ()
|
|
211
|
+
|
|
196
212
|
@property
|
|
197
213
|
def value(self):
|
|
198
214
|
A = self.addend
|
|
@@ -214,6 +230,8 @@ class R_AARCH64_LDST32_ABS_LO12_NC(ELFReloc):
|
|
|
214
230
|
Calculation: (S + A)
|
|
215
231
|
"""
|
|
216
232
|
|
|
233
|
+
__slots__ = ()
|
|
234
|
+
|
|
217
235
|
@property
|
|
218
236
|
def value(self):
|
|
219
237
|
A = self.addend
|
|
@@ -235,6 +253,8 @@ class R_AARCH64_LDST64_ABS_LO12_NC(ELFReloc):
|
|
|
235
253
|
Calculation: (S + A)
|
|
236
254
|
"""
|
|
237
255
|
|
|
256
|
+
__slots__ = ()
|
|
257
|
+
|
|
238
258
|
@property
|
|
239
259
|
def value(self):
|
|
240
260
|
A = self.addend
|
|
@@ -256,6 +276,8 @@ class R_AARCH64_LDST128_ABS_LO12_NC(ELFReloc):
|
|
|
256
276
|
Calculation: (S + A)
|
|
257
277
|
"""
|
|
258
278
|
|
|
279
|
+
__slots__ = ()
|
|
280
|
+
|
|
259
281
|
@property
|
|
260
282
|
def value(self):
|
|
261
283
|
A = self.addend
|
|
@@ -31,6 +31,8 @@ __all__ = [
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class GenericTLSDoffsetReloc(ELFReloc):
|
|
34
|
+
__slots__ = ()
|
|
35
|
+
|
|
34
36
|
@property
|
|
35
37
|
def value(self):
|
|
36
38
|
return self.addend + self.symbol.relative_addr
|
|
@@ -41,6 +43,8 @@ class GenericTLSDoffsetReloc(ELFReloc):
|
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
class GenericTLSOffsetReloc(ELFReloc):
|
|
46
|
+
__slots__ = ()
|
|
47
|
+
|
|
44
48
|
AUTO_HANDLE_NONE = True
|
|
45
49
|
|
|
46
50
|
def relocate(self):
|
|
@@ -66,6 +70,8 @@ class GenericTLSDescriptorReloc(ELFReloc):
|
|
|
66
70
|
# is passed a pointer to the descriptor. My guess is the resolver is supposed to basically perform
|
|
67
71
|
# _tls_get_addr, but the intention is probably to make it possible to work with dynamically loaded objects.
|
|
68
72
|
|
|
73
|
+
__slots__ = ()
|
|
74
|
+
|
|
69
75
|
RESOLVER_ADDR: int = NotImplemented
|
|
70
76
|
AUTO_HANDLE_NONE = True
|
|
71
77
|
|
|
@@ -85,6 +91,8 @@ class GenericTLSDescriptorReloc(ELFReloc):
|
|
|
85
91
|
|
|
86
92
|
|
|
87
93
|
class GenericTLSModIdReloc(ELFReloc):
|
|
94
|
+
__slots__ = ()
|
|
95
|
+
|
|
88
96
|
AUTO_HANDLE_NONE = True
|
|
89
97
|
|
|
90
98
|
def relocate(self):
|
|
@@ -97,6 +105,8 @@ class GenericTLSModIdReloc(ELFReloc):
|
|
|
97
105
|
|
|
98
106
|
|
|
99
107
|
class GenericIRelativeReloc(ELFReloc):
|
|
108
|
+
__slots__ = ()
|
|
109
|
+
|
|
100
110
|
AUTO_HANDLE_NONE = True
|
|
101
111
|
|
|
102
112
|
def relocate(self):
|
|
@@ -107,18 +117,24 @@ class GenericIRelativeReloc(ELFReloc):
|
|
|
107
117
|
|
|
108
118
|
|
|
109
119
|
class GenericAbsoluteAddendReloc(ELFReloc):
|
|
120
|
+
__slots__ = ()
|
|
121
|
+
|
|
110
122
|
@property
|
|
111
123
|
def value(self):
|
|
112
124
|
return self.resolvedby.rebased_addr + self.addend
|
|
113
125
|
|
|
114
126
|
|
|
115
127
|
class GenericPCRelativeAddendReloc(ELFReloc):
|
|
128
|
+
__slots__ = ()
|
|
129
|
+
|
|
116
130
|
@property
|
|
117
131
|
def value(self):
|
|
118
132
|
return self.resolvedby.rebased_addr + self.addend - self.rebased_addr
|
|
119
133
|
|
|
120
134
|
|
|
121
135
|
class GenericJumpslotReloc(ELFReloc):
|
|
136
|
+
__slots__ = ()
|
|
137
|
+
|
|
122
138
|
@property
|
|
123
139
|
def value(self):
|
|
124
140
|
if self.is_rela:
|
|
@@ -128,6 +144,8 @@ class GenericJumpslotReloc(ELFReloc):
|
|
|
128
144
|
|
|
129
145
|
|
|
130
146
|
class GenericRelativeReloc(ELFReloc):
|
|
147
|
+
__slots__ = ()
|
|
148
|
+
|
|
131
149
|
AUTO_HANDLE_NONE = True
|
|
132
150
|
|
|
133
151
|
@property
|
|
@@ -138,12 +156,16 @@ class GenericRelativeReloc(ELFReloc):
|
|
|
138
156
|
|
|
139
157
|
|
|
140
158
|
class GenericAbsoluteReloc(ELFReloc):
|
|
159
|
+
__slots__ = ()
|
|
160
|
+
|
|
141
161
|
@property
|
|
142
162
|
def value(self):
|
|
143
163
|
return self.resolvedby.rebased_addr
|
|
144
164
|
|
|
145
165
|
|
|
146
166
|
class GenericCopyReloc(ELFReloc):
|
|
167
|
+
__slots__ = ()
|
|
168
|
+
|
|
147
169
|
def resolve_symbol(self, solist, **kwargs):
|
|
148
170
|
new_solist = [x for x in solist if x is not self.owner]
|
|
149
171
|
super().resolve_symbol(new_solist, **kwargs)
|
|
@@ -160,10 +182,12 @@ class GenericCopyReloc(ELFReloc):
|
|
|
160
182
|
|
|
161
183
|
|
|
162
184
|
class MipsGlobalReloc(GenericAbsoluteReloc):
|
|
163
|
-
|
|
185
|
+
__slots__ = ()
|
|
164
186
|
|
|
165
187
|
|
|
166
188
|
class MipsLocalReloc(ELFReloc):
|
|
189
|
+
__slots__ = ()
|
|
190
|
+
|
|
167
191
|
AUTO_HANDLE_NONE = True
|
|
168
192
|
|
|
169
193
|
def resolve_symbol(self, solist, **kwargs):
|
|
@@ -187,6 +211,8 @@ class RelocTruncate32Mixin:
|
|
|
187
211
|
A mix-in class for relocations that cover a 32-bit field regardless of the architecture's address word length.
|
|
188
212
|
"""
|
|
189
213
|
|
|
214
|
+
__slots__ = ()
|
|
215
|
+
|
|
190
216
|
# If True, 32-bit truncated value must equal to its original when zero-extended
|
|
191
217
|
check_zero_extend = False
|
|
192
218
|
|
|
@@ -222,6 +248,8 @@ class RelocGOTMixin:
|
|
|
222
248
|
A mix-in class which will cause the symbol to be resolved to a pointer to the symbol instead of the symbol
|
|
223
249
|
"""
|
|
224
250
|
|
|
251
|
+
__slots__ = ()
|
|
252
|
+
|
|
225
253
|
def resolve(self, symbol, extern_object=None):
|
|
226
254
|
assert extern_object is not None, "I have no idea how this would happen"
|
|
227
255
|
|