Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Tool:vmlinux-to-elf

From ReverseEngineering.wiki
Tool
License GPL-3.0
Website https://github.com/marin-m/vmlinux-to-elf
On this wiki Facts · Code · Notes · Topics

GPL-3.0 Python tool that turns a raw or compressed Linux kernel image (vmlinux, vmlinuz, bzImage, zImage, Android boot.img) into an ELF with function and variable symbols recovered from the embedded kallsyms table.

What it does

Produces an ELF that IDA Pro or Ghidra can analyze from a kernel blob. It unpacks the container, finds the Format:Kallsyms tables by heuristics, infers architecture, endianness, bit size, entry point and base address, and writes the symbols into the ELF. Usage: vmlinux-to-elf <in> <out.elf>; kallsyms-finder <in> prints addresses in /proc/kallsyms style; vmlinuz-decompressor <in> <out> only decompresses.

Supported inputs

Compression detected automatically: XZ, LZMA, GZip, BZ2, LZ4, LZO and Zstd. Raw architectures detected (magics from binwalk): MIPSEL, MIPSEB, ARMEL, ARMEB, PowerPC, SPARC, x86, x86-64, ARM64, MIPS64, SuperH, ARC. Android boot.img starting ANDROID! or UNCOMPRESSED_IMG is unpacked (Format:Android boot image). Kernels from 2.6.10 on work if CONFIG_KALLSYMS was set; otherwise it raises a KallsymsNotFoundException.

Kernel version

The version is found by a regex over the image: Linux version (\d+\.[\d.]*\d)[ -~]+ (Fact:Linux kernel/string/Linux version banner); it picks the kallsyms layout.

Options

--e-machine, --bit-size, --file-offset (where the kernel starts in the file), --base-address, --bss-size (MB) and --use-absolute (treat kallsyms offsets as absolute addresses) override the heuristics when detection fails.

Code & repositories

  • https://github.com/marin-m/vmlinux-to-elf @ 2d094bc9c220b6b50f8215cbc3c9e581210ce1a6 · license: GPL-3.0
    vmlinux-to-elf (GPL-3.0): README and core/kallsyms.py read
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-16

See also

Platform:Linux kernel, Format:Linux x86 boot image (bzImage), Format:Linux arm64 Image.