I have a simple python script that i wrote for IDA, but i'am can't figure out what am i doing wrong.
file = open("c:\\example.txt", "r")
for line in file:
if line == "":
pass
else:
addr = line.split(None,1)
if len(addr) < 2:
pass
else:
address = ''.join(addr[0])
if(idc.Jump(address)):
sea = ScreenEA()
else:
print "There is a problem with the destenation address"
counter = 0
for l in addr[1]:
PatchByte(sea+counter, ord(l))
counter += 1
file.close()
Tow lines from example.txt
file:
0x1001b3a4 Kernel32.DLL
0x1001b3c8 CreateToolhelp32Snapshot
The error message i get is:
obvious to me the error is at if(idc.Jump(address)):
line, and i have tried to call that with if(Jump(addr[0])):
but i am getting the same error message.
I saw the Jump
function at the official doc, but it seems like i am passing the right argument to it.
What could be the problem?
I think the problem is that you are passing a string to Jump()
. Accordingly to the docs it has to be a long
.