-
Notifications
You must be signed in to change notification settings - Fork 107
wsh Core API
Jonathan Brossard edited this page Aug 12, 2016
·
2 revisions
help(), man()
hexdump(), hex_dump(), hex()
shdrs(), phdrs(), map(), procmap(), bfmap()
symbols(), functions(), objects(), info(), search(), headers()
grep(), grepptr()
loadbin(), libs(), entrypoints(), rescan()
libcall()
xalloc(), ralloc(), xfree(), balloc(), bset(), bget(), rdstr(), rdnum()
breakpoint(), bp()
enableaslr(), disableaslr()
verbose(), hollywood()
ltrace()
WSH HELP FOR FUNCTION help
NAME
help
SYNOPSIS
help([topic])
DESCRIPTION
Display help on [topic]. If [topic] is ommitted, display general help.
RETURN VALUES
None
WSH HELP FOR FUNCTION man
NAME
man
SYNOPSIS
man([page])
DESCRIPTION
Display system manual page for [page].
RETURN VALUES
None
WSH HELP FOR FUNCTION hexdump
NAME
hexdump
SYNOPSIS
hexdump(<address>, <num>)
DESCRIPTION
Display <num> bytes from memory <address> in enhanced hexadecimal form.
RETURN VALUES
None
WSH HELP FOR FUNCTION hex_dump
NAME
hex
SYNOPSIS
hex(<object>)
DESCRIPTION
Display lua <object> in enhanced hexadecimal form.
RETURN VALUES
None
WSH HELP FOR FUNCTION hex
NAME
hex
SYNOPSIS
hex(<object>)
DESCRIPTION
Display lua <object> in enhanced hexadecimal form.
RETURN VALUES
None
WSH HELP FOR FUNCTION shdrs
NAME
shdrs
SYNOPSIS
shdrs()
DESCRIPTION
Display ELF section headers from all binaries loaded in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION phdrs
NAME
phdrs
SYNOPSIS
phdrs()
DESCRIPTION
Display ELF program headers from all binaries loaded in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION map
NAME
map
SYNOPSIS
map()
DESCRIPTION
Display a table of all the memory ranges mapped in memory in the address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION procmap
NAME
procmap
SYNOPSIS
procmap()
DESCRIPTION
Display a table of all the memory ranges mapped in memory in the address space as displayed in /proc/<pid>/maps.
RETURN VALUES
None
WSH HELP FOR FUNCTION bfmap
NAME
bfmap
SYNOPSIS
bfmap()
DESCRIPTION
Bruteforce valid mapped memory ranges in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION symbols
NAME
symbols
SYNOPSIS
symbols([sympattern], [libpattern], [mode])
DESCRIPTION
Display all the symbols in memory matching [sympattern], from library [libpattern]. If [mode] is set to 1 or 2, do not wait user input between pagers. [mode] = 2 provides a shorter output.
RETURN VALUES
None
WSH HELP FOR FUNCTION functions
NAME
functions
SYNOPSIS
table func = functions([sympattern], [libpattern], [mode])
DESCRIPTION
Display all the functions in memory matching [sympattern], from library [libpattern]. If [mode] is set to 1 or 2, do not wait user input between pagers. [mode] = 2 provides a shorter output.
RETURN VALUES
Return 1 lua table _func_ whose keys are valid function names in address space, and values are pointers to them in memory.
WSH HELP FOR FUNCTION objects
NAME
objects
SYNOPSIS
objects([pattern])
DESCRIPTION
Display all the functions in memory matching [sympattern]
RETURN VALUES
None
WSH HELP FOR FUNCTION info
NAME
info
SYNOPSIS
info([address] | [name])
DESCRIPTION
Display various informations about the [address] or [name] provided : if it is mapped, and if so from which library and in which section if available.
RETURN VALUES
None
WSH HELP FOR FUNCTION search
NAME
search
SYNOPSIS
search(<pattern>)
DESCRIPTION
Search all object names matching <pattern> in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION headers
NAME
headers
SYNOPSIS
headers()
DESCRIPTION
Display C headers suitable for linking against the API loaded in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION grep
NAME
grep
SYNOPSIS
table match = grep(<pattern>, [patternlen], [dumplen], [before])
DESCRIPTION
Search <pattern> in all ELF sections in memory. Match [patternlen] bytes, then display [dumplen] bytes, optionally including [before] bytes before the match. Results are displayed in enhanced decimal form
RETURN VALUES
Returns 1 lua table containing matching memory addresses.
WSH HELP FOR FUNCTION grepptr
NAME
grep
SYNOPSIS
table match = grep(<pattern>, [patternlen], [dumplen], [before])
DESCRIPTION
Search <pattern> in all ELF sections in memory. Match [patternlen] bytes, then display [dumplen] bytes, optionally including [before] bytes before the match. Results are displayed in enhanced decimal form
RETURN VALUES
Returns 1 lua table containing matching memory addresses.
WSH HELP FOR FUNCTION loadbin
NAME
loadbin
SYNOPSIS
loadbin(<pathname>)
DESCRIPTION
Load binary to memory from <pathname>.
RETURN VALUES
None
WSH HELP FOR FUNCTION libs
NAME
libs
SYNOPSIS
table libraries = libs()
DESCRIPTION
Display all libraries loaded in address space.
RETURN VALUES
Returns 1 value: a lua table _libraries_ whose values contain valid binary names (executable/libraries) mapped in memory.
WSH HELP FOR FUNCTION entrypoints
NAME
entrypoints
SYNOPSIS
entrypoints()
DESCRIPTION
Display entry points for each binary loaded in address space.
RETURN VALUES
None
WSH HELP FOR FUNCTION rescan
NAME
rescan
SYNOPSIS
rescan()
DESCRIPTION
Re-perform address space scan.
RETURN VALUES
None
WSH HELP FOR FUNCTION libcall
NAME
libcall
SYNOPSIS
void *ret, table ctx = libcall(<function>, [arg1], [arg2], ... arg[6])
DESCRIPTION
Call binary <function> with provided arguments.
RETURN VALUES
Returns 2 return values: _ret_ is the return value of the binary function (nill if none), _ctx_ a lua table representing the execution context of the library call.
No help available for function xalloc()
No help available for function ralloc()
No help available for function xfree()
No help available for function balloc()
No help available for function bset()
No help available for function bget()
No help available for function rdstr()
No help available for function rdnum()
WSH HELP FOR FUNCTION breakpoint
NAME
breakpoint
SYNOPSIS
breakpoint(<address>, [weight])
DESCRIPTION
Set a breakpoint at memory <address>. Optionally add a <weight> to breakpoint score if hit.
RETURN VALUES
None
WSH HELP FOR FUNCTION bp
NAME
bp
SYNOPSIS
bp(<address>, [weight])
DESCRIPTION
Set a breakpoint at memory <address>. Optionally add a <weight> to breakpoint score if hit. Alias for breakpoint() function.
RETURN VALUES
None
WSH HELP FOR FUNCTION enableaslr
NAME
enableaslr
SYNOPSIS
enableaslr()
DESCRIPTION
Enable Address Space Layout Randomization (requires root privileges).
RETURN VALUES
None
WSH HELP FOR FUNCTION disableaslr
NAME
disableaslr
SYNOPSIS
disableaslr()
DESCRIPTION
Disable Address Space Layout Randomization (requires root privileges).
RETURN VALUES
None
WSH HELP FOR FUNCTION verbose
NAME
verbose
SYNOPSIS
verbose(<verbosity>)
DESCRIPTION
Change verbosity setting to <verbosity>.
RETURN VALUES
None
WSH HELP FOR FUNCTION hollywood
NAME
hollywood
SYNOPSIS
hollywood(<level>)
DESCRIPTION
Change hollywood (fun) display setting to <level>, impacting color display (enable/disable).
RETURN VALUES
None