| Click here to select a new forum. |
| Figuring Out How a CDEV Resource Works |
Posted by: Paralel on 2013-10-11 14:04:14 If I wanted to study a CDEV resource inside the resource fork of a CDEV, as shown by ResEdit, what would be the best way to approach it?
My programing background is limited, but I understand the basics (not Basic).
I'm looking to try and figure out how a particular instruction is executed by this CDEV resource.
|
Posted by: bbraun on 2013-10-11 14:13:13 The following resources document control panels:
Inside Macintosh: Operating System Utilities, Chapter 5
Inside Macintosh: Volume VI, Chapter 10
Inside Macintosh: Volume V, Chapter 18
The cdev resource is a code resource that is jumped to by the Finder in System 7, and by the control panel desk accessory in System 6. The the arguments to the cdev are passed in registers.
|
Posted by: Paralel on 2013-10-11 14:23:56 Ugh, this is looking much more ugly than I thought...
Software wise, what environment would be my best choice for starting to make sense out of what is there? With ResEdit, I get the hex dump, but that isn't much of a starting point for me.
|
Posted by: bbraun on 2013-10-11 14:30:35 Grab your favorite 68k disassembler and have at it.
I use macsbug for anything in memory, and fdisasm for everything else. Ye Olde Resorcerer can also disassemble some resources.
|
Posted by: Paralel on 2013-10-11 14:34:45 Sounds like fun. I'll keep plugging away at it. Worst thing I can do is just have to restart.
|
Posted by: olePigeon on 2013-10-22 11:57:35 How do emulators work for debugging? If you have to reboot a Mac a bunch of times, doing it on a modern machine would only take a few seconds.
|
Posted by: bbraun on 2013-10-22 14:30:55 Terrible.
BII and SheepShaver don't work with macsbug, the system crashes when triggering a macsbug breakpoint.
MESS can run macsbug, but there's other issues. 1) there's no power button or NMI interface in MESS to break into the debugger. 2) keyboard and mouse inputs in MESS are a bit flakey and unreliable. It makes trying to code/debug/really use the emulator frustrating at best.
|
Posted by: NJRoadfan on 2013-10-22 15:27:50 If the emulator has a built in debugger, it might be a better option.
|
Posted by: bbraun on 2013-10-22 17:41:21 MESS does and the others don't. However, MESS' is setup for debugging MESS and the emulated environment, not for developing code locally. You'll have to enjoy decoding call stacks and debug symbols by hand if you want to use MESS' debugger.
|
Posted by: NJRoadfan on 2013-10-22 18:34:29 I'm actually surprised that Basilisk II lacks a debugger given how mature of an emulator it is. It should be fairly trivial to emulate a native "debug switch" and its NMI though.
|
Posted by: bbraun on 2013-10-22 21:36:25 They take patches, particularly trivial ones. 😉
|
Posted by: Paralel on 2013-10-22 21:47:36 I eventually ended up using Super ResEdit. However, I dumped the project after a few days of staring at the code since it was way over my head. I just bought the software. I guarantee for you guys what was needed would probably have been quite simple, but you only use your powers for good.
|
Posted by: bigmessowires on 2013-10-23 07:56:58
but you only use your powers for good. lol :lol:
Sort of off topic, but this is a GREAT book about reverse-engineering software: http://www.amazon.com/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817
Of course it's about PC software, not 25-year-old 68k Mac programs, but the general concepts are the same for reasoning backwards from a disassembly to reconstruct a program's high level behavior.
|
| 1 |