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  [ 47 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 1:33 am 
Offline
Newbie

Joined: Fri Aug 02, 2024 1: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 1:55 pm 
Offline
Newbie

Joined: Thu Jun 22, 2023 11:20 pm
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: DarkMIKE 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