mirror of https://github.com/pwndbg/pwndbg.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
668 B
Python
37 lines
668 B
Python
from __future__ import annotations
|
|
|
|
from typing import Literal
|
|
|
|
from typing_extensions import override
|
|
|
|
import pwndbg
|
|
|
|
|
|
class MockArch(pwndbg.dbg_mod.Arch):
|
|
@override
|
|
def ptrsize(self) -> int:
|
|
return 8
|
|
|
|
@override
|
|
def arch(self) -> str:
|
|
return "x86-64"
|
|
|
|
@override
|
|
def endian(self) -> Literal["little", "big"]:
|
|
return "little"
|
|
|
|
|
|
class MockInferior(pwndbg.dbg_mod.Process):
|
|
@override
|
|
def arch(self) -> dbg_mod.Arch:
|
|
return MockArch()
|
|
|
|
|
|
class MockDebugger(pwndbg.dbg_mod.Debugger):
|
|
@override
|
|
def selected_inferior(self) -> dbg_mod.Process:
|
|
return MockInferior()
|
|
|
|
|
|
pwndbg.dbg = MockDebugger()
|