idautils.py: CPU registers are now accessible as cpu.EAX (bot read and write). Patch by Igor Skochinsky

This commit is contained in:
gergely.erdelyi 2009-01-27 17:37:10 +00:00
parent d3ac331e36
commit e9f1e04519

View File

@ -343,3 +343,16 @@ def GetInputFileMD5():
@return: MD5 string or None on error @return: MD5 string or None on error
""" """
return idc.GetInputMD5() return idc.GetInputMD5()
class _cpu:
"Simple wrapper around GetRegValue/SetRegValue"
def __getattr__(self, name):
#print "cpu.get(%s)"%name
return idc.GetRegValue(name)
def __setattr__(self, name, value):
#print "cpu.set(%s)"%name
return idc.SetRegValue(value, name)
cpu = _cpu()