RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 3:52 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 1:31 am 
Offline
Experienced

Joined: Sun Jun 01, 2008 2:14 am
Posts: 125
Location: Quebec
Hi,

since I have read that both Colby and Merchgod have worked on some sort of automated sh2 disassembly tool, what about integrating subaru ECU into that opensource project:

SH disasssmbler for EVO ecu:
http://dev.logic.net/hg/sh2dis

any taker?

Mart


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 4:02 am 
Offline
RomRaider Developer

Joined: Thu May 21, 2009 1:49 am
Posts: 7323
Location: Canada eh!
I think it was more of an automated definition creation tool they made. I'm pretty sure IDA ($$$$) is the dis-assembler they both use.


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 12:39 pm 
Offline
Experienced

Joined: Sun Jun 01, 2008 2:14 am
Posts: 125
Location: Quebec
This is not an IDA replacement. It tries to perform an automatic disassembly like they are doing but opensource....

dschultz wrote:
I think it was more of an automated definition creation tool they made. I'm pretty sure IDA ($$$$) is the dis-assembler they both use.


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 2:53 pm 
Offline
Experienced

Joined: Sun Jun 01, 2008 2:14 am
Posts: 125
Location: Quebec
I think it might be a good place to start automating stuff to do produce RR or Ecuflash defines....

Mart

Mart wrote:
This is not an IDA replacement. It tries to perform an automatic disassembly like they are doing but opensource....

dschultz wrote:
I think it was more of an automated definition creation tool they made. I'm pretty sure IDA ($$$$) is the dis-assembler they both use.


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 2:54 pm 
Offline
RomRaider Developer

Joined: Thu May 21, 2009 1:49 am
Posts: 7323
Location: Canada eh!
I had run across it before here http://forums.evolutionm.net/ecuflash/4 ... mbler.html


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 2:59 pm 
Offline
RomRaider Developer

Joined: Thu May 21, 2009 1:49 am
Posts: 7323
Location: Canada eh!
Mart wrote:
I think it might be a good place to start automating stuff to do produce RR or Ecuflash defines....

You mean to extend that code to ingest a known def file and use it to try and locate the locations in the unknown ROM?


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 3:03 pm 
Offline
Experienced

Joined: Sun Jun 01, 2008 2:14 am
Posts: 125
Location: Quebec
Quote:
Segment handling is modeled after IDA, and I've tried not to torpedo the possibility of implementing other processors (I'm thinking specifically of H8/500 and HC11, for obvious reasons), but I just haven't had the time to think about that yet. The output doesn't currently include IDA's comment-based cross-references, although that information is tracked and could be added pretty easily. It automatically labels "known" (ie. from the platform docs) vectors and registers, and can follow most branches. Branch handling is done by doing very basic register assignment tracking, and there's a ton of room for improvement here (but it seems to be good enough for "in the wild" ROMs right now).
Read more at http://forums.evolutionm.net/ecuflash/4 ... ck=kcplink


well I think it can be expanded to automatically label known stuff and produce a def file from parsing back?

HEX -> auto labelling -> parse back -> generate def file

make sense?

dschultz wrote:
Mart wrote:
I think it might be a good place to start automating stuff to do produce RR or Ecuflash defines....

You mean to extend that code to ingest a known def file and use it to try and locate the locations in the unknown ROM?


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 3:22 pm 
Offline
RomRaider Developer

Joined: Thu May 21, 2009 1:49 am
Posts: 7323
Location: Canada eh!
Mart wrote:
well I think it can be expanded to automatically label known stuff and produce a def file from parsing back?

HEX -> auto labelling -> parse back -> generate def file

make sense?

I do that right now but in a manual way. I take a ROM that is well known and close to the unknown ROM I want to define. I use IDA so the known ROM is all marked up. I then locate similar locations in the unknown ROM and mark them with the same references as the known ROM. Once the references are marked I dump those to a text file. I then take that text file, the known ROM def file and update the address and size attributes in the def file to create a new def for the unknown ROM. I wrote myself a utility to do this part automatically. So from start to finish I can define a unknown ROM with extended logger parameters in about a day. The part that I have not got my head around is how to automate the marking in the unknown ROM. There has to be many checks and balances to validate that the location being marked is correct. Many routines can be identical for some tables. Also, sometimes the compiler re-orders steps in the routine or uses different registers but the result is the same. This is the development area that would really help in new def creation.


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 3:31 pm 
Offline
Experienced

Joined: Sun Jun 01, 2008 2:14 am
Posts: 125
Location: Quebec
Yeah I know how you guys proceed. I was trying to find a way to ease the pain since there is repetitive part... but you seem to have your script to do that...

maybe more can be automated?

Quote:
dis.py now takes a "-m" command-line argument, which applies Mitsubishi-specific fixups to the ROM. Right now, that means it automatically locates/disassembles jump tables (as indicated by use of MOVA), and also tries to locate the MUT table (and seems to mostly succeed). Both are borrowed from acamus' onload.idc script; he should get the credit for the way I implemented determination of their locations.


Mart

dschultz wrote:
Mart wrote:
well I think it can be expanded to automatically label known stuff and produce a def file from parsing back?

HEX -> auto labelling -> parse back -> generate def file

make sense?

I do that right now but in a manual way. I take a ROM that is well known and close to the unknown ROM I want to define. I use IDA so the known ROM is all marked up. I then locate similar locations in the unknown ROM and mark them with the same references as the known ROM. Once the references are marked I dump those to a text file. I then take that text file, the known ROM def file and update the address and size attributes in the def file to create a new def for the unknown ROM. I wrote myself a utility to do this part automatically. So from start to finish I can define a unknown ROM with extended logger parameters in about a day. The part that I have not got my head around is how to automate the marking in the unknown ROM. There has to be many checks and balances to validate that the location being marked is correct. Many routines can be identical for some tables. Also, sometimes the compiler re-orders steps in the routine or uses different registers but the result is the same. This is the development area that would really help in new def creation.


Top
 Profile  
 
 Post subject: Re: SH2 dissassembler
PostPosted: Thu Nov 25, 2010 3:36 pm 
Offline
RomRaider Developer

Joined: Thu May 21, 2009 1:49 am
Posts: 7323
Location: Canada eh!
Mart wrote:
Yeah I know how you guys proceed. I was trying to find a way to ease the pain since there is repetitive part... but you seem to have your script to do that...

maybe more can be automated?

That would be very helpful. It's the most difficult part as it's an exercise in "artificial intelligence" (AI) programming to mimic what our eyes and brains see and decipher quickly and easily.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


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

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