nearpc ¤
Classes:
Functions:
-
ljust_padding–Returns (list of padded strings, max length of string)
-
colorize_branch_vis_line– -
preprocess_branch_visualization–Returns (pair_map dictionary,pair_id dictionary, maximum_pair_id)
-
create_branch_visualization_strings–Returns tuple of (string, string for empty line)
-
nearpc–Disassemble near a specified address.
Attributes:
-
c– -
nearpc_branch_marker– -
nearpc_branch_marker_contiguous– -
show_args– -
show_opcode_bytes– -
opcode_separator_bytes– -
COLUMNS_ALLOCATED_FOR_BRANCH_VISUALIZATION– -
TOP_LEFT_CORNER– -
BOT_LEFT_CORNER– -
HORZ_SYMBOL– -
VERT_SYMBOL– -
START_SYMBOL– -
END_SYMBOL– -
DOTTED_VERTICAL– -
UP_SYMBOL– -
offset_to_color_map– -
last_run_ids(dict[JumpRange, int]) –
c module-attribute ¤
c = ColorConfig(
"nearpc",
[
ColorParamSpec("symbol", "normal", "color for nearpc command (symbol)"),
ColorParamSpec(
"address", "normal", "color for nearpc command (address)"
),
ColorParamSpec(
"prefix", "none", "color for nearpc command (prefix marker)"
),
ColorParamSpec(
"breakpoint", "red", "color for nearpc command (breakpoint marker)"
),
ColorParamSpec(
"syscall-name",
"red",
"color for nearpc command (resolved syscall name)",
),
ColorParamSpec(
"argument", "bold", "color for nearpc command (target argument)"
),
ColorParamSpec(
"integration-comments",
"bold",
"color for nearpc command (integration comments)",
),
ColorParamSpec(
"branch-marker",
"normal",
"color for nearpc command (branch marker line)",
),
],
)
nearpc_branch_marker module-attribute ¤
nearpc_branch_marker = add_param(
"nearpc-branch-marker", " ↓", "branch marker line for nearpc command"
)
nearpc_branch_marker_contiguous module-attribute ¤
nearpc_branch_marker_contiguous = add_param(
"nearpc-branch-marker-contiguous",
" ",
"contiguous branch marker line for nearpc command",
)
show_args module-attribute ¤
show_args = add_param(
"nearpc-show-args", True, "whether to show call arguments below instruction"
)
show_opcode_bytes module-attribute ¤
show_opcode_bytes = add_param(
"nearpc-num-opcode-bytes",
0,
"number of opcode bytes to print for each instruction",
param_class=PARAM_ZUINTEGER,
)
opcode_separator_bytes module-attribute ¤
opcode_separator_bytes = add_param(
"nearpc-opcode-separator-bytes",
1,
"number of spaces between opcode bytes",
param_class=PARAM_ZUINTEGER,
)
COLUMNS_ALLOCATED_FOR_BRANCH_VISUALIZATION module-attribute ¤
offset_to_color_map module-attribute ¤
offset_to_color_map = {
0: white,
1: red,
2: green,
3: purple,
4: blue,
5: white,
6: yellow,
7: light_red,
8: light_purple,
9: light_gray,
10: light_green,
}
JumpRange ¤
Methods:
Attributes:
ljust_padding ¤
Returns (list of padded strings, max length of string)
preprocess_branch_visualization ¤
preprocess_branch_visualization(
instructions: list[PwndbgInstruction], repeat: bool
) -> tuple[dict[int, list[JumpRange]], dict[JumpRange, int], int]
Returns (pair_map dictionary,pair_id dictionary, maximum_pair_id)
create_branch_visualization_strings ¤
create_branch_visualization_strings(
pair_map: dict[int, list[JumpRange]],
pair_id: dict[JumpRange, int],
maximum_pair_id: int,
addr: int,
is_first_address: bool,
) -> tuple[str, str]
Returns tuple of (string, string for empty line)
nearpc ¤
nearpc(
pc: int | None = None,
lines: int | None = None,
back_lines: int = 0,
total_lines: int | None = None,
emulate=False,
repeat=False,
use_cache=False,
linear=False,
branch_visualization=False,
end_address: int | None = None,
) -> list[str]
Disassemble near a specified address.
The linear argument specifies if we should disassemble linearly in memory, or take jumps into account