Skip to content

Instantly share code, notes, and snippets.

View Furao's full-sized avatar

Robbie VanVossen Furao

  • DornerWorks
  • Grand Rapids, MI
View GitHub Profile
@Furao
Furao / x86_pt_dump.c
Created March 19, 2025 15:13
x86 mmu table dump
#define NX_BIT 0x8000000000000000ULL
#define WR_BIT (1<<1)
#define PS_BIT (1<<7)
#define TABLE_LEN 512
#define ADDR_MASK (~0xFFFULL)
void dump_entry(uint64_t paddr, uint64_t entry, int level) {
bool ex = (entry & NX_BIT) == 0;
bool w = (entry & WR_BIT) != 0;