Code Monkey home page Code Monkey logo

68k-mac-rom-maps's Introduction

macintosh ROM maps

This is a quick hack to generate Macintosh ROM map files that can be loaded into Ghidra. Apple released ROM maps with MPW. These are pulled from MPW 3.5 "gold master". I then converted them into unix line endings and munged them into the right format. The converted maps are in the "rom-maps" folder.

Don't see your mac listed? It's got the same map as one of the other ones. See "Makefile" to figure out which one, if you don't already know.

how to use

  1. Get Ghidra and make a new project
  2. Import the Mac ROM, probably as 68000 binary (or 020, or 040)
  3. Open it
  4. In the menu, click Window > Script Manager
  5. Doubleclick ImportSymbolsScript
  6. Select the ROM map
  7. Voila

If you want a nice starting point, go to the first label that's something like "INITSTART", click, and hit 'd', which will start some disassembly.

notes

ran on bash/linux:

for FILE in from-mpw-gm-3.5/ROM\ Maps/ROM.List/*.lst ; do tr '\r' '\n' < "$FILE" | tail -n +9 | awk '{print $1, $3, "l"}' | head -n -1 | sed "s/ \$[0-9][0-9]\,/ /" | sed "s/\\$/0x/" | cat > "$FILE.txt" ; mv "$FILE.txt" rom-maps/ ; done

"ImportSymbolsScript.py" Ghidra file says:

"Imports a file with lines in the form "symbolName 0xADDRESS function_or_label" where "f" indicates a function and "l" a label"

I just add an l to everything because Apple's ROM maps aren't obvious in what is what.

there's a mystery here: in the ROM map files, a line can end with an "E", a "#", or nothing:

  • "E" seems to be functions? entry/exit something? public or something?
  • "#" seems to be data?
  • nothing who knows?

A traps bonus

Want to be able to diassemble Mac code without Ghidra crying at every A trap? Paste the contents of "ghidra-a-traps.txt" into "68000.sinc" below the line starting with ":nop".

This basically inserts ~1000 A traps as opcodes without providing any information to Ghidra about what they do. Still very helpful for manually inspecting code!

68k-mac-rom-maps's People

Contributors

cy384 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.