
โครงการนี้มีเครื่องมือหลายอย่างสำหรับแอพพลิเคชั่นและเกมคลาสสิกแบบย้อนกลับของวิศวกรรม
เครื่องมือในโครงการนี้คือ:
apt-get install zlibg1-dev ได้)cmake . จากนั้น makeโครงการนี้ควรสร้างอย่างถูกต้องใน MacOS และ Linux รุ่นล่าสุดอย่างเพียงพอ
Resource_Dasm เป็นตัวแยกส่วนสำหรับส้อมทรัพยากร Mac OS คลาสสิก มันแยกทรัพยากรจากส้อมทรัพยากรของไฟล์ใด ๆ และแปลงรูปแบบทรัพยากร Mac OS คลาสสิกจำนวนมาก (รูปภาพ, เสียง, ข้อความ, ฯลฯ ) เป็นรูปแบบที่ทันสมัย
ตัวอย่าง:
ส่งออกทรัพยากรทั้งหมดจากไฟล์เฉพาะและแปลงเป็นรูปแบบที่ทันสมัย (เอาต์พุตถูกเขียนไปยังไดเรกทอรี ./resource_dasm files/Tesserae
ส่งออกทรัพยากรทั้งหมดจากไฟล์ทั้งหมดในโฟลเดอร์การเขียนไฟล์เอาต์พุตลงในโครงสร้างโฟลเดอร์แบบขนานในไดเรกทอรีปัจจุบัน: ./resource_dasm "files/Apeiron ƒ/" ./apeiron.out
ส่งออกทรัพยากรที่เฉพาะเจาะจงจากไฟล์เฉพาะทั้งในรูปแบบที่ทันสมัยและแบบดั้งเดิม: ./resource_dasm "files/MacSki 1.7/MacSki Sounds" ./macski.out --target-type=snd --target-id=1023 --save-raw=yes
ส่งออกทรัพยากรของแอปพลิเคชัน PowerPC และถอดรหัส: ./resource_dasm "files/Adventures of Billy" ./billy.out ./m68kdasm --pef "files/Adventures of Billy" ./billy.out/dasm.txt
ส่งออกทรัพยากรทั้งหมดจาก Mohawk Archive: ./resource_dasm files/Riven/Data/a_Data.MHK ./riven_data_a.out --index-format=mohawk
เนื่องจากการคัดลอกไฟล์ในระบบไฟล์ประเภทต่าง ๆ คุณอาจมีส้อมทรัพยากรของไฟล์ในส้อมข้อมูลของไฟล์แยกต่างหากแทน ในการส่งออกทรัพยากรจากไฟล์ดังกล่าว: ./resource_dasm "windows/Realmz/Data Files/Portraits.rsf" ./portraits.out --data-fork
สร้างไฟล์ทรัพยากรใหม่พร้อมแหล่งข้อมูลและทรัพยากร clut: ./resource_dasm --create --add-resource=TEXT:[email protected] --add-resource=TEXT:[email protected] --add-resource=clut:[email protected] output.rsrc
เพิ่มทรัพยากรลงในไฟล์ทรัพยากรที่มีอยู่: ./resource_dasm file.rsrc --add-resource=TEXT:[email protected] output.rsrc
ลบทรัพยากรจากไฟล์ทรัพยากรที่มีอยู่: ./resource_dasm file.rsrc --delete-resource=TEXT:128 output.rsrc
นี่ไม่ใช่ทั้งหมด Resource_dasm สามารถทำได้ เรียกใช้โดยไม่มีอาร์กิวเมนต์ใด ๆ (หรือดูที่ print_usage() ใน src/resource_dasm.cc) สำหรับคำอธิบายทั้งหมดของตัวเลือกทั้งหมด
Resource_dasm สามารถแปลงประเภททรัพยากรเหล่านี้:
Type | Output format | Notes
------------------------------------------------------------------------
Text resources
bstr | .txt (one file per string) | *3
card | .txt |
finf | .txt (description of contents) |
FCMT | .txt | *3
FONT | .txt (description) and image (one image per glyph) | *E
lstr | .txt | *3
MACS | .txt | *3
minf | .txt | *3
mstr | .txt | *3
mst# | .txt (one file per string) | *3
NFNT | .txt (description) and image (one image per glyph) | *E
PSAP | .txt |
sfnt | .ttf (TrueType font) |
STR | .txt | *3
STR# | .txt (one file per string) | *3
styl | .rtf | *4
TEXT | .txt | *3
TwCS | .txt (one file per string) |
wstr | .txt |
------------------------------------------------------------------------
Image and color resources
actb | image (24-bit) | *E *8
acur | .txt (list of cursor frame IDs) |
cctb | image (24-bit) | *E *8
cicn | image (32-bit and monochrome) | *E
clut | image (24-bit) | *E *8
crsr | image (32-bit and monochrome) | *E *1
CTBL | image (24-bit) | *E
CURS | image (32-bit) | *E *1
dctb | image (24-bit) | *E *8
fctb | image (24-bit) | *E *8
icl4 | image (24 or 32-bit) and .icns | *E *0
icl8 | image (24 or 32-bit) and .icns | *E *0
icm# | image (32-bit) | *E
icm4 | image (24 or 32-bit) | *E *0
icm8 | image (24 or 32-bit) | *E *0
ICN# | image (32-bit) and .icns | *E
icns | image, .png, .jp2, .txt, .plist, .bin, etc. | *E *9
ICON | image (24-bit) | *E
ics# | image (32-bit) and .icns | *E
ics4 | image (24 or 32-bit) and .icns | *E *0
ics8 | image (24 or 32-bit) and .icns | *E *0
kcs# | image (32-bit) | *E
kcs4 | image (24 or 32-bit) | *E *0
kcs8 | image (24 or 32-bit) | *E *0
PAT | image (24-bit; pattern and 8x8 tiling) | *E
PAT# | image (24-bit; pattern and 8x8 tiling for each pattern) | *E
PICT | image (24-bit) or other format | *E *2
pltt | image (24-bit) | *E *8
ppat | image (24-bit; color, color 8x8, mono, mono 8x8) | *E
ppt# | image (24-bit; 4 images as above for each pattern) | *E
SICN | image (24-bit, one per icon) | *E
wctb | image (24-bit) | *E *8
------------------------------------------------------------------------
Sound and sequence resources
.mod | .mod (ProTracker module) |
ALIS | .txt (description of contents) |
cmid | .midi |
csnd | .wav or .mp3 | *5
ecmi | .midi |
emid | .midi |
esnd | .wav or .mp3 | *5
ESnd | .wav or .mp3 | *5
INST | .json | *6
MADH | .madh (PlayerPRO module) |
MADI | .madi (PlayerPRO module) |
MIDI | .midi |
Midi | .midi |
midi | .midi |
SMSD | .wav | *A
snd | .wav or .mp3 | *5
SONG | .json (smssynth) | *6
SOUN | .wav | *A
Tune | .midi | *7
Ysnd | .wav |
------------------------------------------------------------------------
Code resources
ADBS | .txt (68K assembly) | *C
adio | .txt (68K assembly) | *C
AINI | .txt (68K assembly) | *C
atlk | .txt (68K assembly) | *C
boot | .txt (68K assembly) | *C
CDEF | .txt (68K assembly) | *C
cdek | .txt (PPC32 assembly and header description) |
cdev | .txt (68K assembly) | *C
CDRV | .txt (68K assembly) | *C
cfrg | .txt (description of code fragments) | *D
citt | .txt (68K assembly) | *C
clok | .txt (68K assembly) | *C
cmtb | .txt (68K assembly) | *C
cmu! | .txt (68K assembly) | *C
CODE | .txt (68K assembly or import table description) | *B *C
code | .txt (68K assembly) | *C
dcmp | .txt (68K assembly) | *C
dcod | .txt (PPC32 assembly and header description) |
dem | .txt (68K assembly) | *C
dimg | .txt (68K assembly) | *C
drvr | .txt (68K assembly) | *C
DRVR | .txt (68K assembly) | *C
enet | .txt (68K assembly) | *C
epch | .txt (PPC32 assembly) |
expt | .txt (PPC32 assembly) |
FKEY | .txt (68K assembly) | *C
fovr | .txt (PPC32 assembly and header description) |
gcko | .txt (68K assembly) | *C
gdef | .txt (68K assembly) | *C
GDEF | .txt (68K assembly) | *C
gnld | .txt (68K assembly) | *C
INIT | .txt (68K assembly) | *C
krnl | .txt (PPC32 assembly) |
LDEF | .txt (68K assembly) | *C
lmgr | .txt (68K assembly) | *C
lodr | .txt (68K assembly) | *C
ltlk | .txt (68K assembly) | *C
MBDF | .txt (68K assembly) | *C
MDEF | .txt (68K assembly) | *C
mntr | .txt (68K assembly) | *C
ncmp | .txt (PPC32 assembly and header description) |
ndlc | .txt (PPC32 assembly and header description) |
ndmc | .txt (PPC32 assembly and header description) |
ndrv | .txt (PPC32 assembly and header description) |
nift | .txt (PPC32 assembly and header description) |
nitt | .txt (PPC32 assembly and header description) |
nlib | .txt (PPC32 assembly and header description) |
nsnd | .txt (PPC32 assembly and header description) |
nsrd | .txt (PPC32 assembly) |
ntrb | .txt (PPC32 assembly and header description) |
osl | .txt (68K assembly) | *C
otdr | .txt (68K assembly) | *C
otlm | .txt (68K assembly) | *C
PACK | .txt (68K assembly) | *C
pnll | .txt (68K assembly) | *C
ppct | .txt (PPC32 assembly and header description) |
proc | .txt (68K assembly) | *C
PTCH | .txt (68K assembly) | *C
ptch | .txt (68K assembly) | *C
pthg | .txt (68K or PPC32 assembly and header description) | *C
qtcm | .txt (PPC32 assembly and header description) |
ROvr | .txt (68K assembly) | *C
RSSC | .txt (68K assembly) | *C
scal | .txt (PPC32 assembly and header description) |
scod | .txt (68K assembly) | *C
SERD | .txt (68K assembly) | *C
sfvr | .txt (PPC32 assembly and header description) |
shal | .txt (68K assembly) | *C
sift | .txt (68K assembly) | *C
SMOD | .txt (68K assembly) | *C
snth | .txt (68K assembly) | *C
tdig | .txt (68K assembly) | *C
tokn | .txt (68K assembly) | *C
vdig | .txt (68K or PPC32 assembly and header description) | *C
wart | .txt (68K assembly) | *C
WDEF | .txt (68K assembly) | *C
XCMD | .txt (68K assembly) | *C
XFCN | .txt (68K assembly) | *C
------------------------------------------------------------------------
MacApp resources
68k! | .txt (description of memory config for 680x0) |
CMNU | .txt (description of menu) |
cmnu | .txt (description of menu) |
errs | .txt (description of error ranges) |
mem! | .txt (description of memory config) |
ppc! | .txt (description of memory config for PPC) |
res! | .txt (string list of always resident segments) |
seg! | .txt (string list of segments) |
TxSt | .txt (description of text style) |
------------------------------------------------------------------------
Miscellaneous resources
ALRT | .txt (alert parameters) |
APPL | .txt (description of contents) |
audt | .txt (description of contents) |
BNDL | .txt (description of contents) |
CMDK | .txt (list of keys) |
CNTL | .txt (description of control) |
CTY# | .txt (description of cities) |
dbex | .txt (description of contents) |
DITL | .txt (dialog parameters) |
DLOG | .txt (dialog parameters) |
FBTN | .txt (description of buttons) |
FDIR | .txt (description of contents) |
fld# | .txt (description of folders) |
flst | .txt (description of font family list) |
fmap | .txt (description of finder icon mappings) |
FREF | .txt (description of file references) |
FRSV | .txt (list of font IDs) |
FWID | .txt (font parameters) |
gbly | .txt (description of Gibbly aka. System Enabler) |
GNRL | .txt (description of contents) |
hwin | .txt (description of help window) |
icmt | .txt (icon reference and comment) |
inbb | .txt (description of contents) |
indm | .txt (description of contents) |
infs | .txt (description of contents) |
inpk | .txt (description of contents) |
inra | .txt (description of contents) |
insc | .txt (description of contents) |
itl0 | .txt (international formatting information) |
ITL1 | .txt (short dates flag value) |
itlb | .txt (internationalization parameters) |
itlc | .txt (internationalization parameters) |
itlk | .txt (keyboard mappings) |
KBDN | .txt (keyboard name) |
LAYO | .txt (description of layout) |
mach | .txt (description of contents) |
MBAR | .txt (list of menu IDs) |
mcky | .txt (threshold values) |
MENU | .txt (description of menu) |
mitq | .txt (description of queue sizes) |
nrct | .txt (rectangle boundaries) |
PAPA | .txt (printer parameters) |
PICK | .txt (picker parameters) |
ppcc | .txt (description of contents) |
ppci | .txt (description of contents) |
PRC0 | .txt (description of contents) |
PRC3 | .txt (description of contents) |
pslt | .txt (description of Nubus pseudo-slot lists) |
ptbl | .txt (description of patch table) |
qrsc | .txt (description of queries) |
RECT | .txt (description of the rectangle) |
resf | .txt (list of fonts) |
RMAP | .txt (type mapping and list of ID exceptions) |
ROv# | .txt (list of overridden resource IDs) |
rtt# | .txt (list of database result handlers) |
RVEW | .txt (description of contents) |
scrn | .txt (screen device parameters) |
sect | .txt (description of contents) |
SIGN | .txt (description of contents) |
SIZE | .txt (description of parameters) |
slut | .txt (description of mapping) |
thn# | .txt (description of 'thng' mapping) |
TMPL | .txt (description of format) |
TOOL | .txt (description of contents) |
vers | .txt (version flags and strings) |
WIND | .txt (window parameters) |
Notes:
*0: Produces a 32-bit image if a corresponding monochrome resource exists
(ICN# for icl4/8, icm# for icm4/8, ics# for ics4/8, kcs# for kcs4/8). If
no monochrome resource exists, produces a 24-bit image instead. All
color information in the original resource is reproduced in the output,
even for fully-transparent pixels. If the icon was originally intended
to be used with a nonstandard compositing mode, the colors of fully-
transparent pixels may have been relevant, but most modern image viewers
and editors don't have a way to display this information.
*1: The hotspot coordinates are appended to the output filename. As in *0,
resource_dasm faithfully reproduces the color values of transparent
pixels in the output file, but most modern image editors won't show
these "transparent" pixels.
*2: resource_dasm implements multiple PICT decoders. It will first attempt
to decode the PICT using its internal decoder, which usually produces
correct results but fails on PICTs that contain complex drawing opcodes.
This decoder can handle basic QuickTime images as well (e.g. embedded
JPEGs and PNGs), but can't do any drawing under or over them, or
matte/mask effects. PICTs that contain embedded JPEGs or PNGs will
result in a JPEG or PNG file rather than the format specified by
--image-format (which is BMP by default). If the internal decoder fails,
resource_dasm will fall back to a decoder that uses picttoppm, which is
part of NetPBM. There is a rare failure mode in which picttoppm hangs
forever; resource_dasm gives it 10 seconds to do its job before killing
it and giving up. If picttoppm is not installed, fails to decode the
PICT, or is killed due to a timeout, resource_dasm will prepend the
necessary header and save the data as a PICT file instead.
*3: Text is assumed to use the Mac OS Roman encoding. It is converted to
UTF-8, and line endings (r) are converted to Unix style (n).
*4: Some rare style options may not be translated correctly. styl resources
provide styling information for the TEXT resource with the same ID, so
such a resource must be present to properly decode a styl.
*5: RMF archives can contain snd resources that are actually in MP3 format;
in this case, the exported sound will be a .mp3 file. Otherwise, the
exported sound is an uncompressed WAV file, even if the resource's data
is compressed. resource_dasm can decompress IMA 4:1, MACE 3:1, MACE 6:1,
A-law, and mu-law (ulaw) compression.
*6: JSON files from SoundMusicSys SONG resources can be played with smssynth
(http://www.github.com/fuzziqersoftware/gctools). The JSON file refers
to the instrument sounds and MIDI sequence by filename and does not
include directory names, so if you want to play these, you'll have to
manually put the sounds and MIDI files in the same directory as the JSON
file if you're using --filename-format.
*7: Tune decoding is experimental and will likely produce unplayable MIDIs.
*8: For color table resources, the raw data is always saved even if it is
decoded properly, since the original data contains 16-bit values for
each channel and the output image file has less-precise 8-bit channels.
*9: icns resources are decoded into many different file types depending on
the contents of the resource. For subfields that have split alpha
channels (that is, the transparency data is in a different subfield),
resource_dasm produces an original image and one with transparency
applied. Some icns resources also contain metadata, which is exported as
.bin, .txt, and .plist files, except for the Icon Composer version used
to create the file, which is ignored. If you want the result in Icon
Composer format, use --save-raw=yes and resource_dasm will save it as a
.icns file.
*A: These resources appear to have a fixed format, with a constant sample
rate, sample width and channel count. You may have to adjust these
parameters in the output if it turns out that these are configurable.
*B: The disassembler attempts to find exported functions by parsing the jump
table in the CODE 0 resource, but if this resource is missing or not in
the expected format, it skips this step and does not fail. Generally, if
any "export_X:" labels appear in the disassembly, then export resolution
succeeded and all of the labels should be correct (otherwise they will
all be missing).
*C: Some coprocessor and floating-point opcodes (F-class) are not
implemented and will disassemble with the comment "// unimplemented".
*D: Most PowerPC applications have their executable code in the data fork.
To disassemble it, use m68kdasm (example above).
*E: The output image format can be specified using --image-format. The
default output format is bmp (Windows bitmap); other supported formats
are png and ppm.
หาก Resource_Dasm ล้มเหลวในการแปลงทรัพยากรหรือไม่ทราบวิธีการที่จะพยายามถอดรหัสทรัพยากรโดยใช้ทรัพยากร TMPL (เทมเพลต) ที่สอดคล้องกันหากมีอยู่ หากไม่มี TMPL ที่เหมาะสม TMPL จะเสียหายหรือ TMPL ไม่สามารถถอดรหัสทรัพยากรได้ Resource_dasm จะสร้างข้อมูลดิบของทรัพยากรแทน
การใช้งานตัวถอดรหัสส่วนใหญ่ใน Resource_dasm ขึ้นอยู่กับซอฟต์แวร์ที่มีอยู่ด้านวิศวกรรมย้อนกลับและการส่งผ่านเอกสารของเอกสารเก่าดังนั้นทรัพยากรบางประเภทที่หายากอาจไม่ทำงาน อย่างไรก็ตามฉันต้องการให้โครงการนี้เสร็จสมบูรณ์ที่สุดเท่าที่จะเป็นไปได้ดังนั้นหากคุณมีทรัพยากรที่คุณคิดว่าควรถอดรหัสได้ แต่ Resource_Dasm ไม่สามารถถอดรหัสได้ส่งมาให้ฉัน (อาจเป็นการแนบกับปัญหา GitHub) และฉันจะพยายามอย่างเต็มที่เพื่อให้ Resource_dasm เข้าใจ
Resource_dasm คลายทรัพยากรที่ทำเครื่องหมายโดยผู้จัดการทรัพยากรอย่างโปร่งใส
แผนการบีบอัดผู้จัดการทรัพยากรไม่เคยมีการบันทึกอย่างเป็นทางการโดย Apple หรือเปิดเผยต่อสาธารณะดังนั้นการใช้งาน decompressors เหล่านี้จึงขึ้นอยู่กับ Resedit reverse-engineering และรหัส Mac OS คลาสสิกอื่น ๆ โดยสรุปทรัพยากรจะถูกบีบอัดโดยการดำเนินการรหัส 68K หรือ PowerPC จากทรัพยากร DCMP หรือ NCMP ซึ่งถูกค้นหาที่รันไทม์ในห่วงโซ่ของไฟล์ทรัพยากรเปิดเช่นทรัพยากรอื่น ๆ ส่วนใหญ่ (ในทางปฏิบัติ DCMP/NCMP ที่เกี่ยวข้องมักจะมีอยู่ในไฟล์เดียวกับทรัพยากรที่บีบอัดหรือในไฟล์ระบบ) มีสองรูปแบบที่แตกต่างกันของทรัพยากรที่ถูกบีบอัดและสองรูปแบบที่สอดคล้องกันของ 68K decompressors; Resource_dasm ใช้การสนับสนุนสำหรับทั้งสองรูปแบบ
Resource_dasm มีการใช้งานดั้งเดิมของการบีบอัดทั้งสี่ตัวที่สร้างขึ้นในไฟล์ระบบ Mac OS โดยเฉพาะ:
Resource_Dasm มีตัวจำลอง 68K และ PowerPC ในตัวเพื่อเรียกใช้ decompressors ที่ไม่ได้รับการป้องกัน อีมูเลเตอร์เหล่านี้ยังสามารถเรียกใช้ decompressors เริ่มต้นซึ่งรวมอยู่ใน Resource_dasm สถานะปัจจุบันของการบีบอัดแบบจำลอง:
อาจมีการบีบอัดอื่น ๆ ที่ฉันไม่เคยเห็นซึ่งอาจไม่ได้ผล หากคุณเห็น "คำเตือน: ล้มเหลวในการคลายทรัพยากร" เมื่อใช้ Resource_Dasm โปรดสร้างปัญหา GitHub และอัปโหลดทรัพยากรที่ถูกส่งออก (ไฟล์. bin) ที่ทำให้เกิดความล้มเหลวและทรัพยากร DCMP และ NCMP ทั้งหมดจากไฟล์แหล่งเดียวกัน
เรียกใช้ sudo make install เพื่อคัดลอกไฟล์ส่วนหัวและไลบรารีไปยังเส้นทางที่เกี่ยวข้องหลังจากสร้าง หลังจากการติดตั้งคุณสามารถ #include <resource_file/IndexFormats/ResourceFork.hh> (ตัวอย่าง) และลิงก์ด้วย -lresource_file ไม่มีเอกสารสำหรับไลบรารีนี้นอกเหนือจากสิ่งที่เขียนไว้ในไฟล์ส่วนหัว
ไลบรารีมีฟังก์ชั่นและคลาสที่เป็นประโยชน์ต่อไปนี้:
การใช้ M68KDASM นั้นค่อนข้างตรงไปตรงมา เรียกใช้ m68kdasm --help สำหรับรายการตัวเลือกทั้งหมด
ปัจจุบัน M68KDASM สามารถแยกส่วนข้อมูลประเภทนี้:
รูปแบบการดำเนินการเหล่านี้บางรูปแบบรองรับสถาปัตยกรรม CPU ที่ M68KDASM ไม่รองรับ หากพบหนึ่งในนั้นจะพิมพ์ส่วนโค้ดเป็นกลุ่มข้อมูลแทน
M68KDASM ยังสามารถประกอบ PowerPC, X86 และ SH-4 Assembly ลงในไบนารีดิบ (ไม่สนับสนุนการประกอบข้อความ M68K เป็นไบนารี แต่จะถูกนำไปใช้ในอนาคต) ไวยากรณ์อินพุตที่คาดหวังสำหรับแต่ละสถาปัตยกรรมตรงกับไวยากรณ์ถอดชิ้นส่วน; สำหรับ PowerPC และ SH-4 นี่ไม่ใช่ไวยากรณ์มาตรฐานที่ใช้โดยเครื่องมืออื่น ๆ ส่วนใหญ่
M68KEXEC เป็นตัวจำลอง CPU และดีบักเกอร์สำหรับ Motorola 68000, 32 บิต PowerPC และ X86 สถาปัตยกรรม ฉันมักจะใช้มันเพื่อช่วยให้เข้าใจว่ารหัสโบราณบางอย่างพยายามทำหรือเปรียบเทียบพฤติกรรมของรหัสที่ฉันได้ถ่ายโอนไปยังภาษาสมัยใหม่กับพฤติกรรมของรหัสดั้งเดิม สำหรับกรณีการใช้งานเช่นนี้คุณจะต้องตั้งค่าภูมิภาคอินพุตอย่างน้อยหนึ่งภูมิภาคที่มีข้อมูลที่คุณกำลังทดสอบและภูมิภาคเอาท์พุทหนึ่งรายการหรือมากกว่าสำหรับรหัสที่เลียนแบบเพื่อเขียน
บางทีนี่อาจเป็นตัวอย่างที่ดีที่สุด คำสั่งนี้ใช้เพื่อดำเนินการฟังก์ชั่นการสร้างบริบทการเข้ารหัสจาก Phantasy Star Online Blue Burst เพื่อเปรียบเทียบกับฟังก์ชั่นเดียวกับที่ใช้ใน Newserv:
./m68kexec --x86 --trace
--mem=A0000000/2AC43585C46A6366188889BCE3DB88B15C2B3C751DB6757147E7E9390598275CC79547B2E5C00DD145002816B59C067C
--mem=A1000000:1048
--load-pe=files/windows/pso/psobb.exe
--pc=00763FD0
--reg=ecx:A1000000
--push=00000030
--push=A0000000
--push=FFFFFFFF
--breakpoint=FFFFFFFF
ตัวเลือก --mem ตั้งค่าภูมิภาคอินพุต ภูมิภาค A0000000 มีเมล็ดการเข้ารหัส (0x30 ไบต์) และภูมิภาค A1000000 จะมีบริบทการเข้ารหัสที่สร้างขึ้นเมื่อฟังก์ชั่นส่งคืน ตัวเลือก --load-pe โหลดรหัสที่จะดำเนินการและ --pc บอกตัวจำลองว่าจะเริ่มต้นอย่างไร (โดยค่าเริ่มต้นมันจะเริ่มต้นที่จุดเข้าใช้งานที่กำหนดไว้ในการเรียกใช้งานถ้ามีให้ไว้ที่นี่เราต้องการเรียกฟังก์ชั่นเฉพาะแทน) ตัวเลือก --reg ตั้งค่าตัวชี้ this ในฟังก์ชั่นไปยังพื้นที่ที่เราจัดสรรไว้ -ตัวเลือก --push มช์ตั้งค่าอาร์กิวเมนต์ของฟังก์ชั่นและที่อยู่ส่งคืน มันจะกลับไปที่ ffffffff ซึ่งไม่มีหน่วยความจำที่จัดสรร แต่เรายังได้ตั้งค่า --breakpoint ที่ที่อยู่ซึ่งจะหยุดการจำลองก่อนที่จะมีข้อยกเว้นถูกโยนทิ้ง
เนื่องจากเราใช้ --trace , Emulator พิมพ์สถานะของการลงทะเบียนหลังจาก Opcode ทุกครั้งดังนั้นเราจึงสามารถติดตามพฤติกรรมของมันและเปรียบเทียบกับการใช้งานภายนอกของฟังก์ชั่นเดียวกัน เมื่อฟังก์ชั่นส่งคืนและทริกเกอร์จุดพักเราสามารถใช้ r A1000000 1048 ในเชลล์เพื่อดูข้อมูลที่สร้างขึ้นและเปรียบเทียบกับผลลัพธ์ของฟังก์ชั่นภายนอกของเรา
render_bits มีประโยชน์ในการตอบคำถาม "ข้อมูลไบนารีที่ดูแบบสุ่มนี้อาจเป็นภาพหรืออาร์เรย์ 2 มิติได้จริงหรือ?" ให้รูปแบบสีและข้อมูลไบนารีบางอย่างและจะสร้างไฟล์ BMP สีเต็มรูปแบบที่คุณสามารถดูได้ด้วยเครื่องดูภาพหรือตัวแก้ไขที่คุณชื่นชอบ นอกจากนี้คุณยังสามารถให้ตารางสี (ไฟล์. bin ที่ผลิตโดย Resource_dasm จากทรัพยากร CLUT) หากคุณคิดว่าอินพุตเป็นข้อมูลสีที่จัดทำดัชนี หากเอาต์พุตดูเหมือนขยะให้เล่นกับรูปแบบความกว้างและสีจนกว่าคุณจะคิดพารามิเตอร์ที่เหมาะสม
เรียกใช้ render_bits โดยไม่มีตัวเลือกใด ๆ สำหรับข้อมูลการใช้งาน
render_text ช่วยให้คุณเห็นว่าข้อความจริงจะเป็นอย่างไรเมื่อแสดงผลด้วยตัวอักษรบิตแมป (ทรัพยากรตัวอักษร/NFNT) หากต้องการใช้ให้รับไฟล์. bin จากทรัพยากรแบบอักษรหรือ NFNT (เช่น Resource_dasm--Save-Raw) จากนั้นเรียกใช้ render_text โดยไม่มีอาร์กิวเมนต์เพื่อดูวิธีการใช้งาน
บางครั้งในระหว่างการสร้างวิศวกรรมย้อนกลับคุณจะจบลงด้วยภาพที่มีเนื้อหาและโครงสร้างที่ถูกต้อง แต่สีนั้นผิดอย่างสมบูรณ์ โอกาสที่จะแสดงผลด้วยตารางสีผิด ในการแก้ไขปัญหานี้คุณสามารถใช้ replact_clut เพื่อแมปพิกเซลทั้งหมดของภาพจากพื้นที่สีหนึ่งไปยังอีก
เรียกใช้ replact_clut โดยไม่มีตัวเลือกใด ๆ สำหรับข้อมูลการใช้งาน
เกมบางเกมจัดเก็บภาพขนาดใหญ่แบ่งออกเป็นชุดของพื้นผิวที่เล็กกว่า ASSEMBLE_IMAGES สามารถรวมเข้าด้วยกันเป็นโปรแกรม AA ภาพขนาดใหญ่เดี่ยวอีกครั้ง เรียกใช้ ASSEMBLE_IMAGES โดยไม่มีตัวเลือกใด ๆ เพื่อดูวิธีการใช้งาน
dupe_finder ค้นหาทรัพยากรที่ซ้ำกันของประเภทเดียวกันในไฟล์ทรัพยากรหนึ่งหรือหลายไฟล์
เรียกใช้ dupe_finder โดยไม่มีตัวเลือกใด ๆ สำหรับข้อมูลการใช้งาน
hypercard_dasm stack_file [output_dir] หรือเพียงแค่ hypercard_dasm เพื่อดูตัวเลือกทั้งหมดicon_dearchiver archive_file [output_dir] คลายไอคอนไปยังไฟล์. ICNSvrfs_dump VRFS_file [output_dir]Decode_data สามารถถอดรหัสและคลายรูปแบบการเข้ารหัสแบบกำหนดเองได้สองสามรูปแบบที่ใช้โดยเกมต่าง ๆ โดยเฉพาะ:
Game/App/Library | Encoding | CLI option | Notes
-------------------------------------------------------------
DinoPark Tycoon | LZSS | --dinopark | %0
DinoPark Tycoon | RLE | --dinopark |
Flashback | LZSS | --presage | %0
MacSki | COOK | --macski |
MacSki | CO2K | --macski |
MacSki | RUN4 | --macski |
PackBits (compress) | PackBits | --pack-bits |
PackBits (decompress) | PackBits | --unpack-bits |
Pathways Into Darkness | Pathways | --unpack-pathways |
SoundMusicSys | LZSS | --sms | %0
Notes:
%0: Although these are all variants of LZSS (and are indeed very similar to
each other), they are mutually incompatible formats.
decode_data สามารถใช้ด้วยตัวเองเพื่อคลายข้อมูลหรือสามารถใช้เป็นตัวประมวลผลล่วงหน้าภายนอกผ่าน Resource_dasm เพื่อคลายการบีบอัดบางรูปแบบอย่างโปร่งใส ตัวอย่างเช่นในการใช้ Decode_Data สำหรับทรัพยากร MacSKI คุณสามารถเรียกใช้คำสั่งเช่น resource_dasm --external-preprocessor="./decode_data --macski" input_filename ...
render_sprite สามารถแสดงรูปแบบสไปรต์เกมที่กำหนดเองหลายรูปแบบ สำหรับบางรูปแบบที่ระบุไว้ด้านล่างคุณจะต้องจัดหาทรัพยากรตารางสีนอกเหนือจากทรัพยากรสไปรต์ ไฟล์. bin ที่ผลิตโดย Resource_dasm จากทรัพยากร Clut, PLTT หรือ CTBL จะเพียงพอ โดยปกติแล้วสิ่งเหล่านี้สามารถพบได้ในไฟล์เดียวกับแหล่งสไปรต์หรือในแอปพลิเคชันเกม เรียกใช้ render_sprite โดยไม่มีข้อโต้แย้งสำหรับข้อมูลการใช้งาน
รูปแบบที่รองรับ:
Game | Type | CLI option | Need color table | Notes
---------------------------------------------------------------------------
Beyond Dark Castle | PBLK | --PBLK | No |
Beyond Dark Castle | PPCT | --PPCT | No |
Beyond Dark Castle | PSCR | --PSCR-v2 | No |
Blobbo | BTMP | --BTMP | No |
Blobbo | PMP8 | --PMP8 | Yes | $9
BodyScope | Imag | --Imag | Yes | $2 $3
Bonkheads | Sprt | --Sprt | Yes |
Bubble Trouble | btSP | --btSP | Yes |
Dark Castle (color) | DC2 | --DC2 | No | $4
Dark Castle (monochrome) | PPCT | --PPCT | No |
Dark Castle (monochrome) | PSCR | --PSCR-v1 | No |
DinoPark Tycoon | BMap | --BMap | No |
DinoPark Tycoon | XBig | --XBig | No | $2
DinoPark Tycoon | XMap | --XMap | Yes | $2 $7
Dr. Quandary | Imag | --Imag | Sometimes | $1 $2 $3
Factory | 1img | --1img | No |
Factory | 4img | --4img | Yes |
Factory | 8img | --8img | Yes |
Flashback | PPSS | --PPSS | Yes | $2 $8
Fraction Munchers | Imag | --Imag-fm | Sometimes | $1 $2 $3
Greebles | GSIF | --GSIF | Yes |
Harry the Handsome Executive | HrSp | --HrSp | Yes | $9
Lemmings | SHPD | --SHPD-v1 | Sometimes | $0 $1 $2 $5
Marathon | .256 | --.256-m | No | $2
Mario Teaches Typing | Pak | --Pak | Sometimes | $1 $2
Mars Rising | btSP | --btSP | Yes |
Number Munchers | Imag | --Imag-fm | Sometimes | $1 $2 $3
Odell Down Under | Imag | --Imag | Sometimes | $1 $2 $3
Oh No! More Lemmings | SHPD | --SHPD-v2 | Sometimes | $0 $1 $2 $5
Pathways Into Darkness | .256 | --.256-pd | No | $2
Prince of Persia | SHPD | --SHPD-p | Sometimes | $0 $1 $2 $5
Prince of Persia 2 | SHAP | --SHAP | Yes |
SimCity 2000 | SPRT | --SPRT | Yes | $2
SimTower | | | No | $A
Slithereens | SprD | --SprD | Yes | $2
SnapDragon | Imag | --Imag | Sometimes | $1 $2 $3
Spectre | shap | --shap | No | $6
Step On It! | sssf | --sssf | Yes | $2
Super Munchers | Imag | --Imag-fm | Sometimes | $1 $2 $3
Swamp Gas | PPic | --PPic | Sometimes | $0 $2 $3
The Amazon Trail | Imag | --Imag | Sometimes | $2 $3
The Oregon Trail | Imag | --Imag | Sometimes | $1 $2 $3
TheZone | Spri | --Spri | Yes |
Word Munchers | Imag | --Imag-fm | Sometimes | $1 $2 $3
Notes:
$0: render_sprite can't tell from the contents of the resource whether it is
color or monochrome, so it assumes the resource is color if you give a
color table on the command line. If decoding fails with a color table,
try decoding without one (or vice versa).
$1: These games contain some color and some monochrome graphics. It should
be obvious which are which (usually color graphics are in a separate
file), but if not, you can give a clut anyway in these cases and
render_sprite will ignore it if the image is monochrome.
$2: These sprite formats contain multiple images, so render_sprite will
produce multiple image files.
$3: Resources of this type can contain embedded color tables; if you're
rendering a color image that doesn't have a color table, you'll have to
provide one via a command-line option. If the resource (or individual
images therein) contain their own color tables or are monochrome, no
color table is required on the command line, and any provided color
table via the command line will be ignored.
$4: You can get DC2 sprites from the DC Data file with
`resource_dasm --index-format=dc-data "DC Data"`.
$5: The graphics files contain resources that refer to segments of the data
fork in the same file. So, this option expects the original Graphics or
BW Graphics or Persia file (with both data and resource forks present),
not an already-extracted resource.
$6: shap resources contain 3D models and 2D top-down projections of them.
When given a shap resource, render_sprite produces an STL file and an
OBJ file for the 3D model, and an SVG file for the 2D top-down view.
$7: Some XMap resources are stored inside CBag archives. You can extract
them with `resource_dasm --index-format=cbag <CBAG_file.bin>`.
$8: This game has only one clut and it's huge - far longer than the usual
256 entries. It seems PPSS image sets are meant to be rendered with a
subset of this clut, but I haven't been able to figure out (yet) how the
game chooses what subset of it to use.
$9: The game doesn't contain any color tables. You can use a 256-color clut
resource from the Mac OS System file, or use the --default-clut option.
$A: The game stores its sprites in normal PICT resources with an incorrect
type. Use `resource_dasm --copy-handler=PICT:%89%E6%91%9C` to decode
them instead of using render_sprite.
icon_dearchiver เปิดไอคอนในไอคอน Archiver (โดย Alessandro Levi Montalcini) เก็บถาวรไปยัง. icns เรียกใช้โดยไม่มีตัวเลือกสำหรับข้อมูลการใช้งาน
blobbo_render <Blev-file.bin> <PMP8-128.bmp>ferazel_render ในไดเรกทอรีพร้อมไฟล์ข้อมูลหรือ ferazel_render --help เพื่อดูตัวเลือกทั้งหมด (มีมากมาย!)gamma_zee_render gamma_zee_application levels_filenameharry_render --clut-file=clut.bin หรือเพียงแค่ harry_render เพื่อดูตัวเลือกทั้งหมด (มีมากมาย!)infotron_render ในไดเรกทอรีข้อมูลข้อมูลlemmings_render --clut-file=clut.bin หรือ lemmings_render --help เพื่อดูตัวเลือกทั้งหมดmshines_render world_file [output_directory]lemmings_render สำหรับ lemmings ดั้งเดิม แต่ยังใช้ตัวเลือก --v2realmz_dasm global_data_dir [scenario_dir] out_dir (หากไม่ได้รับ Scenario_dir ให้ถอดข้อมูลที่ใช้ร่วมกันแทน)