idautils.py: Classes are all newskool. Fixed a pylint warning.

This commit is contained in:
gergely.erdelyi 2009-10-17 20:43:09 +00:00
parent 8e66e14588
commit 2edeeae88b

View File

@ -125,7 +125,7 @@ def XrefTypeName(typecode):
def _copy_xref(xref): def _copy_xref(xref):
""" Make a private copy of the xref class to preserve its contents """ """ Make a private copy of the xref class to preserve its contents """
class _xref: class _xref(object):
pass pass
xr = _xref() xr = _xref()
@ -300,7 +300,7 @@ def DecodeInstruction(ea):
insn = idaapi.get_current_instruction() insn = idaapi.get_current_instruction()
if not insn: if not insn:
return None return None
class dup: class dup(object):
def __init__(self, op): def __init__(self, op):
for x in dir(op): for x in dir(op):
if x.startswith("__") and x.endswith("__"): if x.startswith("__") and x.endswith("__"):
@ -359,7 +359,7 @@ def GetInputFileMD5():
return idc.GetInputMD5() return idc.GetInputMD5()
class _cpu: class _cpu(object):
"Simple wrapper around GetRegValue/SetRegValue" "Simple wrapper around GetRegValue/SetRegValue"
def __getattr__(self, name): def __getattr__(self, name):
#print "cpu.get(%s)"%name #print "cpu.get(%s)"%name
@ -369,7 +369,7 @@ class _cpu:
#print "cpu.set(%s)"%name #print "cpu.set(%s)"%name
return idc.SetRegValue(value, name) return idc.SetRegValue(value, name)
class Strings: class Strings(object):
""" """
Returns the string list. Returns the string list.
@ -380,7 +380,7 @@ class Strings:
print "%x: len=%d type=%d -> '%s'" % (i.ea, i.length, i.type, str(i)) print "%x: len=%d type=%d -> '%s'" % (i.ea, i.length, i.type, str(i))
""" """
class StringItem: class StringItem(object):
""" """
Class representing each string item. Class representing each string item.
The attributes are: The attributes are:
@ -411,6 +411,7 @@ class Strings:
if default_setup: if default_setup:
self.setup() self.setup()
self._si = idaapi.string_info_t() self._si = idaapi.string_info_t()
self.size = 0
def refresh(self, ea1=idaapi.cvar.inf.minEA, ea2=idaapi.cvar.inf.maxEA): def refresh(self, ea1=idaapi.cvar.inf.minEA, ea2=idaapi.cvar.inf.maxEA):
"""Refreshes the strings list""" """Refreshes the strings list"""