View Code? Open in Web Editor
NEW
This project forked from fuzziqersoftware/resource_dasm
Classic Mac OS resource fork and application disassembler, with reverse-engineering tools for specific applications
License: MIT License
resource_dasm's People
resource_dasm's Issues
There are various if (opcode <= 0x...)
checks to skip unknown/reserved opcodes:
|
} else if (opcode <= 0x01FF) { // args: 2 |
|
this->pict_skip_2(r, opcode); |
|
|
|
} else if (opcode <= 0x02FE) { // args: 4 |
|
r.go(r.where() + 4); |
|
|
|
} else if (opcode == 0x02FF) { // args: 2 |
|
// nop (essentially) because we look ahead in the 0011 implementation |
|
|
|
} else if (opcode <= 0x0BFF) { // args: 22 |
|
r.go(r.where() + 22); |
|
|
|
} else if (opcode == 0x0C00) { // args: header |
|
// Currently we don't do anything with the data in this subheader, so just |
|
// check that its version makes sense and then ignore it |
|
PictSubheader h = r.get<PictSubheader>(); |
|
if ((h.v2.version != -1) && (h.v2e.version != -2)) { |
|
throw runtime_error(string_printf("subheader has incorrect version (%08X or %04hX)", |
|
h.v2.version.load(), h.v2e.version.load())); |
|
} |
|
|
|
} else if (opcode <= 0x7EFF) { // args: 24 |
|
r.go(r.where() + 24); |
|
|
|
} else if (opcode <= 0x7FFF) { // args: 254 |
|
r.go(r.where() + 254); |
|
|
According to IM Imaging with Quickdraw - Appendix A this code could be simplified:
Note: For opcodes $0100-$7FFF, the amount of data for opcode $nnXX = 2 times nn bytes.