30 January 2020, 14:37 | #21 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
Magic Pockets level format was so clear that I reverse engineered it without looking at the source
I agree that trying to look up obvious counters is the way to go. Same goes for lives when you're trying to reverse gameplay, player position vs enemies, etc... Start by something, and work your way up. Instead of staring at the code all day. |
30 January 2020, 15:04 | #22 | |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Quote:
|
|
30 January 2020, 15:07 | #23 | |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Quote:
My progress so far is to decode the level tiles and tile map, they are in a trivial format on disk. It's just the enemy placement I can't figure out. There must be some data with all the enemies locations and some stuff about what kind they are, what type of shots they have etc. Actually it's probably just indexes to lookup tables because the enemy behaviour changes with the difficulty level. On normal a lot of them don't shoot back, on hard everything does. |
|
30 January 2020, 15:09 | #24 | |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Quote:
|
|
30 January 2020, 15:33 | #25 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 511
|
The Resource disassembler, i uploaded the latest version in the zone.
Be sure to use "New Syntax" (in "option 1") (fixes a bug). |
30 January 2020, 17:18 | #26 |
Registered User
Join Date: Sep 2016
Location: Deventer - Netherlands
Posts: 599
|
|
23 March 2020, 22:17 | #27 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
Does IRA recognize hunks symbols if présents in the executable and use them in the produced source file ?
|
23 March 2020, 22:30 | #28 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
yes, it does. What I'd like is a tutorial to do multi-pass with IRA. This is my number one choice because it's batch (at least for first pass) and you can rework the text using batch tools.
I've written a few python tools over IRA to make system calls appear clearly for instance, or to detect self modifying code or cpu dependent loops. One python module I discovered today was capstone (directly available via pip/pypi). It can disassemble a huge number of CPUs and even 68060 is supported. I made a quick test: Code:
import capstone code = b"\x4E\x71\xf2\x10\x44\x00" # NOP + a FPU 040 instruction md = capstone.Cs(capstone.CS_ARCH_M68K,capstone.CS_MODE_M68K_040) for i in md.disasm(code, 0x1000): print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str)) Code:
0x1000: nop 0x1002: fmove.s (a0), fp0 Last edited by jotd; 23 March 2020 at 23:02. |
24 March 2020, 00:43 | #29 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
I did an extensive tutorial in german on the a1k.org forum, several years ago. Maybe a quick translation could already be helpful, but better would be to rewrite everything based on the latest IRA version. Otherwise, anybody may always ask me for help. |
|
24 March 2020, 09:05 | #30 | |
Joy Division
Join Date: Nov 2006
Location: East Yorkshire
Age: 60
Posts: 239
|
Quote:
|
|
24 March 2020, 10:29 | #31 |
Registered User
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 171
|
|
24 March 2020, 12:20 | #32 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
|
rule is: always write in english. After a while someone requests it
thanks in advance for the tutorial! |
24 March 2020, 12:40 | #33 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
Is there an option to recognize symbols? I can see that it found some but not all of them.
What is the link of your German tutorial ? Better use deepl than google. |
24 March 2020, 17:19 | #34 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Unfortunately a link to a1k makes no sense, because most sections are only accessible after registration.
Ok, so I just invested two hours to quickly translate the original tutorial text and copied everything over. The tutorial can be found here: http://eab.abime.net/showthread.php?p=1387237 Hope it helps, although the tutorial is nearly 7 years old. But as far as I could see everything shown there should still work with recent IRA versions. Questions to IRA might be asked in the linked thread. |
17 April 2020, 15:43 | #35 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Thanks for the assistance. I need to find some time to put into learning how to do this.
I was really hoping to avoid having to get too in depth with it and just get enough of a hint as to how Sidewinder interprets the level data files. It's probably not that complicated, I bet it's just some tile X/Y coordinates for spawning and probably some kind of virtual machine for movement. |
13 December 2021, 23:18 | #36 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
I've been trying out Ghidra with the Amiga hunk extension. I think it's struggling with Sidewinder because the game was written in assembler.
For example, there are a lot f lines like this: *(int *)(unaff_A4 + -0x60f0) = iVar2; Ghidra can't seem to understand the concept of using A4 as a data structure pointer. A4 is hard coded to 0x22cede, which doesn't make a lot of sense to me. That appears to be right in the middle of autoconfig space on an A500. |
08 January 2022, 23:23 | #37 |
Registered User
Join Date: Oct 2005
Location: russia/moskow
Age: 44
Posts: 181
|
Today is the beginning of 2022, and I tried both IDA 7.5 (with all decompilers it has) and Ghidra.
IDA doesn't have by default decompiler to C pseudo-code from 68k, only disassembler. And do not know if it has it at all anywhere. But by default IDA has amiga-hunk support. So for disassembler needs it out of the box. But as it wants to be compiled by "as" probably there will be hard times to make reassemble from it. So IRA there won. Through, IDA has decompiler for PowerPC (if anyone there in interest about at all), so I for sake of test trying simple: Code:
#include <stdio.h> int main() { printf("asdfadsf"); } Code:
int __cdecl main(int argc, const char **argv, const char **envp) { puts("asdfadsf", argv, envp); return 0; } But that for PPC, for 68k IDA didn't have c-pseudo-decompiler. And I don't find any in google (maybe anyone knows if there are any?) But on Ghidra, while it didn't have by default support of AmigaHunks and which you install separately for example from there: https://github.com/lab313ru/ghidra_amiga_ldr , it does have decompiler for 68k by default. And together with the amiga_hunk extension, it gives pretty interesting results. Disassemble by default different from IRA, but looks more readable. For example part about OpenWindow used from BlitBasic call on IRA: Code:
MOVE.W D0,46(a4) MOVEA.L A4,a0 MOVEA.L (A7)+,A4 JSR -204(A6) MOVE.L D0,A3 Code:
10013e22 39 40 00 2e move.w D0w,(0x2e,A4)=>DAT_10014630 10013e26 20 4c movea.l A4,A0 10013e28 28 5f movea.l (SP)+,A4 10013e2a 4e ae ff 34 jsr (-0xcc,A6=>exec_AllocAbs) undefined dos_WaitForChar(pointe undefined exec_AllocAbs(pointer -- Call Destination Override: exec_AllocAbs (0033f0cc) 10013e2e 26 80 move.l D0,(A3) So a bit fucked up with JSR LVO (At it not exec), but probably because it can only detect bases for exec and dos, but not for others, we have that. Need to add, that when i use Jdot's "cheapres.py" it also fails to detect those bases, but at least wrote "unknown" on that place. But what is most good, is that decompiler in Ghidra works. And that is what it gives me for the same place of OpenWindow() call: Code:
DAT_10014630 = (undefined2)(*(ushort *)(DAT_10014620 + 0x14) & 0xffff000f); DAT_1001460a = unaff_D3b; DAT_1001460b = unaff_D4b; iVar1 = exec_AllocAbs((undefined *) (DAT_1001461c & 0xffff0000 | *(ushort *)(DAT_10014620 + 0x14) & 0xffff000f), DAT_10014620); *unaff_A3 = iVar1; if (iVar1 != 0) { Also, Ghidra's decompiler is good for all those "if/else" loops, see attach at the end of the post. For sake of tests i also tried on Ghidra the same test case with prinfs of amigaos4 build (so PowerPC) binary (which is ELF). Ghidra there detect ELF out of the box, i only was in needs to choose in language "PowerPC:BE:32:default:default" and have for the same printf such an output: Code:
undefined4 main(void) { puts("asdfadsf"); return 0; } In other words, and IMHO: for amigaos3/68k: IRA + Ghidra defaul + amigahunk plugin for amigaos4/powerpc: IDA or Ghidra can be used both. Last edited by kas1e; 08 January 2022 at 23:30. |
09 January 2022, 08:07 | #38 | ||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Bummer! That wouldn't affect straight reassembly, but is a problem if you are trying to understand what the code does or translate it to a different language.
Quote:
Blitz BASIC was written in assembler and we have the source code for it, so I'm not sure what use 'decompiling' to C is when the original wasn't written in C. Quote:
|
||
09 January 2022, 18:28 | #39 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
@bruce
Any estimated date for a public release of your disassembler? |
10 January 2022, 03:10 | #40 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
|
Quote:
I will put a 'beta' version on The Zone for you guys to rip to shreds give me some feedback on before committing to a full public release. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disassembler | copse | Coders. General | 86 | 01 January 2023 20:34 |
Peasauce disassembler | copse | Coders. General | 1 | 31 January 2021 20:54 |
IDA Disassembler | BippyM | Coders. General | 36 | 03 October 2018 10:51 |
68K assembler/disassembler syntax | nocash | Coders. Asm / Hardware | 13 | 23 April 2016 00:35 |
A good 68K disassembler | TikTok | request.Apps | 11 | 23 January 2002 03:49 |
|
|