marin-m / vmlinux-to-elf

A tool to recover a fully analyzable .ELF from a raw kernel, through extracting the kernel symbol table (kallsyms)
GNU General Public License v3.0
1.37k stars 131 forks source link

Could not find kallsyms_names for Ubuntu Kernel #61

Open Kyle-Kyle opened 9 months ago

Kyle-Kyle commented 9 months ago

I receive the following error when trying to use the project on Linux v6.5.0, which is Ubuntu's kernel.

[+] Kernel successfully decompressed in-memory (the offsets that follow will be given relative to the decompressed binary)
[+] Version string: Linux version 6.5.0-17-generic (buildd@lcy02-amd64-034) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) #17-Ubuntu SMP PREEMPT_DYNAMIC  (Ubuntu 6.5.0-17.17-generic 6.5.8)
[+] Guessed architecture: x86_64 successfully in 5.91 seconds
[+] Found kallsyms_token_table at file offset 0x01a27688
[+] Found kallsyms_token_index at file offset 0x01a27a00
[+] Found kallsyms_markers at file offset 0x01a26ab0
Traceback (most recent call last):
  File "/vmlinux-to-elf/./vmlinux-to-elf", line 63, in <module>
    ElfSymbolizer(
  File "/vmlinux-to-elf/vmlinux_to_elf/elf_symbolizer.py", line 44, in __init__
    kallsyms_finder = KallsymsFinder(file_contents, bit_size)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vmlinux-to-elf/vmlinux_to_elf/kallsyms_finder.py", line 212, in __init__
    self.find_kallsyms_num_syms()
  File "/vmlinux-to-elf/vmlinux_to_elf/kallsyms_finder.py", line 774, in find_kallsyms_num_syms
    raise ValueError('Could not find kallsyms_names')
ValueError: Could not find kallsyms_names
Kyle-Kyle commented 9 months ago

the file is attached here. vmlinuz.tar.gz

0ddc0de commented 6 months ago

Yo @Kyle-Kyle,

I ran into the same issue for a 4.4.23 kernel extracted from an Android phone. Did you manage to work around this?

Kyle-Kyle commented 5 months ago

@0ddc0de yoyo! Unfortunately, I don't remember what happened afterwards. My guess is that I didn't solve the issue..