|
|
|
@ -1,5 +1,7 @@
|
|
|
|
import functools
|
|
|
|
import functools
|
|
|
|
import math
|
|
|
|
import math
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
from typing import Tuple
|
|
|
|
|
|
|
|
|
|
|
|
import gdb
|
|
|
|
import gdb
|
|
|
|
|
|
|
|
|
|
|
|
@ -76,6 +78,15 @@ def kversion() -> str:
|
|
|
|
return pwndbg.gdblib.memory.string(version_addr).decode("ascii").strip()
|
|
|
|
return pwndbg.gdblib.memory.string(version_addr).decode("ascii").strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@requires_debug_syms()
|
|
|
|
|
|
|
|
@pwndbg.lib.memoize.reset_on_start
|
|
|
|
|
|
|
|
def krelease() -> Tuple[int, ...]:
|
|
|
|
|
|
|
|
match = re.search(r"Linux version (\d+)\.(\d+)(?:\.(\d+))?", kversion())
|
|
|
|
|
|
|
|
if match:
|
|
|
|
|
|
|
|
return tuple(int(x) for x in match.groups() if x)
|
|
|
|
|
|
|
|
raise Exception("Linux version tuple not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@requires_debug_syms()
|
|
|
|
@requires_debug_syms()
|
|
|
|
@pwndbg.lib.memoize.reset_on_start
|
|
|
|
@pwndbg.lib.memoize.reset_on_start
|
|
|
|
def is_kaslr_enabled() -> bool:
|
|
|
|
def is_kaslr_enabled() -> bool:
|
|
|
|
|