*
*/
+#include <inttypes.h>
+
#include "qemu/osdep.h"
#include "err.h"
#include "addrspace.h"
#define KUSD_OFFSET_PRODUCT_TYPE 0x264
#define SYM_RESOLVE(base, r, s) ((s = pdb_resolve(base, r, #s)),\
- s ? printf(#s" = 0x%016lx\n", s) : eprintf("Failed to resolve "#s"\n"), s)
+ s ? printf(#s" = 0x%016"PRIx64"\n", s) :\
+ eprintf("Failed to resolve "#s"\n"), s)
static uint64_t rol(uint64_t x, uint64_t y)
{
return NULL;
}
- printf("[KiWaitNever] = 0x%016lx\n", kwn);
- printf("[KiWaitAlways] = 0x%016lx\n", kwa);
+ printf("[KiWaitNever] = 0x%016"PRIx64"\n", kwn);
+ printf("[KiWaitAlways] = 0x%016"PRIx64"\n", kwa);
/*
* If KDBG header can be decoded, KDBG size is available
if (is_system(s)) {
va_space_set_dtb(vs, s->cr[3]);
- printf("DTB 0x%016lx has been found from CPU #%zu"
+ printf("DTB 0x%016"PRIx64" has been found from CPU #%zu"
" as system task CR3\n", vs->dtb, i);
return !(va_space_resolve(vs, SharedUserData));
}
}
va_space_set_dtb(vs, *cr3);
- printf("DirectoryTableBase = 0x%016lx has been found from CPU #0"
+ printf("DirectoryTableBase = 0x%016"PRIx64" has been found from CPU #0"
" as interrupt handling CR3\n", vs->dtb);
return !(va_space_resolve(vs, SharedUserData));
}
return 1;
}
- printf("Debug Directory RVA = 0x%016x\n",
- data_dir[IMAGE_FILE_DEBUG_DIRECTORY].VirtualAddress);
+ printf("Debug Directory RVA = 0x%08"PRIx32"\n",
+ (uint32_t)data_dir[IMAGE_FILE_DEBUG_DIRECTORY].VirtualAddress);
if (va_space_rw(vs,
base + data_dir[IMAGE_FILE_DEBUG_DIRECTORY].VirtualAddress,
}
state = qemu_elf.state[0];
- printf("CPU #0 CR3 is 0x%016lx\n", state->cr[3]);
+ printf("CPU #0 CR3 is 0x%016"PRIx64"\n", state->cr[3]);
va_space_create(&vs, &ps, state->cr[3]);
if (fix_dtb(&vs, &qemu_elf)) {
goto out_elf;
}
- printf("CPU #0 IDT is at 0x%016lx\n", state->idt.base);
+ printf("CPU #0 IDT is at 0x%016"PRIx64"\n", state->idt.base);
if (va_space_rw(&vs, state->idt.base,
&first_idt_desc, sizeof(first_idt_desc), 0)) {
err = 1;
goto out_ps;
}
- printf("CPU #0 IDT[0] -> 0x%016lx\n", idt_desc_addr(first_idt_desc));
+ printf("CPU #0 IDT[0] -> 0x%016"PRIx64"\n", idt_desc_addr(first_idt_desc));
KernBase = idt_desc_addr(first_idt_desc) & ~(PAGE_SIZE - 1);
- printf("Searching kernel downwards from 0x%16lx...\n", KernBase);
+ printf("Searching kernel downwards from 0x%016"PRIx64"...\n", KernBase);
for (; KernBase >= 0xfffff78000000000; KernBase -= PAGE_SIZE) {
nt_start_addr = va_space_resolve(&vs, KernBase);
}
}
- printf("KernBase = 0x%16lx, signature is \'%.2s\'\n", KernBase,
+ printf("KernBase = 0x%016"PRIx64", signature is \'%.2s\'\n", KernBase,
(char *)nt_start_addr);
if (pe_get_pdb_symstore_hash(KernBase, nt_start_addr, pdb_hash, &vs)) {
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <inttypes.h>
+
#include "qemu/osdep.h"
#include "pdb.h"
#include "err.h"
uint32_t sect_rva = segment->dword[1];
uint64_t rva = sect_rva + sym->public_v3.offset;
- printf("%s: 0x%016x(%d:\'%.8s\') + 0x%08x = 0x%09lx\n", name,
+ printf("%s: 0x%016x(%d:\'%.8s\') + 0x%08x = 0x%09"PRIx64"\n", name,
sect_rva, sym->public_v3.segment,
((char *)segment - 8), sym->public_v3.offset, rva);
return rva;