Pages: [1]
Author Topic: Useful IDA scripts  (Read 7551 times)
flamy
Full Member
***

Karma: +6/-0
Offline Offline

Posts: 56


« 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
Logged
adam-
Hero Member
*****

Karma: +122/-33
Offline Offline

Posts: 2177


« Reply #1 on: January 15, 2016, 09:50:10 AM »

IDA is going to be my next thing, so this is helpful! Smiley Thank you!
Logged
vwaudiguy
Hero Member
*****

Karma: +53/-37
Offline Offline

Posts: 2024



« Reply #2 on: January 15, 2016, 01:34:58 PM »

IDA is going to be my next thing, so this is helpful! Smiley Thank you!

+1
Logged

"If you have a chinese turbo, that you are worried is going to blow up when you floor it, then LOL."
masterj
Hero Member
*****

Karma: +61/-5
Offline Offline

Posts: 1049



WWW
« Reply #3 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)?
Logged

ported2flow
Full Member
***

Karma: +2/-0
Offline Offline

Posts: 76


« Reply #4 on: April 09, 2017, 03:46:43 PM »

thanks +1
Logged
prj
Hero Member
*****

Karma: +906/-420
Offline Offline

Posts: 5792


« Reply #5 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
Logged

PM's will not be answered, so don't even try.
Log your car properly.
dragon187
Full Member
***

Karma: +13/-15
Offline Offline

Posts: 106


« Reply #6 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
Logged
terminator
Sr. Member
****

Karma: +15/-4
Offline Offline

Posts: 425


« Reply #7 on: September 17, 2017, 08:31:15 AM »

This is Python and you can choose it like this:
file >> script command >> scripting language
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.02 seconds with 16 queries. (Pretty URLs adds 0.001s, 0q)