Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elf: ValueError: symbol name not found #1704

Closed
mike-hunhoff opened this issue Aug 10, 2023 · 3 comments · Fixed by #1721
Closed

elf: ValueError: symbol name not found #1704

mike-hunhoff opened this issue Aug 10, 2023 · 3 comments · Fixed by #1721
Assignees
Labels
bug Something isn't working

Comments

@mike-hunhoff
Copy link
Collaborator

libyvr.so from https://www.virustotal.com/gui/file/4261cc05a8c4ecaf1605ef931397a4d97cc12fe38738a4f6016c3695aa2c571f/detection

> python -m capa.main --os linux  -r rules libyvr.so
Traceback (most recent call last):
  File "C:\Users\spring\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\spring\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Exclusions\capa\capa\main.py", line 1345, in <module>
    sys.exit(main())
  File "C:\Exclusions\capa\capa\main.py", line 1275, in main
    capabilities, counts = find_capabilities(rules, extractor, disable_progress=args.quiet)
  File "C:\Exclusions\capa\capa\main.py", line 283, in find_capabilities
    function_matches, bb_matches, insn_matches, feature_count = find_code_capabilities(
  File "C:\Exclusions\capa\capa\main.py", line 210, in find_code_capabilities
    features, bmatches, imatches = find_basic_block_capabilities(ruleset, extractor, fh, bb)
  File "C:\Exclusions\capa\capa\main.py", line 166, in find_basic_block_capabilities
    ifeatures, imatches = find_instruction_capabilities(ruleset, extractor, f, bb, insn)
  File "C:\Exclusions\capa\capa\main.py", line 133, in find_instruction_capabilities
    for feature, addr in itertools.chain(
  File "C:\Exclusions\capa\capa\features\extractors\viv\extractor.py", line 77, in extract_insn_features
    yield from capa.features.extractors.viv.insn.extract_features(fh, bbh, ih)
  File "C:\Exclusions\capa\capa\features\extractors\viv\insn.py", line 737, in extract_features
    for feature, addr in insn_handler(f, bb, insn):
  File "C:\Exclusions\capa\capa\features\extractors\viv\insn.py", line 125, in extract_insn_api_features
    sym_name = symtab.get_name(symbol)
  File "C:\Exclusions\capa\capa\features\extractors\elf.py", line 702, in get_name
    raise ValueError("symbol name not found")
ValueError: symbol name not found
@mike-hunhoff mike-hunhoff added the bug Something isn't working label Aug 10, 2023
@williballenthin williballenthin self-assigned this Aug 11, 2023
@williballenthin
Copy link
Collaborator

williballenthin commented Aug 14, 2023

use lib/x86_64/libyvr.so. issue not present in the x86 build.


@williballenthin ➜ /workspaces/capa (fix/issue-1705) $ readelf -a tests/data/lib/x86_64/libyvr.so 
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x1ac0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          53848 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         9
  Size of section headers:           64 (bytes)
  Number of section headers:         22
  Section header string table index: 21

Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .note.androi[...] NOTE 0000000000000238 00000238
0000000000000098 0000000000000000 A 0 0 2
[ 2] .note.gnu.bu[...] NOTE 00000000000002d0 000002d0
0000000000000024 0000000000000000 A 0 0 4
[ 3] .dynsym DYNSYM 00000000000002f8 000002f8
0000000000000450 0000000000000018 A 8 1 8
[ 4] .gnu.version VERSYM 0000000000000748 00000748
000000000000005c 0000000000000002 A 3 0 2
[ 5] .gnu.version_r VERNEED 00000000000007a4 000007a4
0000000000000040 0000000000000000 A 8 2 4
[ 6] .gnu.hash GNU_HASH 00000000000007e8 000007e8
00000000000000d0 0000000000000000 A 3 0 8
[ 7] .hash HASH 00000000000008b8 000008b8
0000000000000178 0000000000000004 A 3 0 4
[ 8] .dynstr STRTAB 0000000000000a30 00000a30
000000000000057c 0000000000000000 A 0 0 1
[ 9] .rela.dyn RELA 0000000000000fb0 00000fb0
0000000000000048 0000000000000018 A 3 0 8
[10] .rela.plt RELA 0000000000000ff8 00000ff8
0000000000000318 0000000000000018 A 3 19 8
[11] .rodata PROGBITS 0000000000001310 00001310
0000000000000190 0000000000000000 AMS 0 0 16
[12] .eh_frame_hdr PROGBITS 00000000000014a0 000014a0
00000000000000fc 0000000000000000 A 0 0 4
[13] .eh_frame PROGBITS 00000000000015a0 000015a0
000000000000051c 0000000000000000 A 0 0 8
[14] .text PROGBITS 0000000000001ac0 00001ac0
000000000000b07c 0000000000000000 AX 0 0 16
[15] .plt PROGBITS 000000000000cb40 0000cb40
0000000000000220 0000000000000000 AX 0 0 16
[16] .data.rel.ro PROGBITS 000000000000dd60 0000cd60
0000000000000008 0000000000000000 WA 0 0 8
[17] .fini_array FINI_ARRAY 000000000000dd68 0000cd68
0000000000000010 0000000000000000 WA 0 0 8
[18] .dynamic DYNAMIC 000000000000dd78 0000cd78
00000000000001d0 0000000000000010 WA 8 0 8
[19] .got.plt PROGBITS 000000000000df48 0000cf48
0000000000000120 0000000000000000 WA 0 0 8
[20] .comment PROGBITS 0000000000000000 0000d068
0000000000000116 0000000000000001 MS 0 0 1
[21] .shstrtab STRTAB 0000000000000000 0000d17e
00000000000000d6 0000000000000000 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
l (large), p (processor specific)

There are no section groups in this file.

Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040
0x00000000000001f8 0x00000000000001f8 R 0x8
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x000000000000cd60 0x000000000000cd60 R E 0x1000
LOAD 0x000000000000cd60 0x000000000000dd60 0x000000000000dd60
0x0000000000000308 0x0000000000000308 RW 0x1000
DYNAMIC 0x000000000000cd78 0x000000000000dd78 0x000000000000dd78
0x00000000000001d0 0x00000000000001d0 RW 0x8
GNU_RELRO 0x000000000000cd60 0x000000000000dd60 0x000000000000dd60
0x0000000000000308 0x00000000000012a0 R 0x1
GNU_EH_FRAME 0x00000000000014a0 0x00000000000014a0 0x00000000000014a0
0x00000000000000fc 0x00000000000000fc R 0x4
GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 RW 0x0
NOTE 0x0000000000000238 0x0000000000000238 0x0000000000000238
0x0000000000000098 0x0000000000000098 R 0x2
NOTE 0x00000000000002d0 0x00000000000002d0 0x00000000000002d0
0x0000000000000024 0x0000000000000024 R 0x4

Section to Segment mapping:
Segment Sections...
00
01 .note.android.ident .note.gnu.build-id .dynsym .gnu.version .gnu.version_r .gnu.hash .hash .dynstr .rela.dyn .rela.plt .rodata .eh_frame_hdr .eh_frame .text .plt
02 .data.rel.ro .fini_array .dynamic .got.plt
03 .dynamic
04 .data.rel.ro .fini_array .dynamic .got.plt
05 .eh_frame_hdr
06
07 .note.android.ident
08 .note.gnu.build-id

Dynamic section at offset 0xcd78 contains 29 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [liblog.so]
0x0000000000000001 (NEEDED) Shared library: [libandroid.so]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
0x0000000000000001 (NEEDED) Shared library: [libm.so]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so]
0x0000000000000001 (NEEDED) Shared library: [libdl.so]
0x000000000000000e (SONAME) Library soname: [libyvr.so]
0x000000000000001e (FLAGS) BIND_NOW
0x000000006ffffffb (FLAGS_1) Flags: NOW
0x0000000000000007 (RELA) 0xfb0
0x0000000000000008 (RELASZ) 72 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffff9 (RELACOUNT) 3
0x0000000000000017 (JMPREL) 0xff8
0x0000000000000002 (PLTRELSZ) 792 (bytes)
0x0000000000000003 (PLTGOT) 0xdf48
0x0000000000000014 (PLTREL) RELA
0x0000000000000006 (SYMTAB) 0x2f8
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000005 (STRTAB) 0xa30
0x000000000000000a (STRSZ) 1404 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x7e8
0x0000000000000004 (HASH) 0x8b8
0x000000000000001a (FINI_ARRAY) 0xdd68
0x000000000000001c (FINI_ARRAYSZ) 16 (bytes)
0x000000006ffffff0 (VERSYM) 0x748
0x000000006ffffffe (VERNEED) 0x7a4
0x000000006fffffff (VERNEEDNUM) 2
0x0000000000000000 (NULL) 0x0

Relocation section '.rela.dyn' at offset 0xfb0 contains 3 entries:
Offset Info Type Sym. Value Sym. Name + Addend
00000000dd60 000000000008 R_X86_64_RELATIVE dd60
00000000dd68 000000000008 R_X86_64_RELATIVE 1ae0
00000000dd70 000000000008 R_X86_64_RELATIVE 1ac0

Relocation section '.rela.plt' at offset 0xff8 contains 33 entries:
Offset Info Type Sym. Value Sym. Name + Addend
00000000df60 000200000007 R_X86_64_JUMP_SLO 0000000000000000 __cxa_finalize@LIBC + 0
00000000df68 000100000007 R_X86_64_JUMP_SLO 0000000000000000 __cxa_atexit@LIBC + 0
00000000df70 000500000007 R_X86_64_JUMP_SLO 0000000000000000 __strncpy_chk2@LIBC + 0
00000000df78 000400000007 R_X86_64_JUMP_SLO 0000000000000000 __strncat_chk@LIBC + 0
00000000df80 001500000007 R_X86_64_JUMP_SLO 000000000000a120 _ZN14toqupmLcoJik[...] + 0
00000000df88 001600000007 R_X86_64_JUMP_SLO 0000000000008d70 _ZN14toqupmLcoJik[...] + 0
00000000df90 001800000007 R_X86_64_JUMP_SLO 0000000000007d70 _ZN7_JNIEnv16Call[...] + 0
00000000df98 002400000007 R_X86_64_JUMP_SLO 0000000000007e30 _ZN7_JNIEnv13Call[...] + 0
00000000dfa0 001e00000007 R_X86_64_JUMP_SLO 000000000000c2f0 _ZN14toqupmLcoJik[...] + 0
00000000dfa8 001700000007 R_X86_64_JUMP_SLO 000000000000c3b0 _ZN14toqupmLcoJik[...] + 0
00000000dfb0 002200000007 R_X86_64_JUMP_SLO 000000000000c340 _ZN14toqupmLcoJik[...] + 0
00000000dfb8 002c00000007 R_X86_64_JUMP_SLO 0000000000007ef0 _ZN7_JNIEnv22Call[...] + 0
00000000dfc0 002b00000007 R_X86_64_JUMP_SLO 0000000000007fb0 _ZN7_JNIEnv14Call[...] + 0
00000000dfc8 002500000007 R_X86_64_JUMP_SLO 0000000000008070 _ZN7_JNIEnv9NewOb[...] + 0
00000000dfd0 000300000007 R_X86_64_JUMP_SLO 0000000000000000 __stack_chk_fail@LIBC + 0
00000000dfd8 001f00000007 R_X86_64_JUMP_SLO 0000000000008140 _ZN14toqupmLcoJik[...] + 0
00000000dfe0 000800000007 R_X86_64_JUMP_SLO 0000000000000000 __strcpy_chk@LIBC + 0
00000000dfe8 000e00000007 R_X86_64_JUMP_SLO 0000000000000000 strlen@LIBC + 0
00000000dff0 000d00000007 R_X86_64_JUMP_SLO 0000000000000000 strcmp@LIBC + 0
00000000dff8 000700000007 R_X86_64_JUMP_SLO 0000000000000000 __strcat_chk@LIBC + 0
00000000e000 000f00000007 R_X86_64_JUMP_SLO 0000000000000000 strstr@LIBC + 0
00000000e008 000600000007 R_X86_64_JUMP_SLO 0000000000000000 _Znam@LIBC_O + 0
00000000e010 000b00000007 R_X86_64_JUMP_SLO 0000000000000000 fopen@LIBC + 0
00000000e018 000c00000007 R_X86_64_JUMP_SLO 0000000000000000 fwrite@LIBC + 0
00000000e020 000a00000007 R_X86_64_JUMP_SLO 0000000000000000 fclose@LIBC + 0
00000000e028 001900000007 R_X86_64_JUMP_SLO 000000000000c770 _ZN12TPTDMtTzEevSC1Ev + 0
00000000e030 002300000007 R_X86_64_JUMP_SLO 000000000000c7e0 _ZN12TPTDMtTzEevS[...] + 0
00000000e038 000900000007 R_X86_64_JUMP_SLO 0000000000000000 calloc@LIBC + 0
00000000e040 002900000007 R_X86_64_JUMP_SLO 000000000000c530 _ZN12TPTDMtTzEevS[...] + 0
00000000e048 001100000007 R_X86_64_JUMP_SLO 0000000000000000 strcat@LIBC + 0
00000000e050 001000000007 R_X86_64_JUMP_SLO 0000000000000000 __vsprintf_chk@LIBC + 0
00000000e058 001200000007 R_X86_64_JUMP_SLO 0000000000000000 strncpy@LIBC + 0
00000000e060 001300000007 R_X86_64_JUMP_SLO 0000000000000000 strtol@LIBC + 0

The decoding of unwind sections for machine type Advanced Micro Devices X86-64 is not currently supported.

Symbol table '.dynsym' contains 46 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_atexit@LIBC (2)
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_f[...]@LIBC (2)
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __stack[...]@LIBC (2)
4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __strnc[...]@LIBC (2)
5: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __strnc[...]@LIBC (2)
6: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _Znam@LIBC_O (3)
7: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __strcat_chk@LIBC (2)
8: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __strcpy_chk@LIBC (2)
9: 0000000000000000 0 FUNC GLOBAL DEFAULT UND calloc@LIBC (2)
10: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fclose@LIBC (2)
11: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fopen@LIBC (2)
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fwrite@LIBC (2)
13: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strcmp@LIBC (2)
14: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strlen@LIBC (2)
15: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strstr@LIBC (2)
16: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __vspri[...]@LIBC (2)
17: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strcat@LIBC (2)
18: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strncpy@LIBC (2)
19: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strtol@LIBC (2)
20: 0000000000001b20 25164 FUNC GLOBAL DEFAULT 14 Java_com_theseey[...]
21: 000000000000a120 5445 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
22: 0000000000008d70 5032 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
23: 000000000000c3b0 151 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
24: 0000000000007d70 186 FUNC WEAK DEFAULT 14 _ZN7_JNIEnv16Cal[...]
25: 000000000000c770 1 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEevSC1Ev
26: 0000000000008130 1 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
27: 000000000000c510 21 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
28: 000000000000ca70 204 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
29: 000000000000c450 178 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
30: 000000000000c2f0 75 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
31: 0000000000008140 3117 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
32: 000000000000b670 3197 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
33: 000000000000c6b0 178 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
34: 000000000000c340 104 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
35: 000000000000c7e0 297 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
36: 0000000000007e30 186 FUNC WEAK DEFAULT 14 _ZN7_JNIEnv13Cal[...]
37: 0000000000008070 186 FUNC WEAK DEFAULT 14 _ZN7_JNIEnv9NewO[...]
38: 0000000000008130 1 FUNC GLOBAL DEFAULT 14 _ZN14toqupmLcoJi[...]
39: 000000000000c5f0 178 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
40: 000000000000c770 1 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEevSC2Ev
41: 000000000000c530 178 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
42: 000000000000c910 143 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]
43: 0000000000007fb0 186 FUNC WEAK DEFAULT 14 _ZN7_JNIEnv14Cal[...]
44: 0000000000007ef0 186 FUNC WEAK DEFAULT 14 _ZN7_JNIEnv22Cal[...]
45: 000000000000c780 89 FUNC GLOBAL DEFAULT 14 _ZN12TPTDMtTzEev[...]

Histogram for bucket list length (total of 46 buckets):
Length Number % of total Coverage
0 17 ( 37.0%)
1 15 ( 32.6%) 33.3%
2 12 ( 26.1%) 86.7%
3 2 ( 4.3%) 100.0%

Histogram for `.gnu.hash' bucket list length (total of 6 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 0 ( 0.0%) 0.0%
2 2 ( 33.3%) 15.4%
3 1 ( 16.7%) 26.9%
4 1 ( 16.7%) 42.3%
5 1 ( 16.7%) 61.5%
6 0 ( 0.0%) 61.5%
7 0 ( 0.0%) 61.5%
8 0 ( 0.0%) 61.5%
9 0 ( 0.0%) 61.5%
10 1 ( 16.7%) 100.0%

Version symbols section '.gnu.version' contains 46 entries:
Addr: 0x0000000000000748 Offset: 0x000748 Link: 3 (.dynsym)
000: 0 (local) 2 (LIBC) 2 (LIBC) 2 (LIBC)
004: 2 (LIBC) 2 (LIBC) 3 (LIBC_O) 2 (LIBC)
008: 2 (LIBC) 2 (LIBC) 2 (LIBC) 2 (LIBC)
00c: 2 (LIBC) 2 (LIBC) 2 (LIBC) 2 (LIBC)
010: 2 (LIBC) 2 (LIBC) 2 (LIBC) 2 (LIBC)
014: 1 (global) 1 (global) 1 (global) 1 (global)
018: 1 (global) 1 (global) 1 (global) 1 (global)
01c: 1 (global) 1 (global) 1 (global) 1 (global)
020: 1 (global) 1 (global) 1 (global) 1 (global)
024: 1 (global) 1 (global) 1 (global) 1 (global)
028: 1 (global) 1 (global) 1 (global) 1 (global)
02c: 1 (global) 1 (global)

Version needs section '.gnu.version_r' contains 2 entries:
Addr: 0x00000000000007a4 Offset: 0x0007a4 Link: 8 (.dynstr)
000000: Version: 1 File: libc.so Cnt: 1
0x0020: Name: LIBC Flags: none Version: 2
0x0010: Version: 1 File: libstdc++.so Cnt: 1
0x0030: Name: LIBC_O Flags: none Version: 3

Displaying notes found in: .note.android.ident
Owner Data size Description
Android 0x00000084 NT_VERSION (version)
description data: 15 00 00 00 72 32 32 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 31 37 31 36 37 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Displaying notes found in: .note.gnu.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: 4f56e77d8a3b4ffb48dc01b91cd98a56eb7ea386

@williballenthin
Copy link
Collaborator

ipdb> symbol
Symbol(name_offset=57184, value=8589934599, size=0, info=0, other=0, shndx=0)
ipdb> hex(symbol.name_offset)
'0xdf60'
ipdb> hex(len(self.strtab.buf))
'0x450'

doesn't seem like the symtab is long enough.

@williballenthin
Copy link
Collaborator

williballenthin commented Aug 14, 2023

this is an odd address:

ipdb> hex(symbol.value)
'0x200000007'

this string table doesn't seem to contain many strings:

ipdb> hexdump(self.strtab.buf)
00000000: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000010: 00 00 00 00 00 00 00 00  01 00 00 00 12 00 00 00  ................
00000020: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000030: 0E 00 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
00000040: 00 00 00 00 00 00 00 00  66 02 00 00 12 00 00 00  ........f.......
00000050: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000060: 77 02 00 00 12 00 00 00  00 00 00 00 00 00 00 00  w...............
00000070: 00 00 00 00 00 00 00 00  85 02 00 00 12 00 00 00  ................
00000080: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000090: 8B 03 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
000000A0: 00 00 00 00 00 00 00 00  91 03 00 00 12 00 00 00  ................
000000B0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
000000C0: 9E 03 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
000000D0: 00 00 00 00 00 00 00 00  AB 03 00 00 12 00 00 00  ................
000000E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
000000F0: B2 03 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
00000100: 00 00 00 00 00 00 00 00  B9 03 00 00 12 00 00 00  ................
00000110: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000120: BF 03 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
00000130: 00 00 00 00 00 00 00 00  C6 03 00 00 12 00 00 00  ................
00000140: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000150: CD 03 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
00000160: 00 00 00 00 00 00 00 00  D4 03 00 00 12 00 00 00  ................
00000170: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00000180: 03 05 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
00000190: 00 00 00 00 00 00 00 00  12 05 00 00 12 00 00 00  ................
000001A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
000001B0: 19 05 00 00 12 00 00 00  00 00 00 00 00 00 00 00  ................
000001C0: 00 00 00 00 00 00 00 00  21 05 00 00 12 00 00 00  ........!.......
000001D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
000001E0: 1D 00 00 00 12 00 0E 00  20 1B 00 00 00 00 00 00  ........ .......
000001F0: 4C 62 00 00 00 00 00 00  4C 00 00 00 12 00 0E 00  Lb......L.......
00000200: 20 A1 00 00 00 00 00 00  45 15 00 00 00 00 00 00   .......E.......
00000210: 85 00 00 00 12 00 0E 00  70 8D 00 00 00 00 00 00  ........p.......
00000220: A8 13 00 00 00 00 00 00  31 01 00 00 12 00 0E 00  ........1.......
00000230: B0 C3 00 00 00 00 00 00  97 00 00 00 00 00 00 00  ................
00000240: C5 01 00 00 22 00 0E 00  70 7D 00 00 00 00 00 00  ...."...p}......
00000250: BA 00 00 00 00 00 00 00  E1 02 00 00 12 00 0E 00  ................
00000260: 70 C7 00 00 00 00 00 00  01 00 00 00 00 00 00 00  p...............
00000270: 5B 03 00 00 12 00 0E 00  30 81 00 00 00 00 00 00  [.......0.......
00000280: 01 00 00 00 00 00 00 00  DB 03 00 00 12 00 0E 00  ................
00000290: 10 C5 00 00 00 00 00 00  15 00 00 00 00 00 00 00  ................
000002A0: FF 03 00 00 12 00 0E 00  70 CA 00 00 00 00 00 00  ........p.......
000002B0: CC 00 00 00 00 00 00 00  99 04 00 00 12 00 0E 00  ................
000002C0: 50 C4 00 00 00 00 00 00  B2 00 00 00 00 00 00 00  P...............
000002D0: BC 00 00 00 12 00 0E 00  F0 C2 00 00 00 00 00 00  ................
000002E0: 4B 00 00 00 00 00 00 00  F7 02 00 00 12 00 0E 00  K...............
000002F0: 40 81 00 00 00 00 00 00  2D 0C 00 00 00 00 00 00  @.......-.......
00000300: 22 03 00 00 12 00 0E 00  70 B6 00 00 00 00 00 00  ".......p.......
00000310: 7D 0C 00 00 00 00 00 00  C3 04 00 00 12 00 0E 00  }...............
00000320: B0 C6 00 00 00 00 00 00  B2 00 00 00 00 00 00 00  ................
00000330: F7 00 00 00 12 00 0E 00  40 C3 00 00 00 00 00 00  ........@.......
00000340: 68 00 00 00 00 00 00 00  94 02 00 00 12 00 0E 00  h...............
00000350: E0 C7 00 00 00 00 00 00  29 01 00 00 00 00 00 00  ........).......
00000360: 5C 01 00 00 22 00 0E 00  30 7E 00 00 00 00 00 00  \..."...0~......
00000370: BA 00 00 00 00 00 00 00  38 02 00 00 22 00 0E 00  ........8..."...
00000380: 70 80 00 00 00 00 00 00  BA 00 00 00 00 00 00 00  p...............
00000390: 73 03 00 00 12 00 0E 00  30 81 00 00 00 00 00 00  s.......0.......
000003A0: 01 00 00 00 00 00 00 00  6F 04 00 00 12 00 0E 00  ........o.......
000003B0: F0 C5 00 00 00 00 00 00  B2 00 00 00 00 00 00 00  ................
000003C0: ED 04 00 00 12 00 0E 00  70 C7 00 00 00 00 00 00  ........p.......
000003D0: 01 00 00 00 00 00 00 00  B7 02 00 00 12 00 0E 00  ................
000003E0: 30 C5 00 00 00 00 00 00  B2 00 00 00 00 00 00 00  0...............
000003F0: 49 04 00 00 12 00 0E 00  10 C9 00 00 00 00 00 00  I...............
00000400: 8F 00 00 00 00 00 00 00  90 01 00 00 22 00 0E 00  ............"...
00000410: B0 7F 00 00 00 00 00 00  BA 00 00 00 00 00 00 00  ................
00000420: FC 01 00 00 22 00 0E 00  F0 7E 00 00 00 00 00 00  ...."....~......
00000430: BA 00 00 00 00 00 00 00  24 04 00 00 12 00 0E 00  ........$.......
00000440: 80 C7 00 00 00 00 00 00  59 00 00 00 00 00 00 00  ........Y.......

we expect:

Section Headers:
[Nr] Name              Type             Address           Offset
Size              EntSize          Flags  Link  Info  Align
[ 3] .dynsym           DYNSYM           00000000000002f8  000002f8
0000000000000450  0000000000000018   A       8     1     8
[ 8] .dynstr           STRTAB           0000000000000a30  00000a30
000000000000057c  0000000000000000   A       0     0     1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants