在 IDA Pro for MIPS 中重命名子程序
逆向工程
艾达
米普
2021-06-21 17:33:08
1个回答
可能是因为 IDA 将la参数视为整数。尝试以下操作:转到system显示为数字的位置之一,将光标定位在该数字上,按下O并重新检查它是否仍被引用为数字。
基于评论更新 - 此代码说明了如何自动修复它的总体思路。注意:此代码未经测试,仅用于说明目的:
#I didn't check this code,
#use carefully,
#beware of errors !
import idc
import idautils
import idaapi
#this function will pass over all assembly commands in correspondiong parameter
#and will set as offsets all operands mentioned in second parameter
# @param list_of_ranges --> list of tuples of start and end of code ranges where it
# should be applied
# @list_of_commands_and_operands--> list of tuples of assembly commands as string
# and number of operands where it should be applied
def multi_convert_op_to_offset(list_of_ranges, list_of_commands_and_operands):
for (start, end) in list_of_ranges:
for h in idautils.Heads(start, end):
dis = idc.GetDisasm(h).split()
mnemonic = dis[0]
for mnem, op in list_of_commands_and_operands:
if mnem == mnemonic:
idc.OpOff(h, op, 0)
#Usage:
start = start_of_your_relevant_code
end = end_of_your_relevant_code
l_of_rng = []
l_of_rng.append((start, end))
l_of_cmds_and_ops = []
l_of_cmds_and_ops.append(("la", 1))
multi_convert_op_to_offset(l_of_rng, l_of_cmds_and_ops)



