如何user_cmts_*从 IDAPython API调用函数?我对 SDK 和 IDAPython 很陌生,所以我对应该传递给这些函数的内容有点迷茫,因为它不是对用户最友好的文档 imo。我尝试传递这样的地图user_cmts_begin:
import idaapi
def print_cmt(cmt):
print cmt
cumap = map(print_cmt, [some address here to test])
idaapi.user_cmts_begin(cumap)
但它引发了一个类型错误,所以很明显我一定是做错了什么......
现在我不得不求助于这样做:
import idaapi
import re
addr = 0x80000000
while addr < 0x80200000:
cmt = idaapi.get_cmt(addr, 0) # get non-repeatable comment at current address/line
if cmt is not None: # skip if the line has no comment
if re.search("insert regex for non-auto-generated comments here", cmt) is not None:
print "%08X: %s" % (addr, cmt)
addr = idaapi.next_not_tail(addr)
IDAPython 文档可以在这里找到:
https://www.hex-rays.com/products/ida/support/idapython_docs/
有人可以举个例子吗?