Notices
ECU Flash

Auto-Disassembly Script

Thread Tools
 
Search this Thread
 
Old May 31, 2011, 06:52 PM
  #1  
Evolving Member
Thread Starter
 
dparrish's Avatar
 
Join Date: Apr 2011
Location: Sydney
Posts: 145
Likes: 0
Received 0 Likes on 0 Posts
Auto-Disassembly Script

I've managed to find a copy of Acamus' auto-disassembly script (onload.idc) and I like it. However it seems to be very hard to find and there could be more in it. With that in mind, I've started a fork that I can put new things into.

It still finds the items that the original script, as well as label all the registers and interrupts.

I've uploaded it to the SVN repository, which means you can always download the latest version at: http://ecurom.googlecode.com/svn/trunk/asm/ecurom.idc

The other major change is that now this isn't part of the onload mechanism, because that really breaks if you have other IDA scripts loading at the same time. The instructions for this new version are:
  1. Download the latest version and save it in your C:\Program Files\IDA\idc directory
  2. Load a new ROM
  3. From the File menu, select IDC File and locate the C:\Program Files\IDA\idc\ecurom.idc script
  4. Profit

Tonight I'll be adding in some code to automatically locate and label 2d/3d maps and the associated axes.

I'd like it to find and label some "well known" functions, like the 2d/3d map routines and the axis lookup routines. Does anyone have a reasonable list of these?
Old May 31, 2011, 07:40 PM
  #2  
Evolving Member
iTrader: (1)
 
evoRS06's Avatar
 
Join Date: Jul 2006
Location: Oak Harbor, WA
Posts: 152
Likes: 0
Received 0 Likes on 0 Posts
This is awesome, thanks for the effort, I have been praying for something like this:-)
Old Jun 1, 2011, 10:34 PM
  #3  
Evolving Member
Thread Starter
 
dparrish's Avatar
 
Join Date: Apr 2011
Location: Sydney
Posts: 145
Likes: 0
Received 0 Likes on 0 Posts
I've spent the last many hours hacking on this script, and it now does automatic axis and map discovery.

The way axis discovery works is:
  1. Iterate through all the references to sub_CC6 which is the axis lookup function
  2. Starting at each reference, look backwards through the code to find an instruction that sets r4 (the table location in RAM)
  3. Jump to that location and label the fields in the table (result ptr, length, data) as well as the table itself (unknown_axis_x)

After this is done, the map discovery runs:
  1. Iterate through all calls to sub_C28 and sub_E02 which are the map lookup functions
  2. Look for the start of the map the same way the axis lookup does
  3. Label the fields of the map (dimensions, adder, input ptrs, columns, data) and the map itself with unknown_[2|3]d_byte_map_x.
  4. Look up all the references to each of the input pointers (both for 3d and just the one for 2d). One of those references will be the axis table which contains the size
  5. Use either the single axis length (for 2d) or the multiple of height and width (for 3d) to work out the size of the map. Use that number to create an array in IDA with the right shape

This seems to work quite well for most of the maps. There are some maps that it doesn't find due to a number of indirections being used. Specifically it doesn't work for the ignition/fuel/WGDC maps when tephra's altmap patch is used. That's annoying and I'm going to try and fix it.

Also it doesn't find any maps that aren't used by the code. There are a LOT of maps that seem to contain something that is never referenced, so I don't think they're very useful.

The latest version is on the SVN repository, with a download link on post #1 of this topic. Please try it out and let me know what you think.

Last edited by dparrish; Jun 2, 2011 at 12:41 AM.
Old Jun 3, 2011, 05:54 AM
  #4  
Evolved Member
 
burgers22's Avatar
 
Join Date: Jan 2006
Location: Oxfordshire
Posts: 953
Received 2 Likes on 2 Posts
Nice work that man................... Good for us with poor coding skills.
Old Jun 3, 2011, 09:57 AM
  #5  
Evolving Member
 
Ceddy's Avatar
 
Join Date: Apr 2008
Location: Reading, PA
Posts: 265
Likes: 0
Received 0 Likes on 0 Posts
Nice work.
Old Jun 4, 2011, 04:03 AM
  #6  
Evolved Member
 
burgers22's Avatar
 
Join Date: Jan 2006
Location: Oxfordshire
Posts: 953
Received 2 Likes on 2 Posts
Getting the following error.
Attached Thumbnails Auto-Disassembly Script-ecuron-script-warning.jpg  
Old Jun 4, 2011, 05:36 PM
  #7  
Evolving Member
Thread Starter
 
dparrish's Avatar
 
Join Date: Apr 2011
Location: Sydney
Posts: 145
Likes: 0
Received 0 Likes on 0 Posts
Originally Posted by burgers22
Getting the following error.
Which version of IDA Pro are you using?
Old Jun 5, 2011, 02:46 AM
  #8  
Evolved Member
 
burgers22's Avatar
 
Join Date: Jan 2006
Location: Oxfordshire
Posts: 953
Received 2 Likes on 2 Posts
5.2.0.908 64 bit.
Old Mar 4, 2012, 07:08 AM
  #9  
Newbie
 
boymay22's Avatar
 
Join Date: May 2011
Location: singapore
Posts: 17
Likes: 0
Received 0 Likes on 0 Posts
Any update on this thread?
Old Mar 4, 2012, 02:24 PM
  #10  
Evolving Member
Thread Starter
 
dparrish's Avatar
 
Join Date: Apr 2011
Location: Sydney
Posts: 145
Likes: 0
Received 0 Likes on 0 Posts
Sorry, I've been overseas away from my development machine, and today is my first day back. I'll try and take a look at it tonight. Other people have had the same problem, and while that particular problem is easy to fix, the problem is that other things in the script don't work on older versions of IDA, and that's a much harder problem. If you can upgrade you'll find it works fine
Old Mar 4, 2012, 02:59 PM
  #11  
EvoM Guru
iTrader: (7)
 
CDrinkH2O's Avatar
 
Join Date: Nov 2006
Location: San Francisco
Posts: 1,142
Received 153 Likes on 116 Posts
6.1 IDA Pro is what you need. I had the same problems with 5.1. Script runs fine with 6.1
Old Jun 6, 2020, 05:20 AM
  #12  
Newbie
 
professor_jonny's Avatar
 
Join Date: Jan 2020
Location: taranaki
Posts: 44
Received 2 Likes on 2 Posts
Is there any chance this script could get updated to work with newer versions of IDA and newer instructions for newer versions of IDA?

It is Hard to track down an old version to be able to disassemble a rom, and in newer versions the menu layout ect in the instructions differ.

found out the script was saved from the web site in html not as plain text the script now works.

Last edited by professor_jonny; Jun 6, 2020 at 05:36 AM.
Old Mar 14, 2022, 06:18 AM
  #13  
Newbie
iTrader: (3)
 
dingus's Avatar
 
Join Date: Jul 2010
Location: Arkansas
Posts: 78
Received 1 Like on 1 Post
Script mirror...

Originally Posted by professor_jonny
Is there any chance this script could get updated to work with newer versions of IDA and newer instructions for newer versions of IDA?

It is Hard to track down an old version to be able to disassemble a rom, and in newer versions the menu layout ect in the instructions differ.

found out the script was saved from the web site in html not as plain text the script now works.
I was wondering if you could share a copy of the script with me? Can you PM met or post a mirror? I have been trying to get back into this looking at the FlexFuel patches and other items from MrFred and have had trouble with the download links...
Old Mar 14, 2022, 08:33 PM
  #14  
Newbie
 
professor_jonny's Avatar
 
Join Date: Jan 2020
Location: taranaki
Posts: 44
Received 2 Likes on 2 Posts
Originally Posted by dingus
I was wondering if you could share a copy of the script with me? Can you PM met or post a mirror? I have been trying to get back into this looking at the FlexFuel patches and other items from MrFred and have had trouble with the download links...
You can find info on github under dparish/ecurom as below it is the fullest pack of info I could find it is the newest scripts I could find and was merged from goglecode to github sometime ago.:

dparrish/ecurom: Automatically exported from code.google.com/p/ecurom (github.com)

This may also be handy :
Evo ECU Dissassembly (evoscan.com)

Last edited by professor_jonny; Mar 14, 2022 at 08:50 PM. Reason: add info
Old Mar 15, 2022, 05:46 AM
  #15  
Newbie
iTrader: (3)
 
dingus's Avatar
 
Join Date: Jul 2010
Location: Arkansas
Posts: 78
Received 1 Like on 1 Post
You're the best!

Originally Posted by professor_jonny
You can find info on github under dparish/ecurom as below it is the fullest pack of info I could find it is the newest scripts I could find and was merged from goglecode to github sometime ago.:

dparrish/ecurom: Automatically exported from code.google.com/p/ecurom (github.com)

This may also be handy :
Evo ECU Dissassembly (evoscan.com)
Thank you very much for the links! I have spent lots of time digging and didn't find this github. IDK if I will get anywhere but have to start somewhere. Thanks again!


Quick Reply: Auto-Disassembly Script



All times are GMT -7. The time now is 02:42 AM.