objutils 0.10.8__tar.gz → 0.10.9__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.
- {objutils-0.10.8 → objutils-0.10.9}/PKG-INFO +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/__init__.py +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/elf/defs.py +25 -15
- {objutils-0.10.8 → objutils-0.10.9}/objutils/pecoff/model.py +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/pecoff/pdb/__init__.py +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_coff_info.py +5 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_elf_info.py +3 -13
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_image.py +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/objutils/version.py +1 -1
- {objutils-0.10.8 → objutils-0.10.9}/pyproject.toml +2 -2
- {objutils-0.10.8 → objutils-0.10.9}/CMakeLists.txt +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/LICENSE +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/build_ext.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/docs/README.rst +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/.coveragerc +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/.vscode/launch.json +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/.vscode/settings.json +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/a2l_test.shf +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/ash.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/binfile.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/checksums.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/cosmac.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/attrparser.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/c_generator.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/constants.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/encoding.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/lineprog.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/readers.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/sm.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/dwarf/traverser.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/elf/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/elf/arm/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/elf/arm/attributes.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/elf/model.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/emon52.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/etek.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/exceptions.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/ctre.hpp +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/difflib.h +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/exceptions.cpp +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/exceptions.hpp +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/hexfile.cpp +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/extensions/wrapper.cpp +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/fpc.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/hexdump.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/hexfile.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/ieee695.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/ihex.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/image.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/logger.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/mostec.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/objutils.code-workspace +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/pecoff/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/pecoff/defs.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/pickleif.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/rca.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/readers.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/registry.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/arduino_build_artifacts.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_cgen.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_coff_extract.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_coff_import.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_coff_syms.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_dwarf_import.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_dwarf_info.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_elf_arm_attrs.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_elf_extract.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_elf_import.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_elf_syms.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/scripts/oj_hex_info.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/section.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/shf.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/sig.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/srec.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/symbols.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tek.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_arm_attributes.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_ash.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_c_generator.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_checksums.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_cygpath.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_diff_bin.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_elf.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_emon52.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_etek.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_examples_cgen.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_fpc.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_hexdump.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_hexfile.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_ihex.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_mostec.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_readers.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_registry.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_repr.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_section.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_section_join.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_shf.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_sm.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_srec.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_tek.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/tests/test_titext.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/titxt.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/utils/__init__.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/utils/arduino.py +0 -0
- {objutils-0.10.8 → objutils-0.10.9}/objutils/utils/diff.py +0 -0
|
@@ -1303,26 +1303,36 @@ class ProgramHeader(enum.IntEnum):
|
|
|
1303
1303
|
PT_HIPROC: End of processor-specific segment types
|
|
1304
1304
|
"""
|
|
1305
1305
|
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1306
|
+
NULL = 0 # Program header table entry unused.
|
|
1307
|
+
LOAD = 1 # Loadable program segment.
|
|
1308
|
+
DYNAMIC = 2 # Dynamic linking information.
|
|
1309
|
+
INTERP = 3 # Program interpreter.
|
|
1310
|
+
NOTE = 4 # Auxiliary information.
|
|
1311
|
+
SHLIB = 5 # Reserved.
|
|
1312
|
+
PHDR = 6 # Entry for header table itself.
|
|
1313
|
+
TLS = 7 # Thread-local storage segment
|
|
1314
|
+
NUM = 8 # Number of defined types
|
|
1315
|
+
LOOS = 0x60000000 # Start of OS-specific
|
|
1316
|
+
GNU_EH_FRAME = 0x6474E550 # GCC .eh_frame_hdr segment
|
|
1317
|
+
GNU_STACK = 0x6474E551 # Indicates stack executability
|
|
1318
|
+
GNU_RELRO = 0x6474E552 # Read-only after relocation
|
|
1319
|
+
GNU_PROPERTY = 0x6474E553 # GNU property
|
|
1320
|
+
PAX_FLAGS = 0x65041580
|
|
1320
1321
|
|
|
1321
1322
|
PT_LOSUNW = 0x6FFFFFFA
|
|
1322
1323
|
PT_SUNWBSS = 0x6FFFFFFA # Sun Specific segment
|
|
1323
1324
|
PT_SUNWSTACK = 0x6FFFFFFB # Stack segment
|
|
1324
1325
|
PT_HISUNW = 0x6FFFFFFF
|
|
1325
1326
|
PT_HIOS = 0x6FFFFFFF # End of OS-specific
|
|
1327
|
+
ARM_ARCHEXT = 0x70000000
|
|
1328
|
+
ARM_EXIDX = 0x70000001
|
|
1329
|
+
AARCH64_MEMTAG_MTE = 0x70000002
|
|
1330
|
+
# MIPS_REGINFO = 0x70000000
|
|
1331
|
+
# MIPS_RTPROC = 0x70000001
|
|
1332
|
+
# MIPS_OPTIONS = 0x70000002
|
|
1333
|
+
MIPS_ABIFLAGS = 0x70000003
|
|
1334
|
+
|
|
1335
|
+
|
|
1326
1336
|
PT_LOPROC = 0x70000000 # Start of processor-specific.
|
|
1327
1337
|
PT_ARM_EXIDX = PT_LOPROC + 1 # Frame unwind information
|
|
1328
1338
|
PT_HIPROC = 0x7FFFFFFF # End of processor-specific
|
|
@@ -1337,7 +1347,7 @@ def program_header_name(tp: int) -> str:
|
|
|
1337
1347
|
Returns:
|
|
1338
1348
|
Program header type name without the "PT_" prefix.
|
|
1339
1349
|
"""
|
|
1340
|
-
return ProgramHeader(tp).name
|
|
1350
|
+
return ProgramHeader(tp).name
|
|
1341
1351
|
|
|
1342
1352
|
|
|
1343
1353
|
PF_X = 0x1 # Execute.
|
|
@@ -85,7 +85,7 @@ from contextlib import contextmanager
|
|
|
85
85
|
|
|
86
86
|
from sqlalchemy import Column, Integer, Numeric, String, create_engine, event
|
|
87
87
|
from sqlalchemy.engine import Engine
|
|
88
|
-
from sqlalchemy.
|
|
88
|
+
from sqlalchemy.orm import declarative_base
|
|
89
89
|
from sqlalchemy.orm import Session, sessionmaker
|
|
90
90
|
|
|
91
91
|
Base = declarative_base()
|
|
@@ -1420,7 +1420,7 @@ def pdb_symbols_for_pe(pe_path: str, symbol_path: str | None = None) -> list[dic
|
|
|
1420
1420
|
if sym.tag != "SymTagData":
|
|
1421
1421
|
continue
|
|
1422
1422
|
ti = session.type_info(mod_base, sym.TypeIndex)
|
|
1423
|
-
print(f"{sym.tag:15}", sym.Name, hex(sym.Address - mod_base), sym.Size, sym.decode_flags(), "==>", ti)
|
|
1423
|
+
# print(f"{sym.tag:15}", sym.Name, hex(sym.Address - mod_base), sym.Size, sym.decode_flags(), "==>", ti)
|
|
1424
1424
|
result.append(symbols.VariableType(sym.Name, ti, sym.Address - mod_base, sym.Size))
|
|
1425
1425
|
return result
|
|
1426
1426
|
"""
|
|
@@ -17,6 +17,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
17
17
|
parser = argparse.ArgumentParser(description="Display informations about PE/COFF files.")
|
|
18
18
|
parser.add_argument("pe_file", help="PE/COFF file (.exe/.dll/.obj)")
|
|
19
19
|
parser.add_argument("--pdb", "-p", dest="pdb_file", nargs="*", help="Path to PDB file if not in same location as PE file")
|
|
20
|
+
parser.add_argument("--symbols", "-s", action="store_true", help="Dump symbols from PDB file if available")
|
|
20
21
|
args = parser.parse_args(argv)
|
|
21
22
|
|
|
22
23
|
# dump_type_tree: bool = False
|
|
@@ -53,7 +54,10 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
53
54
|
f"0x{s['size_of_raw_data']:06X} 0x{s['virtual_size']:06X}"
|
|
54
55
|
)
|
|
55
56
|
|
|
56
|
-
if pp.symbols:
|
|
57
|
+
if pp.symbols and args.symbols:
|
|
58
|
+
# pp.symbols = sorted(pp.symbols, key=lambda s: s.name)
|
|
59
|
+
pp.symbols = sorted(pp.symbols, key=lambda s: s.location)
|
|
60
|
+
|
|
57
61
|
print_header("Symbols (COFF or PDB)")
|
|
58
62
|
print("Name Value Size")
|
|
59
63
|
print("-" * 80)
|
|
@@ -89,22 +89,12 @@ def main():
|
|
|
89
89
|
)
|
|
90
90
|
|
|
91
91
|
print_header("Segments")
|
|
92
|
-
print("Type
|
|
93
|
-
print("-" *
|
|
92
|
+
print("Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align")
|
|
93
|
+
print("-" * 72)
|
|
94
94
|
for segment in ep.segments:
|
|
95
95
|
print(
|
|
96
|
-
f"{program_header_name(segment.p_type):
|
|
96
|
+
f"{program_header_name(segment.p_type):13} 0x{segment.p_offset:08x} 0x{segment.p_vaddr:08x} 0x{segment.p_paddr:08x} 0x{segment.p_filesz:05x} 0x{segment.p_memsz:05x} {program_header_flags_name(segment.p_flags):3} {segment.p_align:>5}"
|
|
97
97
|
)
|
|
98
|
-
"""
|
|
99
|
-
p_type = 1
|
|
100
|
-
p_offset = 148
|
|
101
|
-
p_vaddr = 0
|
|
102
|
-
p_paddr = 0
|
|
103
|
-
p_filesz = 12924
|
|
104
|
-
p_memsz = 12924
|
|
105
|
-
p_flags = 5
|
|
106
|
-
p_align = 2
|
|
107
|
-
"""
|
|
108
98
|
|
|
109
99
|
comment = ep.comment
|
|
110
100
|
if comment:
|
|
@@ -399,7 +399,7 @@ def test_get_section2():
|
|
|
399
399
|
assert len(sec) == 64
|
|
400
400
|
|
|
401
401
|
|
|
402
|
-
@pytest.mark.parametrize("join
|
|
402
|
+
@pytest.mark.parametrize("join", [False, True])
|
|
403
403
|
def test_get_section_raises(join):
|
|
404
404
|
img = Image(join=join)
|
|
405
405
|
img.insert_section(data=range(10), start_address=0x030)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "objutils"
|
|
3
|
-
version = "0.10.
|
|
3
|
+
version = "0.10.9"
|
|
4
4
|
description = "Objectfile library for Python"
|
|
5
5
|
authors = ["Christoph Schueler <cpu12.gems@googlemail.com>"]
|
|
6
6
|
license = "GPLv2"
|
|
@@ -121,7 +121,7 @@ skip = ["*_i686", "*-musllinux*"]
|
|
|
121
121
|
build-frontend = "build"
|
|
122
122
|
|
|
123
123
|
[tool.bumpver]
|
|
124
|
-
current_version = "0.10.
|
|
124
|
+
current_version = "0.10.9"
|
|
125
125
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
126
126
|
commit_message = "bump version {old_version} -> {new_version}"
|
|
127
127
|
commit = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|