Package winappdbg :: Module interactive :: Class ConsoleDebugger
[hide private]
[frames] | no frames]

Class ConsoleDebugger

source code


Interactive console debugger.


See Also: Debug.interactive

Nested Classes [hide private]
  command_error_exception
Exception raised when a command parsing error occurs.
  _PythonExit
Instance Methods [hide private]
 
__init__(self)
Interactive console debugger.
source code
 
start_using_debugger(self, debug) source code
 
stop_using_debugger(self) source code
 
destroy_debugger(self, autodetach=True) source code
 
set_fake_last_event(self, process) source code
 
join_tokens(self, token_list) source code
 
split_tokens(self, arg, min_count=0, max_count=None) source code
 
input_thread(self, token) source code
 
input_thread_list(self, token_list) source code
 
input_process(self, token) source code
 
input_process_list(self, token_list) source code
 
input_command_line(self, command_line) source code
 
input_hexadecimal_integer(self, token) source code
 
input_integer(self, token) source code
 
input_address(self, token, pid=None, tid=None) source code
 
input_address_range(self, token_list, pid=None, tid=None) source code
 
is_register(self, token) source code
 
input_register(self, token, tid=None) source code
 
input_full_address_range(self, token_list) source code
 
input_breakpoint(self, token_list) source code
 
input_display(self, token_list, default_size=64) source code
 
print_module_load(self, event) source code
 
print_module_unload(self, event) source code
 
print_process_start(self, event) source code
 
print_thread_start(self, event) source code
 
print_process_end(self, event) source code
 
print_thread_end(self, event) source code
 
print_debug_string(self, event) source code
 
print_event(self, event) source code
 
print_exception(self, event) source code
 
print_event_location(self, event) source code
 
print_breakpoint_location(self, event) source code
 
print_current_location(self, process=None, thread=None, pc=None) source code
 
print_memory_display(self, arg, method) source code
 
get_process_id_from_prefix(self) source code
 
get_thread_id_from_prefix(self) source code
 
get_process_from_prefix(self) source code
 
get_thread_from_prefix(self) source code
 
get_process_and_thread_ids_from_prefix(self) source code
 
get_process_and_thread_from_prefix(self) source code
 
get_process(self, pid=None) source code
 
get_thread(self, tid=None) source code
 
read_memory(self, address, size, pid=None) source code
 
write_memory(self, address, data, pid=None) source code
 
change_register(self, register, value, tid=None) source code
 
find_in_memory(self, query, process) source code
 
kill_process(self, pid) source code
 
kill_thread(self, tid) source code
 
prompt_user(self) source code
 
ask_user(self, msg, prompt='Are you sure? (y/N): ') source code
 
autocomplete(self, cmd) source code
 
get_help(self, commands) source code
 
split_prefix(self, line) source code
 
get_names(self) source code
 
parseline(self, line)
Parse the line into a command name and a string containing the arguments.
source code
 
preloop(self)
Hook method executed once when the cmdloop() method is called.
source code
 
get_lastcmd(self) source code
 
set_lastcmd(self, lastcmd) source code
 
postcmd(self, stop, line)
Hook method executed just after a command dispatch is finished.
source code
 
do_help(self, arg)
? - show the list of available commands ? * - show help for all commands ? <command> [command...] - show help for the given command(s) help - show the list of available commands help * - show help for all commands help <command> [command...] - show help for the given command(s)
source code
 
do_shell(self, arg)
! - spawn a system shell shell - spawn a system shell ! <command> [arguments...] - execute a single shell command shell <command> [arguments...] - execute a single shell command
source code
 
_spawn_python_shell(self, arg) source code
 
do_python(self, arg)
# - spawn a python interpreter python - spawn a python interpreter # <statement> - execute a single python statement python <statement> - execute a single python statement
source code
 
do_plugin(self, arg)
[~prefix] .<name> [arguments] - run a plugin command [~prefix] plugin <name> [arguments] - run a plugin command
source code
 
do_quit(self, arg)
quit - close the debugging session q - close the debugging session
source code
 
do_q(self, arg)
quit - close the debugging session q - close the debugging session
source code
 
do_attach(self, arg)
attach <target> [target...] - attach to the given process(es)
source code
 
do_detach(self, arg)
[~process] detach - detach from the current process detach - detach from the current process detach <target> [target...] - detach from the given process(es)
source code
 
do_windowed(self, arg)
windowed <target> [arguments...] - run a windowed program for debugging
source code
 
do_console(self, arg)
console <target> [arguments...] - run a console program for debugging
source code
 
do_continue(self, arg)
continue - continue execution g - continue execution go - continue execution
source code
 
do_g(self, arg)
continue - continue execution g - continue execution go - continue execution
source code
 
do_go(self, arg)
continue - continue execution g - continue execution go - continue execution
source code
 
do_gh(self, arg)
gh - go with exception handled
source code
 
do_gn(self, arg)
gn - go with exception not handled
source code
 
do_refresh(self, arg)
refresh - refresh the list of running processes and threads [~process] refresh - refresh the list of running threads
source code
 
do_processlist(self, arg)
pl - show the processes being debugged processlist - show the processes being debugged
source code
 
do_pl(self, arg)
pl - show the processes being debugged processlist - show the processes being debugged
source code
 
do_threadlist(self, arg)
tl - show the threads being debugged threadlist - show the threads being debugged
source code
 
do_tl(self, arg)
tl - show the threads being debugged threadlist - show the threads being debugged
source code
 
do_kill(self, arg)
[~process] kill - kill a process [~thread] kill - kill a thread kill - kill the current process kill * - kill all debugged processes kill <processes and/or threads...> - kill the given processes and threads
source code
 
do_modload(self, arg)
[~process] modload <filename.dll> - load a DLL module
source code
 
do_stack(self, arg)
[~thread] k - show the stack trace [~thread] stack - show the stack trace
source code
 
do_k(self, arg)
[~thread] k - show the stack trace [~thread] stack - show the stack trace
source code
 
do_break(self, arg)
break - force a debug break in all debugees break <process> [process...] - force a debug break
source code
 
do_step(self, arg)
p - step on the current assembly instruction next - step on the current assembly instruction step - step on the current assembly instruction
source code
 
do_p(self, arg)
p - step on the current assembly instruction next - step on the current assembly instruction step - step on the current assembly instruction
source code
 
do_next(self, arg)
p - step on the current assembly instruction next - step on the current assembly instruction step - step on the current assembly instruction
source code
 
do_trace(self, arg)
t - trace at the current assembly instruction trace - trace at the current assembly instruction
source code
 
do_t(self, arg)
t - trace at the current assembly instruction trace - trace at the current assembly instruction
source code
 
do_bp(self, arg)
[~process] bp <address> - set a code breakpoint
source code
 
do_ba(self, arg)
[~thread] ba <a|w|e> <1|2|4|8> <address> - set hardware breakpoint
source code
 
do_bm(self, arg)
[~process] bm <address-address> - set memory breakpoint
source code
 
do_bl(self, arg)
bl - list the breakpoints for the current process bl * - list the breakpoints for all processes [~process] bl - list the breakpoints for the given process bl <process> [process...] - list the breakpoints for each given process
source code
 
do_bo(self, arg)
[~process] bo <address> - make a code breakpoint one-shot [~thread] bo <address> - make a hardware breakpoint one-shot [~process] bo <address-address> - make a memory breakpoint one-shot [~process] bo <address> <size> - make a memory breakpoint one-shot
source code
 
do_be(self, arg)
[~process] be <address> - enable a code breakpoint [~thread] be <address> - enable a hardware breakpoint [~process] be <address-address> - enable a memory breakpoint [~process] be <address> <size> - enable a memory breakpoint
source code
 
do_bd(self, arg)
[~process] bd <address> - disable a code breakpoint [~thread] bd <address> - disable a hardware breakpoint [~process] bd <address-address> - disable a memory breakpoint [~process] bd <address> <size> - disable a memory breakpoint
source code
 
do_bc(self, arg)
[~process] bc <address> - clear a code breakpoint [~thread] bc <address> - clear a hardware breakpoint [~process] bc <address-address> - clear a memory breakpoint [~process] bc <address> <size> - clear a memory breakpoint
source code
 
do_disassemble(self, arg)
[~thread] u [register] - show code disassembly [~process] u [address] - show code disassembly [~thread] disassemble [register] - show code disassembly [~process] disassemble [address] - show code disassembly
source code
 
do_u(self, arg)
[~thread] u [register] - show code disassembly [~process] u [address] - show code disassembly [~thread] disassemble [register] - show code disassembly [~process] disassemble [address] - show code disassembly
source code
 
do_search(self, arg)
[~process] s [address-address] <search string> [~process] search [address-address] <search string>
source code
 
do_s(self, arg)
[~process] s [address-address] <search string> [~process] search [address-address] <search string>
source code
 
do_searchhex(self, arg)
[~process] sh [address-address] <hexadecimal pattern> [~process] searchhex [address-address] <hexadecimal pattern>
source code
 
do_sh(self, arg)
[~process] sh [address-address] <hexadecimal pattern> [~process] searchhex [address-address] <hexadecimal pattern>
source code
 
do_d(self, arg)
[~thread] d <register> - show memory contents [~thread] d <register-register> - show memory contents [~thread] d <register> <size> - show memory contents [~process] d <address> - show memory contents [~process] d <address-address> - show memory contents [~process] d <address> <size> - show memory contents
source code
 
do_db(self, arg)
[~thread] db <register> - show memory contents as bytes [~thread] db <register-register> - show memory contents as bytes [~thread] db <register> <size> - show memory contents as bytes [~process] db <address> - show memory contents as bytes [~process] db <address-address> - show memory contents as bytes [~process] db <address> <size> - show memory contents as bytes
source code
 
do_dw(self, arg)
[~thread] dw <register> - show memory contents as words [~thread] dw <register-register> - show memory contents as words [~thread] dw <register> <size> - show memory contents as words [~process] dw <address> - show memory contents as words [~process] dw <address-address> - show memory contents as words [~process] dw <address> <size> - show memory contents as words
source code
 
do_dd(self, arg)
[~thread] dd <register> - show memory contents as dwords [~thread] dd <register-register> - show memory contents as dwords [~thread] dd <register> <size> - show memory contents as dwords [~process] dd <address> - show memory contents as dwords [~process] dd <address-address> - show memory contents as dwords [~process] dd <address> <size> - show memory contents as dwords
source code
 
do_dq(self, arg)
[~thread] dq <register> - show memory contents as qwords [~thread] dq <register-register> - show memory contents as qwords [~thread] dq <register> <size> - show memory contents as qwords [~process] dq <address> - show memory contents as qwords [~process] dq <address-address> - show memory contents as qwords [~process] dq <address> <size> - show memory contents as qwords
source code
 
do_ds(self, arg)
[~thread] ds <register> - show memory contents as ANSI string [~process] ds <address> - show memory contents as ANSI string
source code
 
do_du(self, arg)
[~thread] du <register> - show memory contents as Unicode string [~process] du <address> - show memory contents as Unicode string
source code
 
do_register(self, arg)
[~thread] r - print the value of all registers [~thread] r <register> - print the value of a register [~thread] r <register>=<value> - change the value of a register [~thread] register - print the value of all registers [~thread] register <register> - print the value of a register [~thread] register <register>=<value> - change the value of a register
source code
 
do_r(self, arg)
[~thread] r - print the value of all registers [~thread] r <register> - print the value of a register [~thread] r <register>=<value> - change the value of a register [~thread] register - print the value of all registers [~thread] register <register> - print the value of a register [~thread] register <register>=<value> - change the value of a register
source code
 
do_eb(self, arg)
[~process] eb <address> <data> - write the data to the specified address
source code
 
do_find(self, arg)
[~process] f <string> - find the string in the process memory [~process] find <string> - find the string in the process memory
source code
 
do_f(self, arg)
[~process] f <string> - find the string in the process memory [~process] find <string> - find the string in the process memory
source code
 
do_memory(self, arg)
[~process] m - show the process memory map [~process] memory - show the process memory map
source code
 
do_m(self, arg)
[~process] m - show the process memory map [~process] memory - show the process memory map
source code
 
event(self, event) source code
 
exception(self, event) source code
 
breakpoint(self, event) source code
 
wow64_breakpoint(self, event) source code
 
single_step(self, event) source code
 
ms_vc_exception(self, event) source code
 
create_process(self, event) source code
 
exit_process(self, event) source code
 
create_thread(self, event) source code
 
exit_thread(self, event) source code
 
load_dll(self, event) source code
 
unload_dll(self, event) source code
 
output_string(self, event) source code
 
load_history(self) source code
 
save_history(self) source code
 
loop(self) source code
 
__call__(self, event)
Dispatch debug events. (Inherited from winappdbg.event.EventHandler)
source code

Inherited from cmd.Cmd: cmdloop, columnize, complete, complete_help, completedefault, completenames, default, emptyline, onecmd, postloop, precmd, print_topics

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  dwMilliseconds = 100
  history_file = '.winappdbg_history'
  confirm_quit = True
  valid_plugin_name_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghij...
  segment_names = ('cs', 'ds', 'es', 'fs', 'gs')
  register_alias_64_to_32 = {'eax': 'Rax', 'ebp': 'Rbp', 'ebx': ...
  register_alias_64_to_16 = {'ax': 'Rax', 'bx': 'Rbx', 'cx': 'Rc...
  register_alias_64_to_8_low = {'al': 'Rax', 'bl': 'Rbx', 'cl': ...
  register_alias_64_to_8_high = {'ah': 'Rax', 'bh': 'Rbx', 'ch':...
  register_alias_32_to_16 = {'ax': 'Eax', 'bx': 'Ebx', 'cx': 'Ec...
  register_alias_32_to_8_low = {'al': 'Eax', 'bl': 'Ebx', 'cl': ...
  register_alias_32_to_8_high = {'ah': 'Eax', 'bh': 'Ebx', 'ch':...
  register_aliases_full_32 = ('cs', 'ds', 'es', 'fs', 'gs', 'ax'...
  register_aliases_full_64 = ('cs', 'ds', 'es', 'fs', 'gs', 'eax...
  jump_instructions = ('jmp', 'jecxz', 'jcxz', 'ja', 'jnbe', 'ja...
  call_instructions = ('call', 'ret', 'retn')
  loop_instructions = ('loop', 'loopz', 'loopnz', 'loope', 'loop...
  control_flow_instructions = ('call', 'ret', 'retn', 'loop', 'l...
  doc_header = 'Available commands (type help * or help <command>)'
  _python_exit = Use exit() or Ctrl-Z plus Return to exit
dict( str → list( tuple( str, int ) ) ) apiHooks = {}
Dictionary that maps module names to lists of tuples of ( procedure name, parameter count ). (Inherited from winappdbg.event.EventHandler)

Inherited from cmd.Cmd: doc_leader, identchars, intro, misc_header, nohelp, ruler, undoc_header, use_rawinput

Properties [hide private]
  lastEvent
  prompt
  lastcmd

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Interactive console debugger.

Overrides: object.__init__

See Also: Debug.interactive

get_names(self)

source code 
Overrides: cmd.Cmd.get_names

parseline(self, line)

source code 

Parse the line into a command name and a string containing the arguments. Returns a tuple containing (command, args, line). 'command' and 'args' may be None if the line couldn't be parsed.

Overrides: cmd.Cmd.parseline
(inherited documentation)

preloop(self)

source code 

Hook method executed once when the cmdloop() method is called.

Overrides: cmd.Cmd.preloop
(inherited documentation)

postcmd(self, stop, line)

source code 

Hook method executed just after a command dispatch is finished.

Overrides: cmd.Cmd.postcmd
(inherited documentation)

do_help(self, arg)

source code 

? - show the list of available commands ? * - show help for all commands ? <command> [command...] - show help for the given command(s) help - show the list of available commands help * - show help for all commands help <command> [command...] - show help for the given command(s)

Overrides: cmd.Cmd.do_help

Class Variable Details [hide private]

valid_plugin_name_chars

Value:
'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy012345678_'

register_alias_64_to_32

Value:
{'eax': 'Rax',
 'ebp': 'Rbp',
 'ebx': 'Rbx',
 'ecx': 'Rcx',
 'edi': 'Rdi',
 'edx': 'Rdx',
 'eip': 'Rip',
 'esi': 'Rsi',
...

register_alias_64_to_16

Value:
{'ax': 'Rax', 'bx': 'Rbx', 'cx': 'Rcx', 'dx': 'Rdx'}

register_alias_64_to_8_low

Value:
{'al': 'Rax', 'bl': 'Rbx', 'cl': 'Rcx', 'dl': 'Rdx'}

register_alias_64_to_8_high

Value:
{'ah': 'Rax', 'bh': 'Rbx', 'ch': 'Rcx', 'dh': 'Rdx'}

register_alias_32_to_16

Value:
{'ax': 'Eax', 'bx': 'Ebx', 'cx': 'Ecx', 'dx': 'Edx'}

register_alias_32_to_8_low

Value:
{'al': 'Eax', 'bl': 'Ebx', 'cl': 'Ecx', 'dl': 'Edx'}

register_alias_32_to_8_high

Value:
{'ah': 'Eax', 'bh': 'Ebx', 'ch': 'Ecx', 'dh': 'Edx'}

register_aliases_full_32

Value:
('cs',
 'ds',
 'es',
 'fs',
 'gs',
 'ax',
 'cx',
 'bx',
...

register_aliases_full_64

Value:
('cs',
 'ds',
 'es',
 'fs',
 'gs',
 'eax',
 'edi',
 'ebp',
...

jump_instructions

Value:
('jmp',
 'jecxz',
 'jcxz',
 'ja',
 'jnbe',
 'jae',
 'jnb',
 'jb',
...

loop_instructions

Value:
('loop', 'loopz', 'loopnz', 'loope', 'loopne')

control_flow_instructions

Value:
('call',
 'ret',
 'retn',
 'loop',
 'loopz',
 'loopnz',
 'loope',
 'loopne',
...

Property Details [hide private]

lastEvent

Get Method:
unreachable.lastEvent(self)

prompt

Get Method:
unreachable.prompt(self)

lastcmd

Get Method:
get_lastcmd(self)
Set Method:
set_lastcmd(self, lastcmd)