English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 March 2021, 05:00   #1
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Ghidra for amiga disassembling

I see that Ghidra supports "68xxx" and there's a executable file loading extension. Has anyone given a shot? Thoughts? I've been thinking about playing around with my disassembler, but wondering if I am better off using Ghidra, especially since people talk about "ghidra servers" and mutual reverse engineering efforts.

https://github.com/lab313ru/ghidra_amiga_ldr/
copse is offline  
Old 03 March 2021, 08:00   #2
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
It's being used extensively to reverse engineer Ambermoon
alexh is offline  
Old 21 June 2023, 15:54   #3
Nightshft
Registered User
 
Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Posts: 617
When I try to build the amiga_ldr extension using gradle I just get this error. (I've not used gradle before). Any Ideas how to solve this?

Btw, I installed JDK 17.0.7 and Gradle 8.1.1.

Edit:

Now I was able to build Bartmans fork of the extension with gradle.
However still no luck in installing the extension.
In the "Install Extensions" list the entry is there, but in red colour.

Am I supposed to build the extension using gradle or just place the folder/zip at the right place and Ghidra will build it when selected?
Sorry, I don't have experience in this...
Using Ghidra 10.3 public btw...
Attached Thumbnails
Click image for larger version

Name:	gradle-error.PNG
Views:	106
Size:	22.8 KB
ID:	79465  

Last edited by Nightshft; 21 June 2023 at 17:06.
Nightshft is offline  
Old 21 June 2023, 17:35   #4
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
I just downloaded the release (https://github.com/BartmanAbyss/ghid...s/tag/20230525) and installed that without compiling it myself, and it works fine with Ghidra 10.3. No need to compile it yourself unless you want to.

To install, open file->install extensions..., press the green + button and select the zip file (don't extract it).
paraj is offline  
Old 21 June 2023, 20:58   #5
Nightshft
Registered User
 
Nightshft's Avatar
 
Join Date: Mar 2018
Location: Austria
Posts: 617
Well now that really took some tries...
but now it works. Thanks paraj

Note:
Ghidra 10.3.1 still wouldn't take it.
Extension version for [extname.zip] is incompatible with Ghidra.
I had to edit extension.properties to reflect version 10.3.1 and then it worked finally =)
Nightshft is offline  
Old 16 July 2023, 08:16   #6
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Thanks for the notes paraj and nightshift. These are valuable hints to save time, much appreciated.
copse is offline  
Old 18 July 2023, 14:29   #7
arkiruthis
Registered User
 
arkiruthis's Avatar
 
Join Date: Jun 2021
Location: UK
Posts: 29
I used Ghidra for finding the terrain gen in PowerMonger, but I have a question about it.

The "Languages" section of Ghidra, without realising I selected the "68000 Coldfire" language option initially thinking it was just 68000.

There's language options for 68020 and 68040 big endian as well. It worked fine, but for amiga dissassembly I'm not 100% sure which one I should be using. There doesn't seem to be a 68000 "default" big endian option and I don't think Coldfire was the same chip.
arkiruthis is offline  
Old 18 July 2023, 14:40   #8
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
The coldfire instruction set is a subset of the 68000 instrution set, so some instructions would likely be marked as invalid. The 68020 is a superset of the 68000 instruction set. As long as the source does not use any of the 68040 specific instructions, or only 68000 instructions, you would be safe.
Thomas Richter is offline  
Old 18 July 2023, 15:13   #9
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Coldfire aka cpu32, you can check the m68k programmer's ref guide if you are interested in details. Basically, it has a small subset of the 68020+ stuff, doesn't have all of the base 68000 stuff, and it has some exclusives that 68000+ don't have.
a/b is offline  
Old 18 July 2023, 18:30   #10
arkiruthis
Registered User
 
arkiruthis's Avatar
 
Join Date: Jun 2021
Location: UK
Posts: 29
Thank you both!
arkiruthis is offline  
Old 07 November 2023, 20:03   #11
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
I'm using Ghidra with the Amiga extension to analyse a C executable, which uses the small data model. Is it possible to pass a base register and value to the analysis so to that data labels can be derived? The equivalent of the ira config BASEREG and BASEADR directives.
hop is offline  
Old 07 November 2023, 20:12   #12
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Originally Posted by hop View Post
I'm using Ghidra with the Amiga extension to analyse a C executable, which uses the small data model. Is it possible to pass a base register and value to the analysis so to that data labels can be derived? The equivalent of the ira config BASEREG and BASEADR directives.
Window->Script Manager->Scripts->Amiga->ApplyRegBase is the closest you'll get AFAIK (only works for A4).
paraj is offline  
Old 07 November 2023, 20:45   #13
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Magic! That seems to have worked thanks.
hop is offline  
Old 08 November 2023, 19:37   #14
arkiruthis
Registered User
 
arkiruthis's Avatar
 
Join Date: Jun 2021
Location: UK
Posts: 29
I've been analysing a raw RAM export (.data) from WinUAE in Ghidra for quite a while now. Naming functions, renaming labels and data areas, etc.

I want to swap out the RAM data for another snapshot (.data), where I think certain areas will have been updated, but I'm not seeing an easy way to do this?

It's a difficult thing to phrase as a question in Google as well (and google seems to be pretty bad lately, no idea why, so I'm not getting good results there either).
arkiruthis is offline  
Old 08 November 2023, 21:07   #15
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
This sounds like a general Ghidra problem and nothing Amiga specific beyond the context of the data. You should be able to search for people doing this for other architectures.

There is a default symbol import plugin. In the worst case you might be able to see how to export/import symbols and other metadata.
copse is offline  
Old 29 November 2023, 08:24   #16
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Does anyone have any experience with getting Ghidra to recognise jump tables that it does not already recognise in decompiled Amiga code?

My long term Pool of Radiance disassembling project was accelerated by finding that the C# rewriting of disassembled or decompiled Curse of the Azure Bonds PC code had almost identical data structures and code to my Amiga decompilation. But it's stalled on the ECL script VM given Ghidra didn't pick up on the jump tables and map in all the functions.

For reference in case anyone is interested, I had a long term Resource file of my disassembly and saved out the program file from Resource with my symbols. Then I imported that into Ghidra. A lot of my work has I think been perhaps not being clear on where the boundaries of what I am told the Pascal (?) compiler's statically linked functions are thunked in and documenting those structures and functions. But it only has to be done once I guess, then all gold box games are mostly an exercise in repeating the first (given the visible Amiga Pool of Radiance and PC Curse of the Azure Bonds similarities).
copse is offline  
Old 06 February 2024, 01:08   #17
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Anyone tried updating the amiga plugin for Ghidra 11?
copse is offline  
Old 06 February 2024, 13:14   #18
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
Quote:
Originally Posted by copse View Post
Anyone tried updating the amiga plugin for Ghidra 11?
Yes

https://ghidra.nicode.net/
alexh is offline  
Old 07 February 2024, 00:46   #19
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Nice, will give it a shot. Thanks Alex.
copse is offline  
Old 09 February 2024, 22:06   #20
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 522
Just installed 11.0.1 and the 11.0 Amiga extension from nicode. I get a version mismatch message for 11.0.1 not being 11.0, but can click through it. No errors so far.
copse is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help disassembling Wicked moohorse Coders. Asm / Hardware 33 04 June 2023 22:57
Ghidra disassembler / decompiler supports 68000 mark_k Coders. Asm / Hardware 21 20 March 2019 12:09
Disassembling an A600 Revival9001 support.Hardware 2 31 January 2017 07:01
Disassembling resource copse Coders. General 1 02 April 2012 03:36
Disassembling and reassembling absence Coders. General 7 22 September 2009 15:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11405 seconds with 14 queries