IDA: Abstract idc.set_cmt into SetComment

This commit is contained in:
Katy Coe
2020-07-29 01:34:36 +02:00
parent 7b9c28fdf3
commit 0bfc5750ad

View File

@@ -85,7 +85,10 @@ def MakeFunction(start):
def SetType(addr, type): def SetType(addr, type):
ret = idc.SetType(addr, type) ret = idc.SetType(addr, type)
if ret is None: if ret is None:
print('SetType(0x%x, %r) failed!' % (addr, type))"); print('SetType(0x%x, %r) failed!' % (addr, type))
def SetComment(addr, text):
idc.set_cmt(addr, text, 1)");
} }
private void writeTypes(string typeHeaderFile) { private void writeTypes(string typeHeaderFile) {
@@ -219,7 +222,7 @@ def SetType(addr, type):
} }
private void writeComment(ulong address, object comment) { private void writeComment(ulong address, object comment) {
writeLine($"idc.set_cmt({address.ToAddressString()}, r'{comment.ToString().ToEscapedString()}', 1)"); writeLine($"SetComment({address.ToAddressString()}, r'{comment.ToString().ToEscapedString()}')");
} }
private void writeLine(string line) => writer.WriteLine(line); private void writeLine(string line) => writer.WriteLine(line);