tunozemichanの日記 / tunozemichan's diary

SORD社のコンピューターM68やM68MXの解析についての備忘録です。This blog is a memorandum about the analysis of SORD's computers M68 and M68MX.

Disassemble the SORD M68MX (m68k binary) ROM using radare2.

Last time, I used GNU's objdump to disassemble the m68k ROM. However, as I read through the list, I still encountered parts that were impossible to analyze.

 

When I was complaining on Twitter as I did last time, I was informed by someone from overseas that radare2 can also analyze m68k binaries.

 

You can also install radare2 on WSL2.

 

$ git clone https://github.com/radare/radare2.git

 

In the radare2 directory, simply type the following

 

$ ./sys/install.sh

 

If there is a package that needs to be installed, it will tell you each time, so follow the instructions and install it using "apt install".

 

Once installed, type the following to install the radare2 package.

 

$ r2pm init

 

You can now use the package. The capstone m68k assembler/disassembler is included by default, but there is another package, although the details are not clear, so we will install it.

 

$ r2pm -i m68k-net

 

Now, when you start radare2, you can do the following to use this plugin (bios.bin is an appropriate m68k binary file).

 

$ r2 -a m68k.net bios.bin

 

If you are fine with the default capstone, enter the following

 

$ r2 -a m68k bios.bin

 

By the way, disassembly is a pd command. From the current address (0xc2 in this case), 10 lines? If you want to disassemble

 

[0x000000c2]>pd 10

 

If the analysis does not work, you can try the analysis command again.

 

It would be nice if users could suggest, "Isn't this how you interpret this? But I'm not sure if it's possible or how it would be done.

 

 (Serpentine)

If you want to analyze the Z80, type the following to install the package.

 

$ r2pm -i z80-nc

 

Then, when you start radare2, enter the following

 

$ r2 -a z80.nc ROM.bin