Package envi :: Module cli :: Class EnviCli
[hide private]
[frames] | no frames]

Class EnviCli

source code

cmd.Cmd --+
          |
         EnviCli
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, memobj, config=None, symobj=None)
Instantiate a line-oriented interpreter framework.
source code
 
setCanvas(self, canvas)
Set a new canvas for the CLI and add all the current renderers to the new one.
source code
 
write(self, data) source code
 
get_names(self) source code
 
getExpressionLocals(self)
Over-ride this to have things like the eval command and the python command use more locals than the sybolic defaults.
source code
 
registerCmdExtension(self, func) source code
 
vprint(self, msg, addnl=True)
Print output to the CLI's output handler.
source code
 
__getattr__(self, name) source code
 
doAlias(self, line) source code
 
cmdloop(self, intro=None)
Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.
source code
 
onecmd(self, line)
Interpret the argument as though it had been typed in response to the prompt.
source code
 
do_EOF(self, line) source code
 
do_quit(self, line)
Quit
source code
 
do_config(self, line)
Show or edit a config option from the command line
source code
 
do_alias(self, line)
Add an alias to the command line interpreter's aliases dictionary
source code
 
do_python(self, line)
Start an interactive python interpreter.
source code
 
parseExpression(self, expr) source code
 
do_binstr(self, line)
Display a binary representation of the given value expression (padded to optional width in bits)
source code
 
do_eval(self, line)
Evaluate an expression on the CLI to show it's value.
source code
 
do_script(self, line)
Execute a python file.
source code
 
do_maps(self, line)
Display either a list of all the memory maps or the memory map details for the given address expression.
source code
 
do_search(self, line)
Search memory for patterns.
source code
 
reprPointer(self, va)
Do your best to create a humon readable name for the value of this pointer.
source code
 
do_memdump(self, line)
Dump memory out to a file.
source code
 
do_memcmp(self, line)
Compare memory at the given locations.
source code
 
do_mem(self, line)
Show some memory (with optional formatting and size)
source code

Inherited from cmd.Cmd: columnize, complete, complete_help, completedefault, completenames, default, do_help, emptyline, parseline, postcmd, postloop, precmd, preloop, print_topics

Class Variables [hide private]

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

Method Details [hide private]

__init__(self, memobj, config=None, symobj=None)
(Constructor)

source code 

Instantiate a line-oriented interpreter framework.

The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically. The optional arguments stdin and stdout specify alternate input and output file objects; if not specified, sys.stdin and sys.stdout are used.

Overrides: cmd.Cmd.__init__
(inherited documentation)

get_names(self)

source code 
Overrides: cmd.Cmd.get_names

vprint(self, msg, addnl=True)

source code 

Print output to the CLI's output handler.  This allows routines to
print to the terminal or the GUI depending on which mode we're in.

Example:
    vprint('hi mom!')

cmdloop(self, intro=None)

source code 

Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.

Overrides: cmd.Cmd.cmdloop
(inherited documentation)

onecmd(self, line)

source code 

Interpret the argument as though it had been typed in response to the prompt.

This may be overridden, but should not normally need to be; see the precmd() and postcmd() methods for useful execution hooks. The return value is a flag indicating whether interpretation of commands by the interpreter should stop.

Overrides: cmd.Cmd.onecmd
(inherited documentation)

do_quit(self, line)

source code 

Quit

Usage: quit

do_config(self, line)

source code 

Show or edit a config option from the command line

Usage: config [-S section] [option=value]

do_alias(self, line)

source code 

Add an alias to the command line interpreter's aliases dictionary

Usage: alias <alias_word> rest of the alias command To delete an alias: Usage: alias <alias_word>

do_python(self, line)

source code 

Start an interactive python interpreter. The namespace of the interpreter is updated with expression nicities. You may also specify a line of python code as an argument to be exec'd without beginning an interactive python interpreter on the controlling terminal.

Usage: python [pycode]

do_binstr(self, line)

source code 

Display a binary representation of the given value expression (padded to optional width in bits)

Usage: binstr <val_expr> [<bitwidth_expr>]

do_eval(self, line)

source code 

Evaluate an expression on the CLI to show it's value.

Usage: eval (ecx+edx)/2

do_script(self, line)

source code 

Execute a python file.

The script file is arbitrary python code which is run with the
full compliment of expression extensions mapped in as locals.

NOTE: additional command line arguments may be passed in and will
      appear as the list "argv" in the script namespace!  (They will
      all be strings)

Usage: script <scriptfile> [<argv[0]>, ...]

do_maps(self, line)

source code 

Display either a list of all the memory maps or the memory map details for the given address expression.

Usage: maps [addr_expression]

do_search(self, line)

source code 

Search memory for patterns.

Usage: search [options] <pattern> -e Encode the pattern with a codec (ie utf-16le, hex, etc) -E The specified pattern is an expression (search for numeric values) -r The specified pattern is a regular expression -R <baseexpr:sizeexpr> Search a specific range only. -X The specified pattern is in hex (ie. 414141424242 is AAABBB)

do_memdump(self, line)

source code 

Dump memory out to a file.

Usage: memdump <addr_expression> <size_expression> <filename>

do_memcmp(self, line)

source code 

Compare memory at the given locations. Outputs a set of differences showing bytes at their given offsets....

Usage: memcmp <addr_expr1> <addr_expr2> <size_expr>

do_mem(self, line)

source code 

Show some memory (with optional formatting and size)

Usage: mem [-F <format>] <addr expression> [size]

NOTE: use -F ? for a list of the formats