|
RomRaider
Documentation
Community
Developers
|
|
Page 1 of 1
|
[ 15 posts ] |
|
| Author |
Message |
|
CSXRT4
|
Post subject: Can someone help me with IDA disassembly? Posted: Thu Aug 05, 2010 4:24 am |
|
 |
| Newbie |
Joined: Fri Apr 17, 2009 5:19 am Posts: 42
|
Ok, im trying to step into the disassembly game and after messing with it for a couple day I cant get a handle on things  Ive had some experience with messing with disassemblies from turbo dodges, and I have been able to create code mods and such with that. But this subaru stuff is confusing the heck out of me... Ive pretty much gotten to jumping to 0x220 and hitting "C" and thats about it lol. Ive used the .xml files to find data areas and convert the hex bytes to data that matches with what romraider shows. But some of the tables wont even show up, like "Primary Open Loop Fueling" @ 0x28E12 (Im testing on an 03wrx map A4TC300L), when I try to jump to 0x28E12 it doesnt even exist because the rom dissy only goes to 0x27FFF???? When I open the rom I put in "motorola series: 6816", but then it asks for rom and ram areas??? How do I get to the point where I can have each subroutine named and commented so that I can see whats going on??? Any help would be awesome. Thanks 
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Thu Aug 05, 2010 9:40 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
|
| Top |
|
 |
|
nsfw
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Fri Aug 06, 2010 4:05 am |
|
 |
| Moderator |
Joined: Thu Nov 23, 2006 2:23 am Posts: 2565
|
|
I'm guessing he has a 16-bit ECU based on his choice of a Motorola 68XX CPU. Unfortunately my thread is somewhat 32-bit specific since that's the only flavor I know.
If someone with 16-bit experience can provide some details I'll be happy to incorporate them into that thread so it can be useful to everyone. I'll give credit whoever provides that info, of course.
What's the CPU type? What are the addresses and sizes of the ROM and RAM segments? How do you find the first instruction, to start the unfolding process? Is the SSM vector laid out the same way? Do the same tricks work for finding it? A link to the instruction-set reference would be very useful, too.
Thanks!
_________________ 2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Fri Aug 06, 2010 12:54 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
|
I'm pretty sure all that is covered in this forum (and on openecu). It just takes time to read all the threads to accumulate the key points. I had spent some time doing that last fall and winter to get myself started in this process. Unfortunately there is no substitute for reading, until someone invents that cool Matrix downloading interface and process. That would be great and I suggest the first course be the processor manual and instruction set. It would be great to look at the code and see it running in your minds eye...
|
|
| Top |
|
 |
|
CSXRT4
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Sun Aug 15, 2010 7:35 pm |
|
 |
| Newbie |
Joined: Fri Apr 17, 2009 5:19 am Posts: 42
|
Ok im starting out with trying to understand the SSM stuff. I read through this thread viewtopic.php?f=25&t=5543 and I think I understand how to find everything but im just not able to? In the thread above, andy seems to be disassembling the group-n rom. I opened this rom up with IDA and found the ecu-id "3D04EA4605" which was right after the "A210". The problem is that in my IDA the ecu-id is at address "0x23163" and andy finds it at "0x2b163". If I search for a reference to "23163" I get nothing but when I search for a reference to "2b163" I find a reference at "0x25D04" and thats the SSM LUT. So im confused as to why the address in my IDA is 8000h off? Code: ROM:23160 dc.b 0A2h ; ó ROM:23161 dc.b 10h ROM:23162 dc.b 0Fh ROM:23163 dc.b 3Dh ; = ROM:23164 dc.b 4 ROM:23165 dc.b 0EAh ; O ROM:23166 dc.b 46h ; F ROM:23167 dc.b 5
But regardless I have found the SSM LUT. Now comes my other issue, im supposed to find a reference to the address at which one of the SSM parameters is located in the SSM LUT right? So the SSM LUT starts at 25D00 and I was looking for the ECT (located at the 8th index?) then that would be at "0x25D20". The way I understand it is, this SSM LUT is an indexed look-up table that has a bunch of pointers right? So if you want to find the coolant temp value you would go to this SSM table and find the 8th index which starts at address "0x25D20" and this index holds the data of 00020CFE which is in itself another address where the coolant temp is stored??? Code: ROM:25D20 dc.b 0 ROM:25D21 dc.b 2 ROM:25D22 dc.b 0Ch ROM:25D23 dc.b 0FEh ; ¦
But I cant find any reference to "20CFE" or "020CFE", so I read that thread and andy says to search for the last two bytes "0CFE". So I do that and I get taken to this subroutine which doesn't seem right. And why would it only go off the last two bytes and not the whole address?? Code: sub_19A06: ldd 17EAh, Z jsr sub_19A5C stab 0CFEh, Z rts ; End of function sub_19A06
|
|
| Top |
|
 |
|
CSXRT4
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Tue Aug 17, 2010 3:18 am |
|
 |
| Newbie |
Joined: Fri Apr 17, 2009 5:19 am Posts: 42
|
|
| Top |
|
 |
|
nsfw
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Tue Aug 17, 2010 8:06 am |
|
 |
| Moderator |
Joined: Thu Nov 23, 2006 2:23 am Posts: 2565
|
|
Dunno about 16-bit code, but in 32-bit ROMs, addresses in the SSM LUT are pointers to functions. So you go to the function address, turn that into code, and you'll usually find a few instructions that pull something from RAM, call a function to convert it to a 1-byte value, and then return.
_________________ 2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!
|
|
| Top |
|
 |
|
tinywrex
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Tue Aug 17, 2010 10:16 am |
|
 |
| Newbie |
Joined: Sun Feb 12, 2006 7:10 am Posts: 90
|
CSXRT4 wrote: So im confused as to why the address in my IDA is 8000h off?
because you are missing the RAM segment which is 0x8000 bytes
|
|
| Top |
|
 |
|
CSXRT4
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Tue Aug 17, 2010 5:04 pm |
|
 |
| Newbie |
Joined: Fri Apr 17, 2009 5:19 am Posts: 42
|
tinywrex wrote: CSXRT4 wrote: So im confused as to why the address in my IDA is 8000h off?
because you are missing the RAM segment which is 0x8000 bytes Is the RAM segment static based on the processor or is it different between roms? How do I go about finding what it is?
|
|
| Top |
|
 |
|
tinywrex
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Wed Aug 18, 2010 9:38 am |
|
 |
| Newbie |
Joined: Sun Feb 12, 2006 7:10 am Posts: 90
|
its interesting that you try to disassemble without knowing the platform  (it is 68HC16) the ram segment is at 0x20000, 0x8000 bytes long
|
|
| Top |
|
 |
|
elevenpoint7five
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Wed Dec 29, 2010 5:11 pm |
|
 |
| Experienced |
Joined: Mon Aug 18, 2008 11:15 pm Posts: 316 Location: Chicago, Illinois
|
|
Not sure why I didn't see this thread sooner, but in the hopes of getting more people interested, here's what you need to do for 16bit ROMs:
-Convert the ROM to 192kb by adding the RAM segment. You can use any hex editor(I use TinyHexer) and insert the file I attached at 0x20000.
-Load the file in IDA, select the Motorola 6816 processor and hit ok on the next few screens. You don't have to change any of the other parameters.
-Hit 'g', 220, enter, 'c', enter.
That will give you most of the ROM unfolded. From there, use the existing defs, and the processor data sheets to work your way through the ROM. If there is interest, I will start a thread going into more detail and allow for questions. Let me know.
Andy
You do not have the required permissions to view the files attached to this post.
|
|
| Top |
|
 |
|
dschultz
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Wed Dec 29, 2010 11:02 pm |
|
 |
| RomRaider Developer |
Joined: Thu May 21, 2009 1:49 am Posts: 7323 Location: Canada eh!
|
Yes please do that thread. There was one started but it's focused on 32 bit stuff. Have a look at the format and maybe follow it if it works for you. viewtopic.php?f=25&t=6303
|
|
| Top |
|
 |
|
nsfw
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Thu Dec 30, 2010 12:45 am |
|
 |
| Moderator |
Joined: Thu Nov 23, 2006 2:23 am Posts: 2565
|
|
Or I can rename that thread and make it more generic. It's mostly just missing three things:
1) RAM and ROM segment definitions (see #4 under "How do you open a ROM?") 2) Where to start disassembly (See #6) 3) Interesting address ranges (in the 3rd or 4th message in that thread)
Let me know and I'll be happy to include the 16-bit stuff and give you credit of course.
_________________ 2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!
|
|
| Top |
|
 |
|
elevenpoint7five
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Fri Dec 31, 2010 5:27 pm |
|
 |
| Experienced |
Joined: Mon Aug 18, 2008 11:15 pm Posts: 316 Location: Chicago, Illinois
|
NSFW wrote: Or I can rename that thread and make it more generic. It's mostly just missing three things:
1) RAM and ROM segment definitions (see #4 under "How do you open a ROM?") 2) Where to start disassembly (See #6) 3) Interesting address ranges (in the 3rd or 4th message in that thread)
Let me know and I'll be happy to include the 16-bit stuff and give you credit of course. I sent you a PM with something I wrote up. Hopefully you can get it posted up in your thread. Anyone that is interested should keep an eye out over here---http://www.romraider.com/forum/viewtopic.php?f=25&t=6303
|
|
| Top |
|
 |
|
nsfw
|
Post subject: Re: Can someone help me with IDA disassembly? Posted: Sat Jan 01, 2011 6:06 am |
|
 |
| Moderator |
Joined: Thu Nov 23, 2006 2:23 am Posts: 2565
|
|
Thanks for the PM! I need some time to ponder how to integrate your 16-bit stuff with the rest and still keep the whole thing readable... maybe Saturday, but probably some night next week.
_________________ 2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 15 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 7 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
|
|