NefMoto

Technical => Reverse Engineering => Topic started by: flamy on January 15, 2016, 05:48:17 AM



Title: Useful IDA scripts
Post by: flamy on January 15, 2016, 05:48:17 AM
Hi folks,

I wrote an IDC-script for IDA to import an *.ecu-file created by ME7Info that I would like to contribute.

Maybe you also have some other useful scripts you would like to share with us.
So feel free to add them to this topic.

Regards,
Nils


Title: Re: Useful IDA scripts
Post by: adam- on January 15, 2016, 09:50:10 AM
IDA is going to be my next thing, so this is helpful! :) Thank you!


Title: Re: Useful IDA scripts
Post by: vwaudiguy on January 15, 2016, 01:34:58 PM
IDA is going to be my next thing, so this is helpful! :) Thank you!

+1


Title: Re: Useful IDA scripts
Post by: masterj on January 20, 2016, 06:38:09 AM
Hi folks,

I wrote an IDC-script for IDA to import an *.ecu-file created by ME7Info that I would like to contribute.

Maybe you also have some other useful scripts you would like to share with us.
So feel free to add them to this topic.

Regards,
Nils

Will this also import bitfields (aka enums)?


Title: Re: Useful IDA scripts
Post by: ported2flow on April 09, 2017, 03:46:43 PM
thanks +1


Title: Re: Useful IDA scripts
Post by: prj on April 10, 2017, 01:53:55 AM
Import a2l:

Code:
def a2l(filename):
lastvarname = ""
lastaddress = ""
with open(filename) as fp:
measurements = fp.read().split("/begin MEASUREMENT")
measurements.pop(0)
print("Found: %d measurement(s)" % len(measurements))
for m in measurements:
namefound = 0
addrfound = 0
name = ""
addr = ""
for l in m.split("\n"):
l = l.strip()
if (len(l) > 0):
if (namefound == 0):
name = l
namefound = 1
elif (l.startswith("ECU_ADDRESS")):
addr = l[12:]
addrfound = 1
break
if (addrfound != 1):
print("ERROR")
else:
idc.MakeNameEx(int(addr, 0), name, 1)
return


Title: Re: Useful IDA scripts
Post by: dragon187 on September 17, 2017, 08:03:49 AM
Import a2l:

Code:
def a2l(filename):
lastvarname = ""
lastaddress = ""
with open(filename) as fp:
measurements = fp.read().split("/begin MEASUREMENT")
measurements.pop(0)
print("Found: %d measurement(s)" % len(measurements))
for m in measurements:
namefound = 0
addrfound = 0
name = ""
addr = ""
for l in m.split("\n"):
l = l.strip()
if (len(l) > 0):
if (namefound == 0):
name = l
namefound = 1
elif (l.startswith("ECU_ADDRESS")):
addr = l[12:]
addrfound = 1
break
if (addrfound != 1):
print("ERROR")
else:
idc.MakeNameEx(int(addr, 0), name, 1)
return

Can you please explain how to use this code?
 For .idc script I know.

Thanks


Title: Re: Useful IDA scripts
Post by: terminator on September 17, 2017, 08:31:15 AM
This is Python and you can choose it like this:
file >> script command >> scripting language