You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thank you for this great tool! In the end I was able to get it working with my boot image: boot.zip
However, I needed some hacks I at least wanted to document here. I am not knowledgeable enough to properly fix those issues, but these should give at least some hints.
First of all, I was affected by #54 (my boot.img has ikconfig and it shows that it is definitely not using relative base), so I used a quick & dirty patch to get my boot image to parse without negative offsets:
diff --git a/vmlinux_to_elf/kallsyms_finder.py b/vmlinux_to_elf/kallsyms_finder.py
index 5279192..8bbc3ae 100755
--- a/vmlinux_to_elf/kallsyms_finder.py
+++ b/vmlinux_to_elf/kallsyms_finder.py
@@ -853,7 +853,7 @@ class KallsymsFinder:
and 'ia64' not in self.version_string.lower()
and 'itanium' not in self.version_string.lower()):
- likely_has_base_relative = True
+ likely_has_base_relative = False
# Does the system seem to be 64-bits?
After that, I had a valid ELF file that Ghidra was importing just fine, however all symbols were garbled, some examples:
I was able to fix that by following a quick procedure:
Call kallsyms-finder (with applied relative fix) and save the first line of actual output (ffffff8008080800 T do_undefinstr)
On another note, interestingly, /proc/kallsyms on the device has different offsets: ffffff9887480800 T do_undefinstr
However, this does not seem to impact disassembling software.
On another note, interestingly, /proc/kallsyms on the device has different offsets: ffffff9887480800 T do_undefinstr However, this does not seem to impact disassembling software.
btw I think this difference is because the ones you dump from /proc/kallsyms have been subjected to ASLR
Hi,
thank you for this great tool! In the end I was able to get it working with my boot image: boot.zip
However, I needed some hacks I at least wanted to document here. I am not knowledgeable enough to properly fix those issues, but these should give at least some hints.
First of all, I was affected by #54 (my boot.img has ikconfig and it shows that it is definitely not using relative base), so I used a quick & dirty patch to get my boot image to parse without negative offsets:
After that, I had a valid ELF file that Ghidra was importing just fine, however all symbols were garbled, some examples:
I was able to fix that by following a quick procedure:
ffffff8008080800 T do_undefinstr
)vmlinux-to-elf/vmlinux_to_elf/elf_symbolizer.py
Line 83 in fa5c930
./vmlinux-to-elf --base-address 0xffffff8008080000 boot.img new2.elf
Now the symbols resolve properly:
I hope this information aids you in resolving the issues in the script.
Regards,
Nick
The text was updated successfully, but these errors were encountered: