(int)memaddr = memory address to read data from
(int)len = number of bytes to read
Returns:
(string)buffer = data read
Example:
myproxy = Proxy() buffer = myproxy.readmemory(0x401000, 50) print buffer
(int)memaddr = memory address to write data to
Returns:
(int)retcode = 0 = error, 1 = success
Example:
(int)byte_count = number of bytes to allocate
Returns:
(int)retcode = 0 = error, 1 = success
Example:
(int)memaddr = memory address to free
Returns:
(int)retcode = 0 = error, 1 = success
Example:
(int)memaddr = memory address to read the asciiz string (ascii + '\0') from
Returns:
(string)ascii_string = the asciiz string
Example:
(int)memaddr = memory address to read the unicode (wide in fact, not unicode) string from
Returns:
(string)unicode_string = the asciiz string
Example:
Changes the cpu registers for the program (current thread) being debugged.
(int)threadid = threadid of the thread to which you want to change the registers
Returns:
(int)retcode = 0 = error, 1 = success
Example:
Executes the next instruction of the program being debugged.
(int)threadid = threadid of the thread to execute the instruction on (must be current thread
as obtained from hookcall.threadid)
Returns:
(int)retcode = 0 = error, 1 = success
Example:
Returns:
(string)abyte = byte read
Example:
Returns:
(string)aword = word read
Example:
Returns:
(string)adword = dword read
Example:
retcode writememory(memaddr, bufflen, data)
(int)bufflen = number of bytes to write
(string)data = bytes to write
myproxy = Proxy()
data = "remember remember, the fifth of november"
retcode = myproxy.writememory(0x401000, len(data), data)
print retcode
(retcode, memaddr) allocmemory(byte_count)
(int)memaddr = address of the allocated block of memory
myproxy = Proxy()
(retcode, memaddr) = myproxy.allocmemory(0x1000)
print retcode
print str(hex(memaddr))
retcode freememory(memaddr)
myproxy = Proxy()
(retcode, memaddr) = myproxy.allocmemory(0x1000)
print retcode
print str(hex(memaddr))
retcode = myproxy.freememory( memaddr )
print retcode
ascii_string readasciiz(memaddr)
myproxy = Proxy()
mystring = myproxy.readasciiz(0x401000)
print mystring
unicode_string readunicode(memaddr)
myproxy = Proxy()
mystring = myproxy.readunicode(0x401000)
print mystring
retcode changeregs(threadid, regs)
(dictionary)regs = dictionary containing the new value of registers
myproxy = Proxy()
print "eax: " + str( hex( hookcall.regs['eax'] ) )
hookcall.regs['eax'] = hookcall.regs['eax'] + 0x8a8a8a8a
retcode = myproxy.changeregs( hookcall.threadid, hookcall.regs )
print retcode
(retcode, newregs) stepin(threadid)
(dictionary)newregs = dictionary containing the new values of the cpu registers after the instruction was executed
myproxy = Proxy()
print "eip: " + str( hex( hookcall.regs['eip'] ) )
(retcode, nregs) = myproxy.stepin( hookcall.threadid )
print retcode
print nregs
abyte readbyte(memaddr)
(int)memaddr = memory address of byte to read
myproxy = Proxy()
abyte = myproxy.readbyte(0x400000)
print abyte
aword readword(memaddr)
(int)memaddr = memory address of word to read
myproxy = Proxy()
aword = myproxy.readword(0x400000)
print aword
adword readdword(memaddr)
(int)memaddr = memory address of dword to read
myproxy = Proxy()
adword = myproxy.readdword(0x400000)
print adword