14 February 2023, 14:38 | #2 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,379
|
I don't
I'm using IRA + cheapres.py (that I have written). Text files, old school. I tried Ghidra on a Z80 program it looped forever and did produce nothing... I suspect that old CPUs are better off with older tools. Kroah made a killing with IDAPro 68000. |
14 February 2023, 15:11 | #3 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
ReSource can directly produce a source that will assemble and run.
Ghidra does not. |
14 February 2023, 19:00 | #4 | ||
Registered User
Join Date: Jan 2023
Location: Denmark
Posts: 36
|
Quote:
Quote:
|
||
14 February 2023, 19:09 | #5 |
Registered User
Join Date: Jan 2023
Location: Denmark
Posts: 36
|
So the way IRA works, is that you do an initial run, write a config file what you want to change, and then run IRA again. And then repeat?
|
14 February 2023, 19:25 | #6 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
A disassembly listing is not an assemblable source. |
|
14 February 2023, 20:14 | #7 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,223
|
In my limited experience Ghidra is an OK supplement, but doesn't really work that well with most amiga software (even if it's written in C and doesn't use dynamic loading/encryption) as common idioms aren't handled, e.g. custom calling conventions (limited support, but requires much effort), negative struct offsets, etc.
BTW the plugin mentioned here https://eab.abime.net/showthread.php?t=111845 seems to be an improvement, but isn't compatible with latest ghidra, so I haven't tried it. |
14 February 2023, 20:43 | #8 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,379
|
Quote:
it's supposed to work that way, but I don't use it like that. I run it once, then I have written a post-processing tool (cheapres.py) which is able to find LVOs, custom chip offsets, annotate Ax-relative jumps and in the latest version you can name offsets/variables in special comments at the start of the asm file (which avoids to use a config file). |
|
14 February 2023, 22:17 | #9 | |
Registered User
Join Date: Jan 2023
Location: Denmark
Posts: 36
|
Quote:
|
|
14 February 2023, 22:19 | #10 | |
Registered User
Join Date: Jan 2023
Location: Denmark
Posts: 36
|
Quote:
|
|
14 February 2023, 23:45 | #11 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,379
|
this is the most annoying issue IRA doesn't do better than the rest because it's a difficult issue. Maybe the worst issue.
I have other tools to detect data "sections", but they're not perfect. If you have one illegal instruction somewhere between 2 labels you could tell that the whole block is data, except that sometimes the entrypoint of the next routine is in a table somewhere and you're missing it because there's no direct jump / label to it (that's when you're reversing absolute assembled code, doesn't happen when reversing relocated executables) So now I try to relocate all the code when it's not already relocated, figuring out jump tables. If you have all entrypoints figured out, then it's more secure to detect data in code "sections". |
15 February 2023, 00:53 | #12 | |
Registered User
Join Date: Jan 2023
Location: Denmark
Posts: 36
|
Quote:
|
|
15 February 2023, 22:18 | #13 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,859
|
I use resource quite a bit but I use more IRA and cheapres.py these days because the iteration os a lot faster. To determine datas vs code I have WinUAE running and use Monam.
|
15 February 2023, 23:30 | #14 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,379
|
get the latest cheapres.py: https://github.com/jotd666/amiga68ktools.git
there's a nice FAQ I've written where new features are explained. |
16 February 2023, 10:29 | #15 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,549
|
Quote:
-preprocand then do a few iterations to find code/data? Quote:
You could even assign symbol names in the config file, which stay on further iterations. Of course, it always depends on what you want to do with the reassembled source. Do you just want to have a quick look what it does (then your approach could be sufficient), or do you want to modify and assemble it into a new executable? |
||
16 February 2023, 10:40 | #16 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,470
|
Ambermoon was disassembled using Ghidra by Nico Bendlin and Pyrdacor with help from KermitFrog using a forked version of ghidra_amiga_ldr which has since been merged back upstream and and re-sourced using an exporter written by Pyrdacor.
It's a very impressive project. https://github.com/Pyrdacor/AmigaAsm I am not involved, so I don't know the full details, only screenshots of them working. As the code is understood and branch labels changed from their auto-generated ones to readable ones, macros defined the code slowly appears to becoming almost high level code once again. I think that is the power of Ghidra you can create a high-level description of the disassembly as you go. As a result Ambermoon is becoming more maintainable and modifiable while retaining the ability to be reassembled (unmodified) into a 1:1 binary. It has allowed Pyrdacor to find and fix lots of bugs. Before re-sourcing bugfixes could only be made if the fix was the same size (or smaller) than the original code, now it doesn't matter. It has allowed him to make sweeping changes such as his universal executable that replaces separate English and German versions and loads text from files making it much easier to maintain and add new localisations. Last edited by alexh; 16 February 2023 at 11:58. |
16 February 2023, 11:19 | #17 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 876
|
I use ReSource because I usually need to understand how code works. This is for me best achived by navigating through the code. Which is supported by interactive working with ReSource. I can also save my work (deciding code/data, labels, comments). Also searching in ReSoure is powerful.
|
09 December 2023, 22:30 | #18 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 259
|
Quote:
I've just added a call to cheapres.py in there (nice!). I've just found myself modifying the cheapres.py source to add these lines: Code:
INCLUDE "custom.i" INCLUDE "LVOs.i" |
|
10 December 2023, 03:27 | #19 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
I've switched over to ghidra. The code might not compile directly when I am done, due to use of non-standard data types and so on, but I can run a script over the code and probably only have to write it once for any future projects.
I am currently working on disassembling a chunk of memory saved out from WinUAE. Some notes:
Ghidra is fine. I'd say give it a shot. Maybe you have to bodge the plugin version to get it to load in the latest release, given it's not actively maintained. But that's not a deal breaker. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ghidra for amiga disassembling | copse | Coders. General | 29 | 02 June 2024 22:38 |
New Ghidra Amiga extension released | Bartman | News | 0 | 08 September 2022 15:43 |
Ghidra disassembler / decompiler supports 68000 | mark_k | Coders. Asm / Hardware | 21 | 20 March 2019 12:09 |
Speed issue 3.3.0 compared 3.2.2 | bladecgn | support.WinUAE | 6 | 13 August 2016 11:30 |
Amiga security compared to other OS | matthey | Amiga scene | 114 | 21 April 2015 08:30 |
|
|