IDAPython for IDA 8.3

This commit is contained in:
Arnaud Diederen
2023-06-12 10:39:14 +02:00
parent c99b9db781
commit e6841a95a3
97 changed files with 3909 additions and 1536 deletions
+5 -8
View File
@@ -249,7 +249,10 @@ def Modules():
mod = ida_idd.modinfo_t()
result = ida_dbg.get_first_module(mod)
while result:
yield mod
# Note: can't simply return `mod` here, since callers might
# collect all modules in a list, and they would all re-use
# the underlying C++ object.
yield ida_idaapi.object_t(name=mod.name, size=mod.size, base=mod.base, rebase_to=mod.rebase_to)
result = ida_dbg.get_next_module(mod)
@@ -432,13 +435,7 @@ def MapDataList(ea, length, func, wordsize=1):
PutDataList(ea, map(func, GetDataList(ea, length, wordsize)), wordsize)
def GetInputFileMD5():
"""
Return the MD5 hash of the input binary file
@return: MD5 string or None on error
"""
return idc.retrieve_input_file_md5()
GetInputFileMD5 = ida_nalt.retrieve_input_file_md5
class Strings(object):
+18 -13
View File
@@ -1027,13 +1027,13 @@ def split_sreg_range(ea, reg, value, tag=SR_user):
@note: IDA keeps tracks of all the points where segment register change their
values. This function allows you to specify the correct value of a segment
register if IDA is not able to find the corrent value.
register if IDA is not able to find the correct value.
"""
reg = ida_idp.str2reg(reg);
if reg >= 0:
return ida_segregs.split_sreg_range(ea, reg, value, tag)
else:
return False
rnames = [r.casefold() for r in ida_idp.ph_get_regnames()]
for regno in range(ida_idp.ph_get_reg_first_sreg(), ida_idp.ph_get_reg_last_sreg()+1):
if rnames[regno]==reg.casefold():
return ida_segregs.split_sreg_range(ea, regno, value, tag)
return False
auto_mark_range = ida_auto.auto_mark_range
@@ -2641,13 +2641,18 @@ MSF_NOFIX = 0x0002 # don't call the loader to fix relocations
MSF_LDKEEP = 0x0004 # keep the loader in the memory (optimization)
MSF_FIXONCE = 0x0008 # valid for rebase_program(): call loader only once
MOVE_SEGM_OK = 0 # all ok
MOVE_SEGM_PARAM = -1 # The specified segment does not exist
MOVE_SEGM_ROOM = -2 # Not enough free room at the target address
MOVE_SEGM_IDP = -3 # IDP module forbids moving the segment
MOVE_SEGM_CHUNK = -4 # Too many chunks are defined, can't move
MOVE_SEGM_LOADER = -5 # The segment has been moved but the loader complained
MOVE_SEGM_ODD = -6 # Can't move segments by an odd number of bytes
MOVE_SEGM_OK = 0 # all ok
MOVE_SEGM_PARAM = -1 # The specified segment does not exist
MOVE_SEGM_ROOM = -2 # Not enough free room at the target address
MOVE_SEGM_IDP = -3 # IDP module forbids moving the segment
MOVE_SEGM_CHUNK = -4 # Too many chunks are defined, can't move
MOVE_SEGM_LOADER = -5 # The segment has been moved but the loader complained
MOVE_SEGM_ODD = -6 # Can't move segments by an odd number of bytes
MOVE_SEGM_ORPHAN = -7, # Orphan bytes hinder segment movement
MOVE_SEGM_DEBUG = -8, # Debugger segments cannot be moved
MOVE_SEGM_SOURCEFILES = -9, # Source files ranges of addresses hinder segment movement
MOVE_SEGM_MAPPING = -10, # Memory mapping ranges of addresses hinder segment movement
MOVE_SEGM_INVAL = -11, # Invalid argument (delta/target does not fit the address space)
rebase_program = ida_segment.rebase_program