Skip to content

Commit

Permalink
MMAP_MIN_ADDR is zero if debugging a kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Feb 27, 2017
1 parent 51a4854 commit a2cc06d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pwndbg/memory.py
Expand Up @@ -15,6 +15,8 @@

import pwndbg.arch
import pwndbg.compat
import pwndbg.events
import pwndbg.qemu
import pwndbg.typeinfo

PAGE_SIZE = 0x1000
Expand Down Expand Up @@ -225,3 +227,9 @@ def __lt__(self, other):
return self.vaddr < getattr(other, 'vaddr', other)
def __hash__(self):
return hash((self.vaddr, self.memsz, self.flags, self.offset, self.objfile))

@pwndbg.events.start
def update_min_addr():
global MMAP_MIN_ADDR
if pwndbg.qemu.is_qemu_kernel():
MMAP_MIN_ADDR=0

0 comments on commit a2cc06d

Please sign in to comment.