RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 2:24 pm

All times are UTC




Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Using Ghidra to define a Suby ROM
PostPosted: Wed Nov 06, 2024 5:33 am 
Offline
Newbie

Joined: Fri Aug 02, 2024 5:07 pm
Posts: 1
Hey I'm new here and trying to get started adding definitions for my 07 OBXT.

I have:

- My ROM (ID A2UG000N)
- the latest RR ecu_defs.xml,
- latest RR logger defs logger_STD_EN_v370.

I've installed Ghidra, but I'm running into a whole bunch of issues trying to get the XmlToGhidra C# script to run.

I can't figure out what version of .NET I'm supposed to use. With both 9 and 6, I get an error "CS0234: The type or namespace 'Forms' does not exist in the namespace 'System.Windows'"

After digging around, it seems like this is an unavoidable issue if you're trying to run on anything other than Windows. Which makes sense, given how deeply entrenched C# is in Microsoft's ecosystem.

I've written my fair share of scripts in a bunch of languages, but trying to run this simple C#/.NET script has made me feel like an idiot. Can anyone walk a total moron through the steps to run the XmlToGhidra script? Or an alternative approach? If I understood what the script was meant to produce, I might be able to fumble my way through a python port.


Top
 Profile  
 
 Post subject: Re: Using Ghidra to define a Suby ROM
PostPosted: Thu Dec 05, 2024 5:55 pm 
Offline
Newbie

Joined: Fri Jun 23, 2023 3:20 am
Posts: 9
I'm still newer to all this, I'll try to help.
I start off by just running XmlToGhidra.exe without any data first, for me in command prompt cd to
“cd C:\Users\vfdaq\Documents\Tools Setup\ghidra_add_ons\ghidra_scripts\xmltoghidra”
just to make sure I have access to the folder XmlToGhidra.exe is located in.
Then I type in “XmlToGhidra” and enter. The following Usage text should populate

Usage:
XmlToGhidra.exe <category> <options>...

Where <category> is one of the following:
tables <cal-id>
stdparam <cpu> <target> <cal-id> <ssm-base>
extparam <cpu> <target> <ecu-id>
makeall <target> <cal-id> <ssm-base>
ecuf <filename.xml>

Where <options> is the following as required by the category:
<cal-id> is the Calibration id, e.g. A2WC522N
<cpu> is the CPU bits identifier of the ECU, e.g. 16 or 32
<target> is the Car control module,
e.g. ecu (engine control unit) or tcu (transmission control unit)
<ecu-id> is the ECU identifier, e.g. 2F12785606
<ssm-base> is the Base address of the SSM 'read' vector, e.g. 4EDDC

And you'll want to redirect stdout to a file, like:
XmlToGhidra.exe ... > Whatever.java

Once you know you have access to the folder and the XmlToGhidra is executable then I move onto the next step.

Make sure your logger.xml and ecu_defs.xml are in the same folder as the XmlToGhidra

some examples of things to run
XmlToghidra.exe tables e2vg221d > XmlToGhidra.java
XmlToghidra.exe tables E2VL001B > XmlToGhidra.java
XmlToghidra.exe tables A2WC521N > Tables.java
XmlToghidra.exe extparam 32 ecu 2F12785606 > ExtendedParams.java
XmlToghidra.exe stdparam 32 ecu A2WC522N 4EDDC > StandardParams.java
XmlToghidra.exe makeall ecu A2WC522N 4EDDC > AllTableAndParams.java
XmlToghidra.exe ecuf A2WC521N.xml > Tables.java

enter something like above and a “XmlToGhidra” java file should appear in the folder.

When its done you can import it into ghidra script manager, you can also rename it before importing but if its not done correctly it can have errors. I did it so I could keep different ecu scrips in my library.

It did take me forever to get started with this stuff, don't give up.


Top
 Profile  
 
 Post subject: Re: Using Ghidra to define a Suby ROM
PostPosted: Sun Jan 18, 2026 4:24 pm 
Offline
Newbie

Joined: Fri Jan 07, 2022 2:20 pm
Posts: 6
Hi !

Little alive this post. :lol:
Playing little with Ghidra dissasembly trying to find new tables and then definitions for my AZ1G202I Subaru Impreza STI 2008 ROM file.
I have dissasembled and succesfully finished whole Boot session code and I am going now to Main ECU program, so I am looking forward to see calculations, tables, code and so on. So happy with this forum, very usefull infos here, but now after months and so many sleepless nights I see, that XML to Ghidra utility named my tables great, also X and Y axis, but now I search the ROM and find something like this: SsmGet_Pressure_Difference_between_Diesel_Part....
I have Petrol car no Disesel. Did I some mistake with XML to Ghidra (I used option makeall- "All definitions for ECU: AZ1G202I with SSM read vector base 4EDDC" {is it correct?}) or this is part of SSM which is normal for every Subbie and it is the same in every ROM ? I am little angry on me, I didn't checked that in every table after I run XML to Ghidra script in Ghidra,
I only checked some 3-4 tables and as I mentioned Tables, X, Y axis and DTC codes looks good for My ROM.
But this SSM base I dont know if it is good and where are they come from (what source) , it will be nightmare for me to put now things in Ghidra back, remove Labels and find new ones. But maybe SSM base iis the same?
Thank you for Help.

Mike


Top
 Profile  
 
 Post subject: Re: Using Ghidra to define a Suby ROM
PostPosted: Tue Jan 20, 2026 5:01 am 
Offline
Experienced

Joined: Fri Aug 21, 2020 10:05 am
Posts: 321
Hi,

Great work!

The SSM parameters are generic for all possible ROMs - petrol, diesel etc

If you have a petrol ROM, you should find that any diesel related SSM parameters just call a null return function.

Hopefully that clarifies


Top
 Profile  
 
 Post subject: Re: Using Ghidra to define a Suby ROM
PostPosted: Tue Jan 20, 2026 5:32 pm 
Offline
Newbie

Joined: Fri Jan 07, 2022 2:20 pm
Posts: 6
Hi rimwall !

Thats great info for me ! Thank you !
Will continue I hope it will go well and will post, when I find, what I am searching for :)

Thank you once more

Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 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