]> git.proxmox.com Git - mirror_qemu.git/commit
contrib: add elf2dmp tool
authorViktor Prutyanov <viktor.prutyanov@virtuozzo.com>
Wed, 29 Aug 2018 12:41:25 +0000 (15:41 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Oct 2018 17:09:12 +0000 (19:09 +0200)
commit3fa2d384c245bcee3a9ecfa11f298b76ea4c9d57
treee6dc921bb305a9d2eb6f6a2d24dcd6f553856883
parenta52fbc37a46691762540b043c4cf5f9e7eb1a244
contrib: add elf2dmp tool

elf2dmp is a converter from ELF dump (produced by 'dump-guest-memory') to
Windows MEMORY.DMP format (also know as 'Complete Memory Dump') which can be
opened in WinDbg.

This tool can help if VMCoreInfo device/driver is absent in Windows VM and
'dump-guest-memory -w' is not available but dump can be created in ELF format.

The tool works as follows:
1. Determine the system paging root looking at GS_BASE or KERNEL_GS_BASE
to locate the PRCB structure and finds the kernel CR3 nearby if QEMU CPU
state CR3 is not suitable.
2. Find an address within the kernel image by dereferencing the first
IDT entry and scans virtual memory upwards until the start of the
kernel.
3. Download a PDB matching the kernel from the Microsoft symbol store,
and figure out the layout of certain relevant structures necessary for
the dump.
4. Populate the corresponding structures in the memory image and create
the appropriate dump header.

Signed-off-by: Viktor Prutyanov <viktor.prutyanov@virtuozzo.com>
Message-Id: <1535546488-30208-3-git-send-email-viktor.prutyanov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
16 files changed:
Makefile
Makefile.objs
configure
contrib/elf2dmp/Makefile.objs [new file with mode: 0644]
contrib/elf2dmp/addrspace.c [new file with mode: 0644]
contrib/elf2dmp/addrspace.h [new file with mode: 0644]
contrib/elf2dmp/download.c [new file with mode: 0644]
contrib/elf2dmp/download.h [new file with mode: 0644]
contrib/elf2dmp/err.h [new file with mode: 0644]
contrib/elf2dmp/kdbg.h [new file with mode: 0644]
contrib/elf2dmp/main.c [new file with mode: 0644]
contrib/elf2dmp/pdb.c [new file with mode: 0644]
contrib/elf2dmp/pdb.h [new file with mode: 0644]
contrib/elf2dmp/pe.h [new file with mode: 0644]
contrib/elf2dmp/qemu_elf.c [new file with mode: 0644]
contrib/elf2dmp/qemu_elf.h [new file with mode: 0644]