disasm ¤
Functionality for disassmebling code at an address, or at an address ± a few instructions.
Modules:
Functions:
-
enhance_cache_listener– -
clear_on_reg_mem_change– -
get_disassembler_cached– -
get_disassembler– -
get_one_instruction–If passed an emulator, this will pass it to the DisassemblyAssistant which will
-
one– -
one_raw– -
get– -
can_run_first_emulate–Disable the emulate config variable if we don't have enough memory to use it
-
no_emulate_one– -
emulate_one– -
one_with_config–Returns a single Pwndbg Instruction at the current PC.
-
near–Disasms instructions near given
address. Passingemulatemakes use of
Attributes:
-
CapstoneArch– -
CapstoneEndian– -
CapstoneMode– -
CapstoneSyntax– -
VariableInstructionSizeMax– -
next_addresses_cache(set[int]) – -
backward_cache(DefaultDict[int, int]) – -
computed_instruction_cache(DefaultDict[int, PwndbgInstruction]) – -
emulated_arm_mode_cache(DefaultDict[int, int]) – -
first_time_emulate–
CapstoneArch module-attribute ¤
CapstoneArch = {
"arm": CS_ARCH_ARM,
"armcm": CS_ARCH_ARM,
"aarch64": CS_ARCH_ARM64,
"i386": CS_ARCH_X86,
"i8086": CS_ARCH_X86,
"x86-64": CS_ARCH_X86,
"powerpc": CS_ARCH_PPC,
"mips": CS_ARCH_MIPS,
"sparc": CS_ARCH_SPARC,
"rv32": CS_ARCH_RISCV,
"rv64": CS_ARCH_RISCV,
}
CapstoneEndian module-attribute ¤
CapstoneSyntax module-attribute ¤
VariableInstructionSizeMax module-attribute ¤
VariableInstructionSizeMax = {
"i386": 16,
"x86-64": 16,
"i8086": 16,
"mips": 8,
"rv32": 22,
"rv64": 22,
}
computed_instruction_cache module-attribute ¤
computed_instruction_cache: DefaultDict[int, PwndbgInstruction] = defaultdict(
lambda: None
)
emulated_arm_mode_cache module-attribute ¤
get_one_instruction ¤
get_one_instruction(
address,
emu: Emulator = None,
enhance=True,
from_cache=False,
put_cache=False,
) -> PwndbgInstruction
If passed an emulator, this will pass it to the DisassemblyAssistant which will single_step the emulator to determine the operand values before and after the instruction executes.
one ¤
one(
address=None,
emu: Emulator = None,
enhance=True,
from_cache=False,
put_cache=False,
put_backward_cache=True,
) -> PwndbgInstruction | None
get ¤
get(
address,
instructions=1,
emu: Emulator = None,
enhance=True,
from_cache=False,
put_cache=False,
) -> list[PwndbgInstruction]
can_run_first_emulate ¤
Disable the emulate config variable if we don't have enough memory to use it See #1534 And unicorn-engine/unicorn!1743
one_with_config ¤
Returns a single Pwndbg Instruction at the current PC.
Emulation determined by the pwndbg.config.emulate setting.
near ¤
near(
address,
instructions=1,
emulate=False,
show_prev_insns=True,
use_cache=False,
linear=False,
) -> tuple[list[PwndbgInstruction], int]
Disasms instructions near given address. Passing emulate makes use of unicorn engine to emulate instructions to predict branches that will be taken. show_prev_insns makes this show previously cached instructions (this is mostly used by context's disasm display, so user see what was previously)