RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Tue Dec 23, 2025 11:13 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 174 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Sun Dec 02, 2012 11:05 pm 
Offline
Experienced

Joined: Sun Oct 16, 2011 3:57 am
Posts: 150
Hi guys,

I've tried to follow this with my 32-bit WRX MY11 ROM (AZ1G900C) and the first four bytes are 00 00 0C 0C.

I go to 00000C0C and hit C, and IDA says "error making code" or something along those lines....

Any suggestions on where i've gone wrong ?

Cheers,

Adrian


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Sun Dec 02, 2012 11:48 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
See the first post, section: How do you open a ROM? (32-bit), item #7.
Just jumping to 0x0c0c and pressing C is not enough.
Make sure the correct processor (SH4B device SH7058) is set too.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Mon Dec 24, 2012 11:45 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
I've created two scripts to help decode 16bit ROMs in IDA.
Source: Format16bitROM.idc

Here are the steps:
  1. You will not need to convert your 160kb ROM to 192kb, either size can be opened and formatted by this process.
  2. Open your ROM with IDA.
  3. Change the processor type to Motorola Series: 6816.
  4. No need to define a RAM segment just click OK to proceed.
  5. Under the IDA File menu select Script file (Alt-F7)
  6. Select the script named Format16bitROM.idc
  7. Read the warning and press Yes to proceed formatting the ROM.

At this point the ROM is formatted, interrupts are marked, the RAM segment is defined and the basic code analyzed. Now you can proceed with marking the SSM Standard parameters file as provided by the XmlToIdc application.

To locate the SSM Read vector base address the easiest way is to perform a Hex search on 'a210'. You should get a hit that leads you to the string 'a2100f' for example (see the table at the end of the first post here for other possible third byte values). The next byte is the first byte of the ECU ID. You may wish to name it for future reference. Next complete a Hex search for the last two bytes of the address of this ECU ID byte 1. For example:
Code:
DATA:A8D9                 dc.b 0A2h ; ó
DATA:A8DA                 dc.b  10h
DATA:A8DB                 dc.b  0Fh
DATA:A8DC                 dc.b  3Eh ; ECUID_B1
now search on 'A8DC'. If you get more than one hit you want the hit that leads you to a section of data that has addresses starting with a 0x00, 0x02. For example:
Code:
DATA:BC00                 dc.b    0
DATA:BC01                 dc.b    2
DATA:BC02                 dc.b  18h
DATA:BC03                 dc.b 0A5h ; Ñ
DATA:BC04                 dc.b    0
DATA:BC05                 dc.b    2
DATA:BC06                 dc.b 0A8h ; ¿
DATA:BC07                 dc.b 0DCh ; _
DATA:BC08                 dc.b    0
DATA:BC09                 dc.b    2
DATA:BC0A                 dc.b 0A8h ; ¿
DATA:BC0B                 dc.b 0DDh ; ¦
DATA:BC0C                 dc.b    0
DATA:BC0D                 dc.b    2
DATA:BC0E                 dc.b 0A8h ; ¿
DATA:BC0F                 dc.b 0DEh ; ¦
DATA:BC10                 dc.b    0
the correct search result in this example is at address BC06. The address of the first sequence of 0x00, 0x02 is the SSM Read Base vector address. Here the word 'DATA' can be interpreted as the value 0x02. So the IDA Linear Address for DATA:BC00 is actually 0x02BC00 which is the Read Base vector address needed by the XmlToIdc program to produce the stdparam marking file.

Once you have produced the stdparam.idc file, in IDA run the script using the File menu Script file item. It will take a couple of minutes to complete the stdparam.idc script and provided messages of its progresses. It is normal to see some "No reference" messages for unsupported SSM parameters.

If you now open the Names (Shift-F4) window of IDA you can see the marked RAM locations, the pointers to these and the getter subroutines.

Decoding subroutines... because the 6816 processors uses the IX, IY, IZ registers as address extension registers, the processor instuction operands are not fully represented as addresses in the code. To assist in fixing up those addresses you can run the Convert16bitOperand.idc script on a subroutine or at a single address or over a contiguous selection of addresses to convert the numeric operand to an offset. This should then lead you to the Linear address being referenced by the instruction. Be cautious of operands with a value lower than 0x0f as these are sometimes used as offsets to a modified index register that has been previously loaded with an address other than the base 0x20000.
Source: Convert16bitOperand.idc

Note: each of these scripts has a description and some help in the comments at the beginning of each file. Just open them in a text editor to view the comments.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Mon Dec 24, 2012 12:33 pm 
Offline
Moderator

Joined: Thu May 20, 2010 4:01 am
Posts: 3117
Location: Johannesburg, South Africa
I've used the above scripts with great results on the 16 bit Roms - thanks for these Dale, they save a tremendous amount of time.

_________________
He who dies with the most gadgets wins.

Please do not PM me - use the email option.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Tue Jan 08, 2013 8:23 am 
Offline
Newbie

Joined: Tue Jan 01, 2013 8:51 am
Posts: 4
Location: Ukraine
Hello guys, I'm new in IDA analizing and I have some questions. Help me please.
So, finely I found how to open ROM and make autoanalizing.
I found "how to" about DTC.
But I can't use Dschultz's scripts.
I have "syntax error" and these scripts syntax is different from inrernal sample IDA scripts.
Which version of IDA do you use or what I doing wrong?
I use Ida Pro 6.1 . It accept "sh3.def" and I have list of processors (7055, 7058,7058H)
Ida Pro advanced 5.5 doesn't accept "SH3.def" (syntax error) so I can't choose a processor type.
thank's for attention.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Wed Jan 09, 2013 10:48 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
You may wish to read this and this.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Wed Jan 09, 2013 3:03 pm 
Offline
Newbie

Joined: Tue Jan 01, 2013 8:51 am
Posts: 4
Location: Ukraine
dschultz, thanks for reply. But I read all this carefull lot of times.
Which version of IDA do you use?


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Wed Jan 09, 2013 5:08 pm 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
I have whatever the latest release is.
You mentioned auto analyze doesn't work. Did you:

7) Make an analysis pass. From the "Options" menu, click "General." Under "Kernel Options 1" select "Make final analysis pass." Click "Reanalyze Program." IDA should spend a minute analyzing the ROM, marking some sections as code and others as data. This is very helpful, but again it is not perfect - there will be sections of code erroneously marked as data, and vice-versa.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Thu Jan 10, 2013 2:39 am 
Offline
Newbie

Joined: Tue Jan 01, 2013 8:51 am
Posts: 4
Location: Ukraine
pffff... Dschultz, Thanks again.
While I waited few days for premoderation of my post I solved all my previous problems.

So now I can load Rom and make autoanalize. I can find any 3-d table or some of 2-d (f.e. Maf), I can find all of Dtc.
But I do it in manual mode.
Now I have 2 problems-
1. scripts doesn't works. Ida send me error message.
2. XmlToIdCon.exe doesn't work too. But there problem whith my Win Xp Sp3- Ntvdm send me error when I run XmlToIdCon.
So maybe I should fix problem with Ntvdm to run XmlToIdcon first?
Or scripts must to work without it?
Thanks.

P.S. I'm not SW developer. I just have some knowleges in programming and understand "how it works".
I want to use Ida disassembly to faster find neccessary tables and Dtc in undefined Roms.
Also add new features to my own az1e400u.
I have install wrx 08 ecu into my Impreza 08 2.0 na. Then I rebuild my Ej204 engine into 2,5 l (like Ej254) with 8000 redline.
Next step will be install of Kelford 278 cams, new intake manifold and biggest throttle.
So now all new defs and additional tables can be very helpfull for me.
And I don't want disturb you guys with add them all to my rom.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Thu Jan 10, 2013 10:52 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
It's hard to help if you don't provide the error info for each problem.
You do have Microsoft .NET framework installed right?


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Fri May 03, 2013 8:35 am 
Offline
Experienced
User avatar

Joined: Thu Jul 22, 2010 6:22 am
Posts: 148
Location: Australia
Can some one tell me if both the kickdown sw and the si-drive param get loaded with zero in this example?
Attachment:
Untitled.png


You do not have the required permissions to view the files attached to this post.

_________________
09 ADM WRX/ 3" Exforce Turbo Back, Hyperflow TMIC, AEM CAI, Perrin Turbo Inlet, TGV Delete, Ported VF-52, Walbro Pump, Hybrid boost control (Grimmspeed EBCS/MBC), SI-Drive Mode Selector (3 pos Rocker Sw)/ Self tuned @ 17 Psi, Last dyno run 206Kw.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Fri May 03, 2013 8:38 am 
Offline
Experienced
User avatar

Joined: Thu Jul 23, 2009 1:46 pm
Posts: 863
That's odd. Its loading SI mode value to r6 and immediately overwriting it with kickdown address..

Looks to me like it only writes zero to the kickdownswitch value.

_________________
Please do not send me support questions via PM, use the forum instead!


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Fri May 03, 2013 9:54 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
Easty wrote:
Can some one tell me if both the kickdown sw and the si-drive param get loaded with zero in this example?
Attachment:
Untitled.png

What does the rest of the subroutine do? This could just be part of a sequence of parameter initialization upon ECU reset.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Fri May 03, 2013 10:23 am 
Offline
Experienced
User avatar

Joined: Thu Jul 22, 2010 6:22 am
Posts: 148
Location: Australia
Quote:
That's odd. Its loading SI mode value to r6 and immediately overwriting it with kickdown address..

Looks to me like it only writes zero to the kickdownswitch value.

I agree! It just through me off because I couldn't understand why they would overwrite r6 straight up.

Quote:
What does the rest of the subroutine do? This could just be part of a sequence of parameter initialization upon ECU reset.

I think its a code remnant from a function not used for my rom revision! (I've semi confirmed this through looking at other roms)
As some of the code seems to be missing and from what I can see it only achieves one thing it zeros out the kickdown sw.

I'm actually looking at hijacking this routine to implement SI-Drive on my non S-Drive car I've found a routine that determines tgv position based on the input voltage. So all I have to do is change the thresholds and change the results from 0,1,2 to 1,2,3. I'll use the hijacked kickdown routine to call the determination routine and store my SI-Drive mode.
Attachment:
Untitled.png


Thoughts? I hope it works the great thing is I can make all changes with a hex editor!


You do not have the required permissions to view the files attached to this post.

_________________
09 ADM WRX/ 3" Exforce Turbo Back, Hyperflow TMIC, AEM CAI, Perrin Turbo Inlet, TGV Delete, Ported VF-52, Walbro Pump, Hybrid boost control (Grimmspeed EBCS/MBC), SI-Drive Mode Selector (3 pos Rocker Sw)/ Self tuned @ 17 Psi, Last dyno run 206Kw.


Top
 Profile  
 
 Post subject: Re: How To: Get started with IDA and disassembly
PostPosted: Fri May 03, 2013 12:43 pm 
Offline
Experienced
User avatar

Joined: Thu Jul 23, 2009 1:46 pm
Posts: 863
Excellent work :D

I have some very alpha test code for map switching that uses SI Drive for selection. TGV input control for non-SI cars is working its way up the TODO :wink:

_________________
Please do not send me support questions via PM, use the forum instead!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 174 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: DarkMIKE and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl