2 * Copyright (c) 2018 Virtuozzo International GmbH
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 #ifndef ELF2DMP_QEMU_ELF_H
8 #define ELF2DMP_QEMU_ELF_H
12 typedef struct QEMUCPUSegment
{
20 typedef struct QEMUCPUState
{
23 uint64_t rax
, rbx
, rcx
, rdx
, rsi
, rdi
, rsp
, rbp
;
24 uint64_t r8
, r9
, r10
, r11
, r12
, r13
, r14
, r15
;
26 QEMUCPUSegment cs
, ds
, es
, fs
, gs
, ss
;
27 QEMUCPUSegment ldt
, tr
, gdt
, idt
;
29 uint64_t kernel_gs_base
;
32 int is_system(QEMUCPUState
*s
);
34 typedef struct QEMU_Elf
{
40 int has_kernel_gs_base
;
43 int QEMU_Elf_init(QEMU_Elf
*qe
, const char *filename
);
44 void QEMU_Elf_exit(QEMU_Elf
*qe
);
46 Elf64_Phdr
*elf64_getphdr(void *map
);
47 Elf64_Half
elf_getphdrnum(void *map
);
49 #endif /* ELF2DMP_QEMU_ELF_H */