NefMoto

Technical => Reverse Engineering => Topic started by: d0xx on February 18, 2017, 06:46:05 PM



Title: MED9 Autoit script
Post by: d0xx on February 18, 2017, 06:46:05 PM
Inspired from prj, i made this for MED9 Ecu's.
Its not finished yet because i have a few things to fix, but here you are.

It also have the ability to load RAM-Values from an A2L file into it (you need to convert the file first, for instructions see the video)

Video:
https://youtu.be/_XxJVAzGEFs (https://youtu.be/_XxJVAzGEFs)





Title: Re: MED9 Autoit script
Post by: turbo944s2 on February 19, 2017, 04:34:38 AM
Inspired from prj, i made this for MED9 Ecu's.
Its not finished yet because i have a few things to fix, but here you are.

It also have the ability to load RAM-Values from an A2L file into it (you need to convert the file first, for instructions see the video)

Video:
https://youtu.be/_XxJVAzGEFs (https://youtu.be/_XxJVAzGEFs)

Thanks for sharing this. I have a question(please forgive me for my ignorance). I have a a 8E1910115G ecu, I don't have the specific A2L for it just one for a 2005 2.0t FSI Audi A4 B7. Can I  load RAM-Values from that A2L?





Title: Re: MED9 Autoit script
Post by: Teitek on February 19, 2017, 12:53:05 PM
Inspired from prj, i made this for MED9 Ecu's.
Its not finished yet because i have a few things to fix, but here you are.

It also have the ability to load RAM-Values from an A2L file into it (you need to convert the file first, for instructions see the video)

Video:
https://youtu.be/_XxJVAzGEFs (https://youtu.be/_XxJVAzGEFs)




good work for load ram values.
Thanks


Title: Re: MED9 Autoit script
Post by: d0xx on February 19, 2017, 07:35:25 PM
Quote from: turbo944s2
Thanks for sharing this. I have a question(please forgive me for my ignorance). I have a a 8E1910115G ecu, I don't have the specific A2L for it just one for a 2005 2.0t FSI Audi A4 B7. Can I  load RAM-Values from that A2L?

Hy, basically - no. An A2l MUST match 100%, there are very rare cases where an A2L from a different ecu/sw matches 100%


Title: Re: MED9 Autoit script
Post by: turbo944s2 on February 20, 2017, 11:27:17 AM
Thank you. I used it last night on the Audi 2.0 tfsi A4 bin and A2l floating around here. I was unable to get the A2L portion to work correctly. Ill attach them tonight for you to see. The first part of it worked well though.


Title: Re: MED9 Autoit script
Post by: gt-innovation on February 20, 2017, 12:41:01 PM
Inspired from prj, i made this for MED9 Ecu's.
Its not finished yet because i have a few things to fix, but here you are.

It also have the ability to load RAM-Values from an A2L file into it (you need to convert the file first, for instructions see the video)

Video:
https://youtu.be/_XxJVAzGEFs (https://youtu.be/_XxJVAzGEFs)



Nice of you to share a part of your work however you should include the conversion algo withing the script.
Most of the people here whatever they shared didn`t require an online converter for that....


Title: Re: MED9 Autoit script
Post by: d0xx on February 20, 2017, 03:25:20 PM
Nice of you to share a part of your work however you should include the conversion algo withing the script.
Most of the people here whatever they shared didn`t require an online converter for that....

Downloadlink in attached txt.


Title: Re: MED9 Autoit script
Post by: littco on February 21, 2017, 10:11:51 AM
Downloadlink in attached txt.

Hi

I did do one of these last year and its floating about on the forum somewhere, I'm guessing they will be very similar however mine didn't have the A2l capability so you win...Haha.. I'll give it ago as the A2l function is good IMHO


Title: Re: MED9 Autoit script
Post by: littco on February 21, 2017, 10:27:41 AM
Downloadlink in attached txt.

Doesn't seem to work with IDA 6.5


Title: Re: MED9 Autoit script
Post by: sonique on February 21, 2017, 11:31:57 AM
try ida 6,8


Title: Re: MED9 Autoit script
Post by: gt-innovation on February 21, 2017, 12:31:43 PM
Downloadlink in attached txt.

Applaud Given :)


Title: Re: MED9 Autoit script
Post by: prj on February 21, 2017, 12:49:40 PM
BTW, I discontinued the script because it is possible to make this much better with direct IDA commands.

I can post my me7.py file if you like - maybe you can get some more inspiration :D


Title: Re: MED9 Autoit script
Post by: nihalot on February 21, 2017, 11:08:37 PM

I can post my me7.py file if you like - maybe you can get some more inspiration :D

that would be nice :D


Title: Re: MED9 Autoit script
Post by: prj on February 22, 2017, 12:50:25 AM
Here are the relevant functions for basic ME7:

Code:
import idc
import idaapi

def processrom(min, max):
if min > 0:
min = min - 1
curaddr = idc.FindUnexplored(min, idc.SEARCH_DOWN)
while curaddr < max:
if idc.MakeFunction(curaddr) != True:
idc.MakeCode(curaddr)
curaddr = idc.FindUnexplored(curaddr, idc.SEARCH_DOWN)

return

def makesegments():
idc.AddSeg(0xE000, 0x10000, 0, 0, 0, idc.scPub)
idc.RenameSeg(0xE000, "IRAM")
idc.AddSeg(0x380000, 0x390000, 0, 0, 0, idc.scPub)
idc.RenameSeg(0x380000, "XRAM")
return

def setdpp():
idc.SetSegDefReg(0x0000, "dpp0", 0x204)
idc.SetSegDefReg(0x0000, "dpp1", 0x205)
idc.SetSegDefReg(0x0000, "dpp2", 0xE0)
idc.SetSegDefReg(0x0000, "dpp3", 0x03)
idc.SetSegDefReg(0x800000, "dpp0", 0x204)
idc.SetSegDefReg(0x800000, "dpp1", 0x205)
idc.SetSegDefReg(0x800000, "dpp2", 0xE0)
idc.SetSegDefReg(0x800000, "dpp3", 0x03)
return


Title: Re: MED9 Autoit script
Post by: d0xx on February 22, 2017, 02:25:35 AM
I did do one of these last year and its floating about on the forum somewhere, I'm guessing they will be very similar however mine didn't have the A2l capability so you win...Haha.. I'll give it ago as the A2l function is good IMHO

Rly? I searched a time for a solution for MED9 and dont find something, and it was boring, adding it manually each file i want to open so i made this.
However, thanks for the appreciation  ;D

Doesn't seem to work with IDA 6.5
I'm working with version 6.8 so i made it for this version. Maybe someone can change the script for older IDA versions.


Here are the relevant functions for basic ME7:

Thank you! I will take a look onto it. Is there a way to inject the python scripts and adding buttons for each function somewhere on IDA or in an external window?
I never worked with the python integration, except the console at bottom.


Title: Re: MED9 Autoit script
Post by: littco on February 22, 2017, 04:26:36 AM
try ida 6,8

works a treat.


Title: Re: MED9 Autoit script
Post by: prj on February 24, 2017, 02:13:41 AM
Well to load the script you simply put the script into IDA-s python directory and then import the module.

So if this script is called ecutools.py you type "import ecutools". After that you can access the functions as a module - ecutools.xxx
You can also reload modules - reload <module>.

Whether you can paint an UI or not, I don't know. It depends if IDA allows you to import TK and create TK widgets.
However the preferred way to trigger it by UI is through adding items to the edit->plugins menu. You can find some info here: http://www.hexblog.com/?p=120 (http://www.hexblog.com/?p=120)

Personally I prefer console commands, so I just import the module and pass arguments to it :)


Title: Re:
Post by: THANAS on February 24, 2017, 02:32:47 AM
Awesome!


Title: Re: MED9 Autoit script
Post by: dragon187 on August 15, 2017, 12:01:18 PM
is the script here for ME9? i havent see it ,i hope i am not to late ;D