RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Tue Dec 23, 2025 9:16 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: ghidra checklist
PostPosted: Mon Jul 04, 2022 8:04 am 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
Pytrex wrote:
- Ghidra still does a pretty lackluster job of finding functions


Interesting, that hasn't been my experience... Have an example ? I recently loaded 6Z68A, 4M860, and ghidra is picking up nearly everything. Not saying it's perfect, but it's at least as good as IDA .

Quote:
- Ghidra sometimes struggles with figuring out RAM addresses that are called using offsets.

Do you mean like what I described here https://github.com/NationalSecurityAgen ... ssues/4387 ?

Quote:
- Figuring out the optimal auto analysis profile would be very beneficial.

Agreed. Currently I'm using almost defaults, but I disabled
ASCII strings
Demangler GNU
Embedded Media

Sometimes I enable "Scalar Operand References" but I haven't really paid attention to what exactly changes.

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: ghidra checklist
PostPosted: Sun Dec 04, 2022 9:16 pm 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
Can't believe I forgot to get back to this lol

fenugrec wrote:
Interesting, that hasn't been my experience... Have an example ? I recently loaded 6Z68A, 4M860, and ghidra is picking up nearly everything. Not saying it's perfect, but it's at least as good as IDA .

Yea, stuff like this happens with every ROM. For CF48D I spent a few hours manually going through the entire ROM just to ensure that I created all the proper functions, as Ghidra missed quite a few. And it's not like it's missing complex things either, it's missing basic functions like shown below.
Attachment:
KB56C Ghidra Missed Function.png


Quote:
Do you mean like what I described here https://github.com/NationalSecurityAgen ... ssues/4387 ?

Not quite. IIRC, I was just referring to Ghidra not being able to figure out what a RAM address would be if it was called using offsets. So if r4 = 0xFFFF1234, r5 = 0x01, a line that used r4 + r5 as the address would result in Ghidra just not showing any address at all, rather than the expected result of 0xFFFF1235. But I haven't found why Ghidra does a great job most of the time, then randomly just can't figure it out no matter what in a few sections.

Quote:
Sometimes I enable "Scalar Operand References" but I haven't really paid attention to what exactly changes.

I leave that disabled, as it causes Ghidra to interpret waaayy too many data bytes as addresses. Even with it disabled, Ghidra still does it, but just not as frequently.


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

_________________
NissanDefinitions Repository


Top
 Profile  
 
 Post subject: Re: ghidra checklist
PostPosted: Fri Dec 23, 2022 12:07 pm 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
Pytrex wrote:
I leave that disabled, as it causes Ghidra to interpret waaayy too many data bytes as addresses. Even with it disabled, Ghidra still does it, but just not as frequently.

Made some progress on this. Seems to be directly caused by "SuperH4 Constant Reference Analyzer" or "Basic Constant Reference Analyzer" for SH2. So what you need to do is disable "Stored Value Pointer Analysis" within "SuperH4 Constant Reference Analyzer". When comparing CF48D with and without this change, it appears that it mostly works as intended. There are still a few addresses that get wrongfully shown, but it seems to remove most of them at the very least.

On the left is CF48D with the adjusted options, on the right is CF48D without them. As you can see, it looks MUCH nicer lol The worst part is those addresses are counted as legitimate references. So common hex values like 0x8000 end up causing there to be 200+ references to the address 0x8000, it's insane lol
Attachment:
SH4Fixed.png


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

_________________
NissanDefinitions Repository


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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