miorom 0.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- miorom-0.13.0/LICENSE +21 -0
- miorom-0.13.0/PKG-INFO +326 -0
- miorom-0.13.0/README.md +298 -0
- miorom-0.13.0/pyproject.toml +142 -0
- miorom-0.13.0/setup.cfg +4 -0
- miorom-0.13.0/src/miorom/__init__.py +935 -0
- miorom-0.13.0/src/miorom/analysis_db.py +267 -0
- miorom-0.13.0/src/miorom/archive/__init__.py +39 -0
- miorom-0.13.0/src/miorom/archive/cascading.py +182 -0
- miorom-0.13.0/src/miorom/archive/container.py +69 -0
- miorom-0.13.0/src/miorom/archive/dissector.py +469 -0
- miorom-0.13.0/src/miorom/archive/dma.py +149 -0
- miorom-0.13.0/src/miorom/archive/master_table.py +117 -0
- miorom-0.13.0/src/miorom/archive/synthesizer.py +299 -0
- miorom-0.13.0/src/miorom/archive/toc_pair.py +232 -0
- miorom-0.13.0/src/miorom/archive/vfs.py +320 -0
- miorom-0.13.0/src/miorom/asm/__init__.py +106 -0
- miorom-0.13.0/src/miorom/asm/ap_bypass.py +198 -0
- miorom-0.13.0/src/miorom/asm/branch.py +219 -0
- miorom-0.13.0/src/miorom/asm/cheat.py +315 -0
- miorom-0.13.0/src/miorom/asm/codecave.py +81 -0
- miorom-0.13.0/src/miorom/asm/disambiguator.py +253 -0
- miorom-0.13.0/src/miorom/asm/disasm.py +793 -0
- miorom-0.13.0/src/miorom/asm/instruction_scanner.py +548 -0
- miorom-0.13.0/src/miorom/asm/jump_table.py +187 -0
- miorom-0.13.0/src/miorom/asm/literal_relocator.py +163 -0
- miorom-0.13.0/src/miorom/asm/micro_patcher.py +133 -0
- miorom-0.13.0/src/miorom/asm/prologue_scanner.py +80 -0
- miorom-0.13.0/src/miorom/asm/slicer.py +215 -0
- miorom-0.13.0/src/miorom/asm/snippet.py +421 -0
- miorom-0.13.0/src/miorom/asm/trampoline.py +252 -0
- miorom-0.13.0/src/miorom/asm/xref.py +225 -0
- miorom-0.13.0/src/miorom/audio/__init__.py +19 -0
- miorom-0.13.0/src/miorom/audio/adpcm.py +108 -0
- miorom-0.13.0/src/miorom/audio/n64_seq.py +102 -0
- miorom-0.13.0/src/miorom/audio/sdat.py +146 -0
- miorom-0.13.0/src/miorom/audio/sseq.py +388 -0
- miorom-0.13.0/src/miorom/audio/xa.py +216 -0
- miorom-0.13.0/src/miorom/cli/__init__.py +3 -0
- miorom-0.13.0/src/miorom/cli/main.py +666 -0
- miorom-0.13.0/src/miorom/compression/__init__.py +114 -0
- miorom-0.13.0/src/miorom/compression/carver.py +203 -0
- miorom-0.13.0/src/miorom/compression/heuristic.py +255 -0
- miorom-0.13.0/src/miorom/compression/huffman.py +287 -0
- miorom-0.13.0/src/miorom/compression/inspector.py +114 -0
- miorom-0.13.0/src/miorom/compression/lz10.py +156 -0
- miorom-0.13.0/src/miorom/compression/lz11.py +194 -0
- miorom-0.13.0/src/miorom/compression/rle.py +119 -0
- miorom-0.13.0/src/miorom/compression/speculative.py +175 -0
- miorom-0.13.0/src/miorom/compression/yaz0.py +161 -0
- miorom-0.13.0/src/miorom/core/__init__.py +127 -0
- miorom-0.13.0/src/miorom/core/bank_expander.py +217 -0
- miorom-0.13.0/src/miorom/core/binary.py +262 -0
- miorom-0.13.0/src/miorom/core/buffer.py +218 -0
- miorom-0.13.0/src/miorom/core/heap_builder.py +94 -0
- miorom-0.13.0/src/miorom/core/hex_diff.py +97 -0
- miorom-0.13.0/src/miorom/core/integrity.py +339 -0
- miorom-0.13.0/src/miorom/core/mapper.py +161 -0
- miorom-0.13.0/src/miorom/core/memory.py +113 -0
- miorom-0.13.0/src/miorom/core/multilevel_pointer.py +125 -0
- miorom-0.13.0/src/miorom/core/overlay_mapper.py +214 -0
- miorom-0.13.0/src/miorom/core/pointer.py +163 -0
- miorom-0.13.0/src/miorom/core/record_builder.py +113 -0
- miorom-0.13.0/src/miorom/core/rom_view.py +274 -0
- miorom-0.13.0/src/miorom/core/scanner.py +685 -0
- miorom-0.13.0/src/miorom/core/schema.py +665 -0
- miorom-0.13.0/src/miorom/core/signatures.py +70 -0
- miorom-0.13.0/src/miorom/core/string_carver.py +119 -0
- miorom-0.13.0/src/miorom/core/struct_profiler.py +382 -0
- miorom-0.13.0/src/miorom/core/symbol_map.py +242 -0
- miorom-0.13.0/src/miorom/core/vlq.py +114 -0
- miorom-0.13.0/src/miorom/debug/__init__.py +39 -0
- miorom-0.13.0/src/miorom/debug/buffer_analyzer.py +124 -0
- miorom-0.13.0/src/miorom/debug/client.py +104 -0
- miorom-0.13.0/src/miorom/debug/gdb_client.py +366 -0
- miorom-0.13.0/src/miorom/debug/protocols.py +15 -0
- miorom-0.13.0/src/miorom/debug/sanitizer.py +186 -0
- miorom-0.13.0/src/miorom/diff/__init__.py +27 -0
- miorom-0.13.0/src/miorom/diff/bindiff.py +248 -0
- miorom-0.13.0/src/miorom/diff/mapper.py +77 -0
- miorom-0.13.0/src/miorom/diff/patch_auditor.py +69 -0
- miorom-0.13.0/src/miorom/diff/porter.py +352 -0
- miorom-0.13.0/src/miorom/errors.py +97 -0
- miorom-0.13.0/src/miorom/formats/__init__.py +5 -0
- miorom-0.13.0/src/miorom/formats/batch.py +144 -0
- miorom-0.13.0/src/miorom/formats/csv_handler.py +199 -0
- miorom-0.13.0/src/miorom/formats/script_catalog.py +164 -0
- miorom-0.13.0/src/miorom/graphics/__init__.py +42 -0
- miorom-0.13.0/src/miorom/graphics/fast3d.py +237 -0
- miorom-0.13.0/src/miorom/graphics/image_bridge.py +124 -0
- miorom-0.13.0/src/miorom/graphics/mdec.py +186 -0
- miorom-0.13.0/src/miorom/graphics/n64_texture.py +271 -0
- miorom-0.13.0/src/miorom/graphics/palette.py +161 -0
- miorom-0.13.0/src/miorom/graphics/tilemap.py +140 -0
- miorom-0.13.0/src/miorom/graphics/tiles.py +182 -0
- miorom-0.13.0/src/miorom/graphics/tilesheet.py +315 -0
- miorom-0.13.0/src/miorom/helper/__init__.py +26 -0
- miorom-0.13.0/src/miorom/helper/cascading_relocator.py +121 -0
- miorom-0.13.0/src/miorom/helper/dual_table.py +178 -0
- miorom-0.13.0/src/miorom/helper/relocator.py +113 -0
- miorom-0.13.0/src/miorom/helper/string_pool.py +170 -0
- miorom-0.13.0/src/miorom/helper/tag_converter.py +159 -0
- miorom-0.13.0/src/miorom/link/__init__.py +47 -0
- miorom-0.13.0/src/miorom/link/dol.py +216 -0
- miorom-0.13.0/src/miorom/link/elf.py +255 -0
- miorom-0.13.0/src/miorom/link/heap.py +284 -0
- miorom-0.13.0/src/miorom/link/injector.py +412 -0
- miorom-0.13.0/src/miorom/link/relocator.py +329 -0
- miorom-0.13.0/src/miorom/naming.py +88 -0
- miorom-0.13.0/src/miorom/patch/__init__.py +125 -0
- miorom-0.13.0/src/miorom/patch/bank_crosser.py +112 -0
- miorom-0.13.0/src/miorom/patch/bps.py +213 -0
- miorom-0.13.0/src/miorom/patch/hunks.py +50 -0
- miorom-0.13.0/src/miorom/patch/ips.py +228 -0
- miorom-0.13.0/src/miorom/patch/patch_writer.py +229 -0
- miorom-0.13.0/src/miorom/patch/pointer_remapper.py +118 -0
- miorom-0.13.0/src/miorom/patch/pointerizer.py +205 -0
- miorom-0.13.0/src/miorom/patch/relocator.py +235 -0
- miorom-0.13.0/src/miorom/patch/slack.py +202 -0
- miorom-0.13.0/src/miorom/patch/xdelta.py +74 -0
- miorom-0.13.0/src/miorom/pipeline/__init__.py +27 -0
- miorom-0.13.0/src/miorom/pipeline/engine.py +400 -0
- miorom-0.13.0/src/miorom/platforms/__init__.py +43 -0
- miorom-0.13.0/src/miorom/platforms/cdrom/__init__.py +29 -0
- miorom-0.13.0/src/miorom/platforms/cdrom/cue.py +161 -0
- miorom-0.13.0/src/miorom/platforms/cdrom/disc.py +339 -0
- miorom-0.13.0/src/miorom/platforms/gb/__init__.py +4 -0
- miorom-0.13.0/src/miorom/platforms/gb/rom.py +155 -0
- miorom-0.13.0/src/miorom/platforms/gba/__init__.py +4 -0
- miorom-0.13.0/src/miorom/platforms/gba/rom.py +131 -0
- miorom-0.13.0/src/miorom/platforms/gc/__init__.py +16 -0
- miorom-0.13.0/src/miorom/platforms/gc/disc.py +418 -0
- miorom-0.13.0/src/miorom/platforms/gc/fst_injector.py +86 -0
- miorom-0.13.0/src/miorom/platforms/iso/__init__.py +3 -0
- miorom-0.13.0/src/miorom/platforms/iso/iso9660.py +229 -0
- miorom-0.13.0/src/miorom/platforms/md/__init__.py +21 -0
- miorom-0.13.0/src/miorom/platforms/md/rom.py +239 -0
- miorom-0.13.0/src/miorom/platforms/n64/__init__.py +29 -0
- miorom-0.13.0/src/miorom/platforms/n64/checksum.py +184 -0
- miorom-0.13.0/src/miorom/platforms/n64/rom.py +230 -0
- miorom-0.13.0/src/miorom/platforms/nds/__init__.py +33 -0
- miorom-0.13.0/src/miorom/platforms/nds/narc.py +241 -0
- miorom-0.13.0/src/miorom/platforms/nds/nftr.py +276 -0
- miorom-0.13.0/src/miorom/platforms/nds/rom.py +766 -0
- miorom-0.13.0/src/miorom/platforms/psx/__init__.py +6 -0
- miorom-0.13.0/src/miorom/platforms/psx/exe.py +55 -0
- miorom-0.13.0/src/miorom/platforms/psx/str.py +223 -0
- miorom-0.13.0/src/miorom/platforms/psx/tim.py +135 -0
- miorom-0.13.0/src/miorom/platforms/snes/__init__.py +3 -0
- miorom-0.13.0/src/miorom/platforms/snes/rom.py +177 -0
- miorom-0.13.0/src/miorom/platforms/wii/__init__.py +5 -0
- miorom-0.13.0/src/miorom/platforms/wii/brfnt.py +200 -0
- miorom-0.13.0/src/miorom/platforms/wii/tpl.py +260 -0
- miorom-0.13.0/src/miorom/platforms/wii/u8.py +376 -0
- miorom-0.13.0/src/miorom/project/__init__.py +28 -0
- miorom-0.13.0/src/miorom/project/assets.py +157 -0
- miorom-0.13.0/src/miorom/project/game.py +172 -0
- miorom-0.13.0/src/miorom/project/manager.py +217 -0
- miorom-0.13.0/src/miorom/project/protocols.py +29 -0
- miorom-0.13.0/src/miorom/project/rules.py +62 -0
- miorom-0.13.0/src/miorom/project/scaffold.py +106 -0
- miorom-0.13.0/src/miorom/py.typed +0 -0
- miorom-0.13.0/src/miorom/registry.py +62 -0
- miorom-0.13.0/src/miorom/result.py +107 -0
- miorom-0.13.0/src/miorom/rom/__init__.py +28 -0
- miorom-0.13.0/src/miorom/rom/base.py +32 -0
- miorom-0.13.0/src/miorom/rom/expander.py +213 -0
- miorom-0.13.0/src/miorom/rom/handlers/__init__.py +15 -0
- miorom-0.13.0/src/miorom/rom/handlers/cartridge.py +152 -0
- miorom-0.13.0/src/miorom/rom/handlers/gc.py +125 -0
- miorom-0.13.0/src/miorom/rom/handlers/iso9660.py +88 -0
- miorom-0.13.0/src/miorom/rom/handlers/narc.py +68 -0
- miorom-0.13.0/src/miorom/rom/handlers/nds.py +415 -0
- miorom-0.13.0/src/miorom/rom/handlers/u8.py +111 -0
- miorom-0.13.0/src/miorom/rom/manager.py +233 -0
- miorom-0.13.0/src/miorom/rom/protocols.py +19 -0
- miorom-0.13.0/src/miorom/save/__init__.py +20 -0
- miorom-0.13.0/src/miorom/save/checksum.py +107 -0
- miorom-0.13.0/src/miorom/save/diff_hunter.py +175 -0
- miorom-0.13.0/src/miorom/save/slots.py +89 -0
- miorom-0.13.0/src/miorom/scanner/__init__.py +61 -0
- miorom-0.13.0/src/miorom/scanner/crypto.py +200 -0
- miorom-0.13.0/src/miorom/scanner/deep.py +474 -0
- miorom-0.13.0/src/miorom/scanner/inspector.py +281 -0
- miorom-0.13.0/src/miorom/scanner/pattern.py +288 -0
- miorom-0.13.0/src/miorom/scanner/table_detector.py +497 -0
- miorom-0.13.0/src/miorom/scanner/triage.py +242 -0
- miorom-0.13.0/src/miorom/scanner/xref.py +357 -0
- miorom-0.13.0/src/miorom/script/__init__.py +105 -0
- miorom-0.13.0/src/miorom/script/archeology.py +109 -0
- miorom-0.13.0/src/miorom/script/ast.py +294 -0
- miorom-0.13.0/src/miorom/script/branch.py +346 -0
- miorom-0.13.0/src/miorom/script/compiler.py +166 -0
- miorom-0.13.0/src/miorom/script/control_flow.py +161 -0
- miorom-0.13.0/src/miorom/script/decompiler.py +205 -0
- miorom-0.13.0/src/miorom/script/engine.py +283 -0
- miorom-0.13.0/src/miorom/script/ir.py +81 -0
- miorom-0.13.0/src/miorom/script/lifter.py +431 -0
- miorom-0.13.0/src/miorom/script/opcode.py +84 -0
- miorom-0.13.0/src/miorom/script/paging_weaver.py +137 -0
- miorom-0.13.0/src/miorom/script/repacker.py +212 -0
- miorom-0.13.0/src/miorom/script/splicer.py +97 -0
- miorom-0.13.0/src/miorom/script/vm.py +261 -0
- miorom-0.13.0/src/miorom/script/vm_profiler.py +234 -0
- miorom-0.13.0/src/miorom/security.py +39 -0
- miorom-0.13.0/src/miorom/signature_db.py +140 -0
- miorom-0.13.0/src/miorom/text/__init__.py +78 -0
- miorom-0.13.0/src/miorom/text/aligner.py +166 -0
- miorom-0.13.0/src/miorom/text/bilingual_bridge.py +136 -0
- miorom-0.13.0/src/miorom/text/charmap.py +112 -0
- miorom-0.13.0/src/miorom/text/charmap_miner.py +147 -0
- miorom-0.13.0/src/miorom/text/dte_miner.py +142 -0
- miorom-0.13.0/src/miorom/text/font_builder.py +124 -0
- miorom-0.13.0/src/miorom/text/metrics_measurer.py +144 -0
- miorom-0.13.0/src/miorom/text/paginator.py +129 -0
- miorom-0.13.0/src/miorom/text/pipeline.py +216 -0
- miorom-0.13.0/src/miorom/text/pixel_wrapper.py +138 -0
- miorom-0.13.0/src/miorom/text/po_handler.py +254 -0
- miorom-0.13.0/src/miorom/text/relative_search.py +211 -0
- miorom-0.13.0/src/miorom/text/sanitizer.py +122 -0
- miorom-0.13.0/src/miorom/text/tag_validator.py +101 -0
- miorom-0.13.0/src/miorom/text/tags.py +61 -0
- miorom-0.13.0/src/miorom/text/template.py +47 -0
- miorom-0.13.0/src/miorom/text/textbox_sim.py +229 -0
- miorom-0.13.0/src/miorom/text/tokenizer.py +148 -0
- miorom-0.13.0/src/miorom/text/transcoder.py +172 -0
- miorom-0.13.0/src/miorom/text/transmuter.py +83 -0
- miorom-0.13.0/src/miorom/text/ttf_compiler.py +169 -0
- miorom-0.13.0/src/miorom/text/vwf.py +200 -0
- miorom-0.13.0/src/miorom/text/vwf_injector.py +149 -0
- miorom-0.13.0/src/miorom/text/wrapper.py +66 -0
- miorom-0.13.0/src/miorom.egg-info/PKG-INFO +326 -0
- miorom-0.13.0/src/miorom.egg-info/SOURCES.txt +351 -0
- miorom-0.13.0/src/miorom.egg-info/dependency_links.txt +1 -0
- miorom-0.13.0/src/miorom.egg-info/entry_points.txt +2 -0
- miorom-0.13.0/src/miorom.egg-info/requires.txt +5 -0
- miorom-0.13.0/src/miorom.egg-info/top_level.txt +1 -0
- miorom-0.13.0/tests/test_advanced_domains.py +149 -0
- miorom-0.13.0/tests/test_aligner.py +65 -0
- miorom-0.13.0/tests/test_archive_vfs.py +69 -0
- miorom-0.13.0/tests/test_asm.py +78 -0
- miorom-0.13.0/tests/test_asm_snippet.py +68 -0
- miorom-0.13.0/tests/test_audio.py +49 -0
- miorom-0.13.0/tests/test_audio_sseq.py +60 -0
- miorom-0.13.0/tests/test_auto_paginator.py +68 -0
- miorom-0.13.0/tests/test_auto_relocator.py +134 -0
- miorom-0.13.0/tests/test_bank_crosser.py +79 -0
- miorom-0.13.0/tests/test_bank_expander.py +95 -0
- miorom-0.13.0/tests/test_batch3_text_script_pointers.py +173 -0
- miorom-0.13.0/tests/test_batch4_runtime_and_safety.py +252 -0
- miorom-0.13.0/tests/test_benchmarks.py +16 -0
- miorom-0.13.0/tests/test_bilingual_bridge.py +85 -0
- miorom-0.13.0/tests/test_binary.py +50 -0
- miorom-0.13.0/tests/test_binary_struct_dogfooding.py +148 -0
- miorom-0.13.0/tests/test_buffer_analyzer.py +81 -0
- miorom-0.13.0/tests/test_buffer_mapper.py +106 -0
- miorom-0.13.0/tests/test_bytecode_branch_scanner.py +116 -0
- miorom-0.13.0/tests/test_carver.py +62 -0
- miorom-0.13.0/tests/test_cascading_archive.py +95 -0
- miorom-0.13.0/tests/test_compression.py +97 -0
- miorom-0.13.0/tests/test_compression_and_asm_primitives.py +95 -0
- miorom-0.13.0/tests/test_compression_heuristic.py +57 -0
- miorom-0.13.0/tests/test_control_flow.py +36 -0
- miorom-0.13.0/tests/test_control_tag_sanitizer.py +68 -0
- miorom-0.13.0/tests/test_cross_region_porter.py +139 -0
- miorom-0.13.0/tests/test_crypto_xref_bindiff.py +148 -0
- miorom-0.13.0/tests/test_csv_batch.py +58 -0
- miorom-0.13.0/tests/test_disasm_and_lifter.py +200 -0
- miorom-0.13.0/tests/test_dte.py +48 -0
- miorom-0.13.0/tests/test_elf_injector.py +459 -0
- miorom-0.13.0/tests/test_encoding_transmuter.py +38 -0
- miorom-0.13.0/tests/test_exceptions.py +30 -0
- miorom-0.13.0/tests/test_font_builder.py +55 -0
- miorom-0.13.0/tests/test_framework.py +130 -0
- miorom-0.13.0/tests/test_gdb_client.py +52 -0
- miorom-0.13.0/tests/test_gdb_scanner.py +66 -0
- miorom-0.13.0/tests/test_global_xref.py +38 -0
- miorom-0.13.0/tests/test_graphics.py +99 -0
- miorom-0.13.0/tests/test_graphics_mdec.py +33 -0
- miorom-0.13.0/tests/test_heap_builder_and_vlq.py +71 -0
- miorom-0.13.0/tests/test_helpers.py +90 -0
- miorom-0.13.0/tests/test_heuristic_dissector.py +123 -0
- miorom-0.13.0/tests/test_hex_diff_and_template.py +37 -0
- miorom-0.13.0/tests/test_image_bridge.py +33 -0
- miorom-0.13.0/tests/test_instruction_scanner.py +208 -0
- miorom-0.13.0/tests/test_integrity.py +162 -0
- miorom-0.13.0/tests/test_jump_table.py +128 -0
- miorom-0.13.0/tests/test_kwargs.py +306 -0
- miorom-0.13.0/tests/test_library_enhancements.py +437 -0
- miorom-0.13.0/tests/test_link.py +235 -0
- miorom-0.13.0/tests/test_literal_relocator.py +87 -0
- miorom-0.13.0/tests/test_master_table.py +56 -0
- miorom-0.13.0/tests/test_memory_and_signatures.py +47 -0
- miorom-0.13.0/tests/test_metrics_and_tags.py +72 -0
- miorom-0.13.0/tests/test_nds.py +179 -0
- miorom-0.13.0/tests/test_nftr.py +34 -0
- miorom-0.13.0/tests/test_overlay_mapper.py +58 -0
- miorom-0.13.0/tests/test_paging_weaver.py +52 -0
- miorom-0.13.0/tests/test_patch.py +64 -0
- miorom-0.13.0/tests/test_patch_writer.py +47 -0
- miorom-0.13.0/tests/test_patch_writer_txn.py +109 -0
- miorom-0.13.0/tests/test_pattern_scanner.py +76 -0
- miorom-0.13.0/tests/test_pipeline.py +78 -0
- miorom-0.13.0/tests/test_platforms.py +100 -0
- miorom-0.13.0/tests/test_platforms_cdrom.py +205 -0
- miorom-0.13.0/tests/test_platforms_gb.py +36 -0
- miorom-0.13.0/tests/test_platforms_gba_iso.py +109 -0
- miorom-0.13.0/tests/test_platforms_gc.py +110 -0
- miorom-0.13.0/tests/test_platforms_md.py +77 -0
- miorom-0.13.0/tests/test_platforms_n64.py +82 -0
- miorom-0.13.0/tests/test_platforms_snes_psx.py +95 -0
- miorom-0.13.0/tests/test_po_handler.py +69 -0
- miorom-0.13.0/tests/test_pointer.py +32 -0
- miorom-0.13.0/tests/test_pointer_remapper.py +76 -0
- miorom-0.13.0/tests/test_project_workflow.py +82 -0
- miorom-0.13.0/tests/test_property_based.py +128 -0
- miorom-0.13.0/tests/test_psx_str_xa.py +91 -0
- miorom-0.13.0/tests/test_record_builder.py +46 -0
- miorom-0.13.0/tests/test_relative_search.py +58 -0
- miorom-0.13.0/tests/test_rom_unpack_repack.py +390 -0
- miorom-0.13.0/tests/test_save.py +62 -0
- miorom-0.13.0/tests/test_scanner.py +112 -0
- miorom-0.13.0/tests/test_scanner_deep.py +193 -0
- miorom-0.13.0/tests/test_schema.py +150 -0
- miorom-0.13.0/tests/test_script.py +91 -0
- miorom-0.13.0/tests/test_script_ast.py +72 -0
- miorom-0.13.0/tests/test_script_decompiler.py +101 -0
- miorom-0.13.0/tests/test_script_repacker.py +64 -0
- miorom-0.13.0/tests/test_script_splicer.py +72 -0
- miorom-0.13.0/tests/test_security_extract_path.py +53 -0
- miorom-0.13.0/tests/test_slack.py +45 -0
- miorom-0.13.0/tests/test_slot_pointerizer.py +89 -0
- miorom-0.13.0/tests/test_sm83_snippet.py +132 -0
- miorom-0.13.0/tests/test_speculative_carver.py +36 -0
- miorom-0.13.0/tests/test_streaming_contract.py +34 -0
- miorom-0.13.0/tests/test_string_pipeline.py +199 -0
- miorom-0.13.0/tests/test_struct_profiler.py +63 -0
- miorom-0.13.0/tests/test_symbol_map.py +55 -0
- miorom-0.13.0/tests/test_symbolmap_import.py +72 -0
- miorom-0.13.0/tests/test_table_detector.py +105 -0
- miorom-0.13.0/tests/test_tags.py +30 -0
- miorom-0.13.0/tests/test_textbox_sim.py +51 -0
- miorom-0.13.0/tests/test_tilesheet.py +94 -0
- miorom-0.13.0/tests/test_toc_and_dual_table.py +114 -0
- miorom-0.13.0/tests/test_transcoder.py +72 -0
- miorom-0.13.0/tests/test_triage.py +56 -0
- miorom-0.13.0/tests/test_ttf_compiler.py +64 -0
- miorom-0.13.0/tests/test_universal_hook_and_cheat.py +223 -0
- miorom-0.13.0/tests/test_v2_finalization.py +70 -0
- miorom-0.13.0/tests/test_v3_library_contract.py +195 -0
- miorom-0.13.0/tests/test_vm_profiler.py +73 -0
- miorom-0.13.0/tests/test_vwf.py +45 -0
- miorom-0.13.0/tests/test_vwf_injector.py +75 -0
miorom-0.13.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SuchMioko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
miorom-0.13.0/PKG-INFO
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: miorom
|
|
3
|
+
Version: 0.13.0
|
|
4
|
+
Summary: A Python library for ROM hacking and game reverse engineering
|
|
5
|
+
Author-email: MiokoTech <miokotech@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: romhacking,rom-hacking,game-hacking,reverse-engineering,game-reverse-engineering,binary-analysis,game-localization,fan-translation,game-modding,binary-patching,binary-parser,decompilation,disassembler,bytecode-vm,elf-linker,code-injection,nintendo,wii,gamecube,nintendo-ds,nds,gba,gameboy-advance,gameboy,n64,nintendo-64,snes,super-nintendo,playstation,ps1,psx,sega-genesis,megadrive,powerpc,mips,arm,split-pointer,code-cave,trampoline-hook,dol-executable,iso9660,u8-archive,narc,sdat,sseq,brfnt,nftr,tpl-texture,tim-image,toc-archive,dual-table,lz10,lz11,yaz0,rle-compression,huffman,ips-patch,bps-patch,xdelta,rom-patcher,variable-width-font,vwf,font-metrics,word-wrapper,textbox-simulator,string-scanner,pointer-table,charmap,ttf-compiler,dolphin-emulator,gdb-stub,memory-inspection,live-patching,shannon-entropy
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
11
|
+
Classifier: Topic :: Software Development :: Disassemblers
|
|
12
|
+
Classifier: Topic :: Games/Entertainment
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
|
+
Requires-Dist: hypothesis>=6.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-benchmark>=4.0; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# MioROM
|
|
30
|
+
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
[](https://www.python.org/)
|
|
33
|
+
[](tests/)
|
|
34
|
+
[](docs/API_REFERENCE.md)
|
|
35
|
+
|
|
36
|
+
**MioROM** is an advanced, modular Python framework and low-level primitive library for ROM hacking, game localization engineering, and binary reverse engineering.
|
|
37
|
+
|
|
38
|
+
Designed with a **library-first philosophy** (analogous to `ndspy` and `pwntools`), MioROM provides foundational building blocks, platform container parsers, instruction scanners, and pointer recalculation engines required to build reliable, reproducible game extraction, translation, and repacking pipelines in pure Python.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
- [API Reference and Architecture Guide](docs/API_REFERENCE.md) - Comprehensive index of all subpackages and 60+ core classes.
|
|
45
|
+
- [Binary and Assembly Primitives Guide](docs/BINARY_PRIMITIVES.md) - Technical guide for low-level patching, micro-assembly, struct serialization, and symbol mapping.
|
|
46
|
+
- [Command-Line Interface (CLI) Reference](docs/CLI_REFERENCE.md) - Complete manual for `miorom` terminal tools (`unpack`, `repack`, `inspect`, `scan`, etc.).
|
|
47
|
+
- [Console Platform & Format Reference](docs/PLATFORMS.md) - Deep dive into NDS, Wii/GC, PS1, N64, GBA, SNES, and Mega Drive formats.
|
|
48
|
+
- [End-to-End Localization Workflow Guide](docs/WORKFLOW_GUIDE.md) - 6-phase walkthrough from untouched ROM to distributed patch.
|
|
49
|
+
- [Adding New Platforms (Plugin Guide)](docs/PLUGIN_GUIDE.md) - Registering custom `BaseRomHandler` implementations without forking MioROM.
|
|
50
|
+
- [Library Contracts](docs/LIBRARY_CONTRACTS.md) - Serialization, streaming, structured exceptions, patch composition, pipeline extension, and structural-typing contracts.
|
|
51
|
+
- [Security Guide](docs/SECURITY.md) - Path traversal / zip-slip protection and the checklist for safely extracting untrusted archives.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
### From GitHub
|
|
58
|
+
|
|
59
|
+
Install directly using `pip`:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install git+https://github.com/MiokoTech/miorom.git
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### From Source (Development Mode)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/MiokoTech/miorom.git
|
|
69
|
+
cd miorom
|
|
70
|
+
pip install -e .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
To run the verification test suite:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pytest
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Platform Support Matrix
|
|
82
|
+
|
|
83
|
+
MioROM provides native parsers, serializers, and filesystem handlers across multiple retro and modern console architectures without external binary dependencies:
|
|
84
|
+
|
|
85
|
+
| Platform | Containers & Filesystems | Executables & Formats | Text, Fonts & Compression |
|
|
86
|
+
| :--- | :--- | :--- | :--- |
|
|
87
|
+
| **Nintendo DS** | `.nds` ROM, NARC (`.narc`) archives, FAT | ARM9/ARM7 binaries, overlays | NFTR fonts, SDAT audio, LZ10, LZ11, RLE |
|
|
88
|
+
| **Nintendo Wii / GameCube** | Optical Disc (`.iso`, `.gcm`), U8 (`.arc`, `.szs`), FST | DOL executables, ELF objects | BRFNT fonts, TPL textures, Yaz0 |
|
|
89
|
+
| **Game Boy Advance** | `.gba` ROM, Cartridge headers | ARM/Thumb relative branches | BGR555 palettes, 4bpp tiles, Complement CRC |
|
|
90
|
+
| **Nintendo 64** | `.z64` (BE), `.v64` (Swapped), `.n64` (LE) | MIPS split-pointer scanner | IPL3 CIC checksum verification (all variants) |
|
|
91
|
+
| **Super Nintendo** | `.sfc`, `.smc` (LoROM / HiROM / ExHiROM) | 65816 memory mapping | 2bpp/4bpp planar tiles, 16-bit complement CRC |
|
|
92
|
+
| **PlayStation 1** | Optical Disc (ISO9660, CUE/BIN multi-track) | PS-X EXE, STR video, CD-XA audio | TIM textures, MDEC video bitstreams, EDC/ECC |
|
|
93
|
+
| **Sega Genesis / Mega Drive** | `.md`, `.bin`, `.smd` (Interleaved de-interleaving) | 68000 header & SRAM registers | 16-bit big-endian ROM checksum recalculation |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Core Pillars & Capabilities
|
|
98
|
+
|
|
99
|
+
### 1. Low-Level Binary Manipulation & Patching
|
|
100
|
+
- **`BinaryReader` & `BinaryWriter`**: High-performance stream I/O with dynamic endianness switching (`<` / `>`), temporary context seeking (`with reader.at(offset): ...`), and boundary alignment padding.
|
|
101
|
+
- **`PatchWriter`**: Fluent binary patch emitter with automatic cursor tracking, range replacements, and instant IPS distribution patch generation.
|
|
102
|
+
- **`RecordBuilder`**: Fluent struct writer constructing binary headers and packed records with fixed-width strings, Pascal strings, and memory alignment without brittle format strings.
|
|
103
|
+
- **`RelocatableBuffer`**: Immutable pristine snapshot buffer preventing offset drift across chained text edits, recalculating all registered pointers in a single pass.
|
|
104
|
+
- **`HexDiffHighlighter`**: Terminal verification tool rendering colorized ANSI hex diffs (green for additions, red for original bytes) before writing changes to disk.
|
|
105
|
+
- **`SymbolMap`**: Memory and ROM address annotator with export to No$GBA (`.sym`), Dolphin (`.map`), and Ghidra CSV labels.
|
|
106
|
+
|
|
107
|
+
### 2. Disassembly, Assembly & Static Analysis
|
|
108
|
+
- **`UniversalDisassembler`**: Multi-architecture disassembler supporting PowerPC, ARM32, Thumb-16, and MIPS without native C dependencies.
|
|
109
|
+
- **`AsmSnippet`**: Pure-Python micro-assembler for compiling small ARM32 and MIPS instruction sequences (branches, loads, calls, returns) without external toolchains.
|
|
110
|
+
- **`PPCInstructionScanner` & `MIPSInstructionScanner`**: Searches binary executables for split-pointer load pairs (`lis` + `addi` / `lui` + `addiu`) and patches them in-place.
|
|
111
|
+
- **`CodeCaveFinder` & `TrampolineHook`**: Locates contiguous unused padding bytes (`0x00`/`0xFF`) and constructs 5-instruction trampolines preserving original opcodes.
|
|
112
|
+
- **`AntiPiracyBypasser`**: Scans and applies surgical patches to NDS cartridge checks, checksum verification loops, and PowerPC integrity branches.
|
|
113
|
+
|
|
114
|
+
### 3. Pointer Tables & Relocation Engines
|
|
115
|
+
- **`PointerTable` & `PointerEntry`**: Manages absolute, relative, segmented, and flagged pointers (`offset + flags`) with 1:1 relocation.
|
|
116
|
+
- **`MultiLevelPointerTable`**: Resolves cascading multi-tier pointer hierarchies (Chapter -> Scene -> Text Block).
|
|
117
|
+
- **`ByteOffsetMapper`**: Computes exact 1:1 address relocation using Longest Common Subsequence (LCS) alignment when text data expands.
|
|
118
|
+
- **`FarPointerRelocator` & `RomLayoutExpander`**: Relocates binary assets into expanded ROM memory banks (GBA 32MB, N64 64MB) with automatic hardware checksum repairs.
|
|
119
|
+
|
|
120
|
+
### 4. Text, Typography & Localization Engineering
|
|
121
|
+
- **`PixelWordWrapper` & `FontMetrics`**: Measures dialogue lines against true on-screen pixel boundaries for Variable-Width Fonts (VWF), preventing textbox overflows.
|
|
122
|
+
- **`TrieTranscoder`**: High-performance greedy longest-prefix transcoder for Dual-Tile Encoding (DTE), Byte-Pair Encoding (BPE), and custom `.tbl` character tables.
|
|
123
|
+
- **`GameTextTemplate`**: Bidirectional dialogue template engine with dynamic control tags and reverse parameter extraction.
|
|
124
|
+
- **`StringAligner`**: Correlates and transfers translated strings between regional releases (e.g. Japanese v1.0 to USA v1.1) despite shifted or inserted rows.
|
|
125
|
+
- **`PoHandler`**: Two-way bridge connecting game text to GNU gettext PO files for standard translation toolchains (Weblate, Crowdin, Poedit).
|
|
126
|
+
|
|
127
|
+
### 5. Filesystem, Containers & Disc Images
|
|
128
|
+
- **`RomManager`**: Unified auto-detecting ROM unpacker and repacker for NDS, GameCube/Wii ISO, U8 Archive, NARC, ISO9660, and Cartridges.
|
|
129
|
+
- **`ISO9660` & `CueBinDisc`**: Pure-Python optical disc filesystem parser and injector with LBA sector reallocation and ECMA-130 EDC/ECC recalculation.
|
|
130
|
+
- **`VirtualFileSystem` (VFS)**: In-memory hierarchical filesystem layer allowing transparent archive mounting, file browsing, and in-place node editing.
|
|
131
|
+
- **`FstInjector`**: In-place GameCube and Wii File System Table modifier without external tools like `wit` or `gcit`.
|
|
132
|
+
|
|
133
|
+
### 6. Compression, Audio & Graphics Codecs
|
|
134
|
+
- **Nintendo BIOS Compression**: LZ10 (0x10), LZ11 (0x11), RLE (0x30), and Huffman 4/8-bit (0x24, 0x28).
|
|
135
|
+
- **Nintendo Yaz0**: Ubiquitous compression across N64, GameCube, Wii, and Switch.
|
|
136
|
+
- **Tile Graphics Engine**: 1bpp, 2bpp (GB/NES), 4bpp chunky/planar (SNES/GBA/NDS), and 8bpp codecs with `TileReducer` deduplication.
|
|
137
|
+
- **Pillow / PNG Bridge (`ImageBridge`)**: Two-way converter between game tilemaps/palettes and standard PNG images.
|
|
138
|
+
- **Audio & Video**: PlayStation CD-XA ADPCM decoder, Nintendo DS SDAT sound container, and PS1 MDEC / STR movie demuxer.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Quickstart Guide
|
|
143
|
+
|
|
144
|
+
### 1. Universal ROM Unpack and Repack
|
|
145
|
+
|
|
146
|
+
MioROM automatically detects container and ROM formats from magic headers, unpacks system binaries to `sys/` and assets to `root/`, and repacks with hardware checksum fixes:
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from miorom import unpack_rom, repack_rom
|
|
150
|
+
|
|
151
|
+
# Unpack any supported ROM (NDS, ISO, NARC, U8 ARC, Cartridge)
|
|
152
|
+
meta = unpack_rom("game.nds", "unpacked/")
|
|
153
|
+
print(f"Format: {meta['format']}, Files: {meta.get('file_count')}")
|
|
154
|
+
|
|
155
|
+
# Modify assets in unpacked/root/ or binaries in unpacked/sys/...
|
|
156
|
+
|
|
157
|
+
# Repack cleanly into a compliant, bootable ROM
|
|
158
|
+
repack_rom("unpacked/", "game_patched.nds")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 2. Surgical Binary Patching with `PatchWriter` and `HexDiffHighlighter`
|
|
162
|
+
|
|
163
|
+
Apply precise in-memory modifications, verify the binary changes visually, and export standard distribution patches:
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from miorom.patch import PatchWriter
|
|
167
|
+
from miorom.core import HexDiffHighlighter
|
|
168
|
+
|
|
169
|
+
rom_data = open("arm9.bin", "rb").read()
|
|
170
|
+
writer = PatchWriter(rom_data)
|
|
171
|
+
|
|
172
|
+
# Apply contiguous writes and pointer updates
|
|
173
|
+
writer.write_at(0x00014000, b"TRANSLATED_TEXT\x00")
|
|
174
|
+
writer.write_u32_at(0x00010004, 0x02014000, endian="<")
|
|
175
|
+
|
|
176
|
+
patched_data = writer.apply()
|
|
177
|
+
|
|
178
|
+
# Visually verify modified bytes in terminal
|
|
179
|
+
HexDiffHighlighter.print_diff(
|
|
180
|
+
original=rom_data,
|
|
181
|
+
modified=patched_data,
|
|
182
|
+
offset=0x00010000,
|
|
183
|
+
size=32,
|
|
184
|
+
use_color=True,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
# Export as an IPS distribution patch
|
|
188
|
+
with open("patch.ips", "wb") as f:
|
|
189
|
+
f.write(writer.build_ips())
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 3. Assembling Micro-Assembly Routines with `AsmSnippet`
|
|
193
|
+
|
|
194
|
+
Emit standalone ARM32 or MIPS routines without requiring external cross-compiler toolchains:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from miorom.asm import AsmSnippet
|
|
198
|
+
|
|
199
|
+
# Assemble an ARM32 hook routine
|
|
200
|
+
arm = AsmSnippet.arm("<")
|
|
201
|
+
arm.push(["r4", "r5", "lr"])
|
|
202
|
+
arm.mov_imm("r0", 42)
|
|
203
|
+
arm.add_imm("r1", "r0", 10)
|
|
204
|
+
arm.bx("lr")
|
|
205
|
+
machine_code = arm.emit()
|
|
206
|
+
|
|
207
|
+
# Output: 20 bytes of ARM32 machine code ready for code cave injection
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 4. Serializing Structs and Records with `RecordBuilder`
|
|
211
|
+
|
|
212
|
+
Construct binary table records, fixed-width entries, and headers cleanly:
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
from miorom.core import RecordBuilder
|
|
216
|
+
|
|
217
|
+
entry = (
|
|
218
|
+
RecordBuilder(endian="<")
|
|
219
|
+
.u32(0x1001) # Item ID
|
|
220
|
+
.fixed_str("Elixir", length=16, pad_byte=0x00) # Fixed-length string
|
|
221
|
+
.pascal_str("Fully restores HP/MP", length_size=1) # Pascal string
|
|
222
|
+
.u16(999) # Price
|
|
223
|
+
.align(4) # Word alignment
|
|
224
|
+
.build()
|
|
225
|
+
)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 5. String Relocation and Pointer Recalculation
|
|
229
|
+
|
|
230
|
+
Safely expand game dialogue strings while recalculating internal pointer tables via LCS alignment:
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
from miorom import RelocatableBuffer
|
|
234
|
+
|
|
235
|
+
# Load a script segment
|
|
236
|
+
buf = RelocatableBuffer.load("dialogue.bin")
|
|
237
|
+
|
|
238
|
+
# Register pointer offsets and dynamic size headers
|
|
239
|
+
buf.register_anchored_field(pos=0x00, size=2, anchor_type="size_delta")
|
|
240
|
+
buf.register_pointer(pos=0x04, size=2, endian="<")
|
|
241
|
+
buf.register_pointer(pos=0x06, size=2, endian="<")
|
|
242
|
+
|
|
243
|
+
# Perform chained text replacements safely
|
|
244
|
+
buf.replace_text("Hello", "Good morning, adventurer!")
|
|
245
|
+
buf.replace_text("Item found.", "You have obtained a rare treasure!")
|
|
246
|
+
|
|
247
|
+
# Recalculate all registered pointers in one pass
|
|
248
|
+
report = buf.relocate_all()
|
|
249
|
+
buf.save("dialogue_expanded.bin")
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 6. Variable-Width Font (VWF) Word Wrapping
|
|
253
|
+
|
|
254
|
+
Validate and wrap dialogue lines using exact on-screen pixel metrics instead of naive character counts:
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
from miorom.text import BitmapFont, PixelWordWrapper
|
|
258
|
+
|
|
259
|
+
# Initialize font with proportional glyph metrics
|
|
260
|
+
font = BitmapFont(default_height=12, default_advance=8)
|
|
261
|
+
font.set_character_advance("i", 3)
|
|
262
|
+
font.set_character_advance("W", 12)
|
|
263
|
+
|
|
264
|
+
wrapper = PixelWordWrapper(font=font, max_pixel_width=220, max_lines=3)
|
|
265
|
+
result = wrapper.wrap("Welcome to the kingdom of Norad! We hope your journey was pleasant.")
|
|
266
|
+
|
|
267
|
+
print(f"Total lines: {len(result.lines)}, Fits in textbox: {result.fits}")
|
|
268
|
+
for line in result.lines:
|
|
269
|
+
print(f"Line ({line.pixel_width}px): {line.text}")
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Architecture and Source Layout
|
|
275
|
+
|
|
276
|
+
```text
|
|
277
|
+
miorom/
|
|
278
|
+
├── pyproject.toml # Build system and dependency specifications
|
|
279
|
+
├── README.md # Project overview and quickstart
|
|
280
|
+
├── docs/
|
|
281
|
+
│ ├── API_REFERENCE.md # Comprehensive 60+ class API reference
|
|
282
|
+
│ ├── BINARY_PRIMITIVES.md # Low-level primitives developer guide
|
|
283
|
+
│ ├── CLI_REFERENCE.md # Terminal command manual
|
|
284
|
+
│ ├── PLATFORMS.md # Per-console format specifications
|
|
285
|
+
│ ├── WORKFLOW_GUIDE.md # 6-phase localization pipeline walkthrough
|
|
286
|
+
│ ├── PLUGIN_GUIDE.md # Custom BaseRomHandler registration guide
|
|
287
|
+
│ ├── LIBRARY_CONTRACTS.md # Serialization, streaming, extensibility contracts
|
|
288
|
+
│ └── SECURITY.md # Untrusted-archive extraction safety guide
|
|
289
|
+
├── src/miorom/
|
|
290
|
+
│ ├── core/ # Stream I/O, Structs, Relocation, SymbolMap, HexDiff
|
|
291
|
+
│ ├── patch/ # IPS, BPS, Xdelta, and PatchWriter
|
|
292
|
+
│ ├── asm/ # Universal disassembler, AsmSnippet, Hooks, Anti-piracy
|
|
293
|
+
│ ├── script/ # ScriptVM, AST decompiler, IR lifter, Repackers
|
|
294
|
+
│ ├── text/ # VWF wrapper, CharMap, DTE, PO handler, Aligner
|
|
295
|
+
│ ├── platforms/ # NDS, Wii/GC, N64, GBA, GB, SNES, PSX, MD, ISO9660, CD-ROM
|
|
296
|
+
│ ├── graphics/ # Tile codecs (1-8bpp), Palettes, TileReducer, ImageBridge
|
|
297
|
+
│ ├── compression/ # LZ10, LZ11, RLE, Yaz0, Huffman, Heuristic LZSS
|
|
298
|
+
│ ├── audio/ # SDAT, IMA-ADPCM, CD-XA audio decoders and WAV builders
|
|
299
|
+
│ ├── save/ # Checksum calculators (CRC16/32, Fletcher) and DualSlotSave
|
|
300
|
+
│ ├── archive/ # Container unpackers and in-memory VirtualFileSystem (VFS)
|
|
301
|
+
│ ├── link/ # In-ROM ELF32 object linker and cave injector
|
|
302
|
+
│ ├── rom/ # Universal ROM unpacker and repacker manager
|
|
303
|
+
│ ├── scanner/ # Deep signature inspector, entropy profiling, crypto scans
|
|
304
|
+
│ └── cli/ # Command-line interface commands
|
|
305
|
+
└── tests/ # Pytest verification suite (405 unit tests)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Contributing & Testing
|
|
311
|
+
|
|
312
|
+
Contributions are welcome. Please ensure that all changes include comprehensive unit tests and pass the entire test suite:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Run all unit tests
|
|
316
|
+
pytest
|
|
317
|
+
|
|
318
|
+
# Run tests with coverage reporting
|
|
319
|
+
pytest --cov=miorom tests/
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## License
|
|
325
|
+
|
|
326
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
miorom-0.13.0/README.md
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# MioROM
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](tests/)
|
|
6
|
+
[](docs/API_REFERENCE.md)
|
|
7
|
+
|
|
8
|
+
**MioROM** is an advanced, modular Python framework and low-level primitive library for ROM hacking, game localization engineering, and binary reverse engineering.
|
|
9
|
+
|
|
10
|
+
Designed with a **library-first philosophy** (analogous to `ndspy` and `pwntools`), MioROM provides foundational building blocks, platform container parsers, instruction scanners, and pointer recalculation engines required to build reliable, reproducible game extraction, translation, and repacking pipelines in pure Python.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
- [API Reference and Architecture Guide](docs/API_REFERENCE.md) - Comprehensive index of all subpackages and 60+ core classes.
|
|
17
|
+
- [Binary and Assembly Primitives Guide](docs/BINARY_PRIMITIVES.md) - Technical guide for low-level patching, micro-assembly, struct serialization, and symbol mapping.
|
|
18
|
+
- [Command-Line Interface (CLI) Reference](docs/CLI_REFERENCE.md) - Complete manual for `miorom` terminal tools (`unpack`, `repack`, `inspect`, `scan`, etc.).
|
|
19
|
+
- [Console Platform & Format Reference](docs/PLATFORMS.md) - Deep dive into NDS, Wii/GC, PS1, N64, GBA, SNES, and Mega Drive formats.
|
|
20
|
+
- [End-to-End Localization Workflow Guide](docs/WORKFLOW_GUIDE.md) - 6-phase walkthrough from untouched ROM to distributed patch.
|
|
21
|
+
- [Adding New Platforms (Plugin Guide)](docs/PLUGIN_GUIDE.md) - Registering custom `BaseRomHandler` implementations without forking MioROM.
|
|
22
|
+
- [Library Contracts](docs/LIBRARY_CONTRACTS.md) - Serialization, streaming, structured exceptions, patch composition, pipeline extension, and structural-typing contracts.
|
|
23
|
+
- [Security Guide](docs/SECURITY.md) - Path traversal / zip-slip protection and the checklist for safely extracting untrusted archives.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### From GitHub
|
|
30
|
+
|
|
31
|
+
Install directly using `pip`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install git+https://github.com/MiokoTech/miorom.git
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### From Source (Development Mode)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/MiokoTech/miorom.git
|
|
41
|
+
cd miorom
|
|
42
|
+
pip install -e .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
To run the verification test suite:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pytest
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Platform Support Matrix
|
|
54
|
+
|
|
55
|
+
MioROM provides native parsers, serializers, and filesystem handlers across multiple retro and modern console architectures without external binary dependencies:
|
|
56
|
+
|
|
57
|
+
| Platform | Containers & Filesystems | Executables & Formats | Text, Fonts & Compression |
|
|
58
|
+
| :--- | :--- | :--- | :--- |
|
|
59
|
+
| **Nintendo DS** | `.nds` ROM, NARC (`.narc`) archives, FAT | ARM9/ARM7 binaries, overlays | NFTR fonts, SDAT audio, LZ10, LZ11, RLE |
|
|
60
|
+
| **Nintendo Wii / GameCube** | Optical Disc (`.iso`, `.gcm`), U8 (`.arc`, `.szs`), FST | DOL executables, ELF objects | BRFNT fonts, TPL textures, Yaz0 |
|
|
61
|
+
| **Game Boy Advance** | `.gba` ROM, Cartridge headers | ARM/Thumb relative branches | BGR555 palettes, 4bpp tiles, Complement CRC |
|
|
62
|
+
| **Nintendo 64** | `.z64` (BE), `.v64` (Swapped), `.n64` (LE) | MIPS split-pointer scanner | IPL3 CIC checksum verification (all variants) |
|
|
63
|
+
| **Super Nintendo** | `.sfc`, `.smc` (LoROM / HiROM / ExHiROM) | 65816 memory mapping | 2bpp/4bpp planar tiles, 16-bit complement CRC |
|
|
64
|
+
| **PlayStation 1** | Optical Disc (ISO9660, CUE/BIN multi-track) | PS-X EXE, STR video, CD-XA audio | TIM textures, MDEC video bitstreams, EDC/ECC |
|
|
65
|
+
| **Sega Genesis / Mega Drive** | `.md`, `.bin`, `.smd` (Interleaved de-interleaving) | 68000 header & SRAM registers | 16-bit big-endian ROM checksum recalculation |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Core Pillars & Capabilities
|
|
70
|
+
|
|
71
|
+
### 1. Low-Level Binary Manipulation & Patching
|
|
72
|
+
- **`BinaryReader` & `BinaryWriter`**: High-performance stream I/O with dynamic endianness switching (`<` / `>`), temporary context seeking (`with reader.at(offset): ...`), and boundary alignment padding.
|
|
73
|
+
- **`PatchWriter`**: Fluent binary patch emitter with automatic cursor tracking, range replacements, and instant IPS distribution patch generation.
|
|
74
|
+
- **`RecordBuilder`**: Fluent struct writer constructing binary headers and packed records with fixed-width strings, Pascal strings, and memory alignment without brittle format strings.
|
|
75
|
+
- **`RelocatableBuffer`**: Immutable pristine snapshot buffer preventing offset drift across chained text edits, recalculating all registered pointers in a single pass.
|
|
76
|
+
- **`HexDiffHighlighter`**: Terminal verification tool rendering colorized ANSI hex diffs (green for additions, red for original bytes) before writing changes to disk.
|
|
77
|
+
- **`SymbolMap`**: Memory and ROM address annotator with export to No$GBA (`.sym`), Dolphin (`.map`), and Ghidra CSV labels.
|
|
78
|
+
|
|
79
|
+
### 2. Disassembly, Assembly & Static Analysis
|
|
80
|
+
- **`UniversalDisassembler`**: Multi-architecture disassembler supporting PowerPC, ARM32, Thumb-16, and MIPS without native C dependencies.
|
|
81
|
+
- **`AsmSnippet`**: Pure-Python micro-assembler for compiling small ARM32 and MIPS instruction sequences (branches, loads, calls, returns) without external toolchains.
|
|
82
|
+
- **`PPCInstructionScanner` & `MIPSInstructionScanner`**: Searches binary executables for split-pointer load pairs (`lis` + `addi` / `lui` + `addiu`) and patches them in-place.
|
|
83
|
+
- **`CodeCaveFinder` & `TrampolineHook`**: Locates contiguous unused padding bytes (`0x00`/`0xFF`) and constructs 5-instruction trampolines preserving original opcodes.
|
|
84
|
+
- **`AntiPiracyBypasser`**: Scans and applies surgical patches to NDS cartridge checks, checksum verification loops, and PowerPC integrity branches.
|
|
85
|
+
|
|
86
|
+
### 3. Pointer Tables & Relocation Engines
|
|
87
|
+
- **`PointerTable` & `PointerEntry`**: Manages absolute, relative, segmented, and flagged pointers (`offset + flags`) with 1:1 relocation.
|
|
88
|
+
- **`MultiLevelPointerTable`**: Resolves cascading multi-tier pointer hierarchies (Chapter -> Scene -> Text Block).
|
|
89
|
+
- **`ByteOffsetMapper`**: Computes exact 1:1 address relocation using Longest Common Subsequence (LCS) alignment when text data expands.
|
|
90
|
+
- **`FarPointerRelocator` & `RomLayoutExpander`**: Relocates binary assets into expanded ROM memory banks (GBA 32MB, N64 64MB) with automatic hardware checksum repairs.
|
|
91
|
+
|
|
92
|
+
### 4. Text, Typography & Localization Engineering
|
|
93
|
+
- **`PixelWordWrapper` & `FontMetrics`**: Measures dialogue lines against true on-screen pixel boundaries for Variable-Width Fonts (VWF), preventing textbox overflows.
|
|
94
|
+
- **`TrieTranscoder`**: High-performance greedy longest-prefix transcoder for Dual-Tile Encoding (DTE), Byte-Pair Encoding (BPE), and custom `.tbl` character tables.
|
|
95
|
+
- **`GameTextTemplate`**: Bidirectional dialogue template engine with dynamic control tags and reverse parameter extraction.
|
|
96
|
+
- **`StringAligner`**: Correlates and transfers translated strings between regional releases (e.g. Japanese v1.0 to USA v1.1) despite shifted or inserted rows.
|
|
97
|
+
- **`PoHandler`**: Two-way bridge connecting game text to GNU gettext PO files for standard translation toolchains (Weblate, Crowdin, Poedit).
|
|
98
|
+
|
|
99
|
+
### 5. Filesystem, Containers & Disc Images
|
|
100
|
+
- **`RomManager`**: Unified auto-detecting ROM unpacker and repacker for NDS, GameCube/Wii ISO, U8 Archive, NARC, ISO9660, and Cartridges.
|
|
101
|
+
- **`ISO9660` & `CueBinDisc`**: Pure-Python optical disc filesystem parser and injector with LBA sector reallocation and ECMA-130 EDC/ECC recalculation.
|
|
102
|
+
- **`VirtualFileSystem` (VFS)**: In-memory hierarchical filesystem layer allowing transparent archive mounting, file browsing, and in-place node editing.
|
|
103
|
+
- **`FstInjector`**: In-place GameCube and Wii File System Table modifier without external tools like `wit` or `gcit`.
|
|
104
|
+
|
|
105
|
+
### 6. Compression, Audio & Graphics Codecs
|
|
106
|
+
- **Nintendo BIOS Compression**: LZ10 (0x10), LZ11 (0x11), RLE (0x30), and Huffman 4/8-bit (0x24, 0x28).
|
|
107
|
+
- **Nintendo Yaz0**: Ubiquitous compression across N64, GameCube, Wii, and Switch.
|
|
108
|
+
- **Tile Graphics Engine**: 1bpp, 2bpp (GB/NES), 4bpp chunky/planar (SNES/GBA/NDS), and 8bpp codecs with `TileReducer` deduplication.
|
|
109
|
+
- **Pillow / PNG Bridge (`ImageBridge`)**: Two-way converter between game tilemaps/palettes and standard PNG images.
|
|
110
|
+
- **Audio & Video**: PlayStation CD-XA ADPCM decoder, Nintendo DS SDAT sound container, and PS1 MDEC / STR movie demuxer.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Quickstart Guide
|
|
115
|
+
|
|
116
|
+
### 1. Universal ROM Unpack and Repack
|
|
117
|
+
|
|
118
|
+
MioROM automatically detects container and ROM formats from magic headers, unpacks system binaries to `sys/` and assets to `root/`, and repacks with hardware checksum fixes:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from miorom import unpack_rom, repack_rom
|
|
122
|
+
|
|
123
|
+
# Unpack any supported ROM (NDS, ISO, NARC, U8 ARC, Cartridge)
|
|
124
|
+
meta = unpack_rom("game.nds", "unpacked/")
|
|
125
|
+
print(f"Format: {meta['format']}, Files: {meta.get('file_count')}")
|
|
126
|
+
|
|
127
|
+
# Modify assets in unpacked/root/ or binaries in unpacked/sys/...
|
|
128
|
+
|
|
129
|
+
# Repack cleanly into a compliant, bootable ROM
|
|
130
|
+
repack_rom("unpacked/", "game_patched.nds")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 2. Surgical Binary Patching with `PatchWriter` and `HexDiffHighlighter`
|
|
134
|
+
|
|
135
|
+
Apply precise in-memory modifications, verify the binary changes visually, and export standard distribution patches:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from miorom.patch import PatchWriter
|
|
139
|
+
from miorom.core import HexDiffHighlighter
|
|
140
|
+
|
|
141
|
+
rom_data = open("arm9.bin", "rb").read()
|
|
142
|
+
writer = PatchWriter(rom_data)
|
|
143
|
+
|
|
144
|
+
# Apply contiguous writes and pointer updates
|
|
145
|
+
writer.write_at(0x00014000, b"TRANSLATED_TEXT\x00")
|
|
146
|
+
writer.write_u32_at(0x00010004, 0x02014000, endian="<")
|
|
147
|
+
|
|
148
|
+
patched_data = writer.apply()
|
|
149
|
+
|
|
150
|
+
# Visually verify modified bytes in terminal
|
|
151
|
+
HexDiffHighlighter.print_diff(
|
|
152
|
+
original=rom_data,
|
|
153
|
+
modified=patched_data,
|
|
154
|
+
offset=0x00010000,
|
|
155
|
+
size=32,
|
|
156
|
+
use_color=True,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
# Export as an IPS distribution patch
|
|
160
|
+
with open("patch.ips", "wb") as f:
|
|
161
|
+
f.write(writer.build_ips())
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 3. Assembling Micro-Assembly Routines with `AsmSnippet`
|
|
165
|
+
|
|
166
|
+
Emit standalone ARM32 or MIPS routines without requiring external cross-compiler toolchains:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from miorom.asm import AsmSnippet
|
|
170
|
+
|
|
171
|
+
# Assemble an ARM32 hook routine
|
|
172
|
+
arm = AsmSnippet.arm("<")
|
|
173
|
+
arm.push(["r4", "r5", "lr"])
|
|
174
|
+
arm.mov_imm("r0", 42)
|
|
175
|
+
arm.add_imm("r1", "r0", 10)
|
|
176
|
+
arm.bx("lr")
|
|
177
|
+
machine_code = arm.emit()
|
|
178
|
+
|
|
179
|
+
# Output: 20 bytes of ARM32 machine code ready for code cave injection
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 4. Serializing Structs and Records with `RecordBuilder`
|
|
183
|
+
|
|
184
|
+
Construct binary table records, fixed-width entries, and headers cleanly:
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
from miorom.core import RecordBuilder
|
|
188
|
+
|
|
189
|
+
entry = (
|
|
190
|
+
RecordBuilder(endian="<")
|
|
191
|
+
.u32(0x1001) # Item ID
|
|
192
|
+
.fixed_str("Elixir", length=16, pad_byte=0x00) # Fixed-length string
|
|
193
|
+
.pascal_str("Fully restores HP/MP", length_size=1) # Pascal string
|
|
194
|
+
.u16(999) # Price
|
|
195
|
+
.align(4) # Word alignment
|
|
196
|
+
.build()
|
|
197
|
+
)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 5. String Relocation and Pointer Recalculation
|
|
201
|
+
|
|
202
|
+
Safely expand game dialogue strings while recalculating internal pointer tables via LCS alignment:
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
from miorom import RelocatableBuffer
|
|
206
|
+
|
|
207
|
+
# Load a script segment
|
|
208
|
+
buf = RelocatableBuffer.load("dialogue.bin")
|
|
209
|
+
|
|
210
|
+
# Register pointer offsets and dynamic size headers
|
|
211
|
+
buf.register_anchored_field(pos=0x00, size=2, anchor_type="size_delta")
|
|
212
|
+
buf.register_pointer(pos=0x04, size=2, endian="<")
|
|
213
|
+
buf.register_pointer(pos=0x06, size=2, endian="<")
|
|
214
|
+
|
|
215
|
+
# Perform chained text replacements safely
|
|
216
|
+
buf.replace_text("Hello", "Good morning, adventurer!")
|
|
217
|
+
buf.replace_text("Item found.", "You have obtained a rare treasure!")
|
|
218
|
+
|
|
219
|
+
# Recalculate all registered pointers in one pass
|
|
220
|
+
report = buf.relocate_all()
|
|
221
|
+
buf.save("dialogue_expanded.bin")
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 6. Variable-Width Font (VWF) Word Wrapping
|
|
225
|
+
|
|
226
|
+
Validate and wrap dialogue lines using exact on-screen pixel metrics instead of naive character counts:
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
from miorom.text import BitmapFont, PixelWordWrapper
|
|
230
|
+
|
|
231
|
+
# Initialize font with proportional glyph metrics
|
|
232
|
+
font = BitmapFont(default_height=12, default_advance=8)
|
|
233
|
+
font.set_character_advance("i", 3)
|
|
234
|
+
font.set_character_advance("W", 12)
|
|
235
|
+
|
|
236
|
+
wrapper = PixelWordWrapper(font=font, max_pixel_width=220, max_lines=3)
|
|
237
|
+
result = wrapper.wrap("Welcome to the kingdom of Norad! We hope your journey was pleasant.")
|
|
238
|
+
|
|
239
|
+
print(f"Total lines: {len(result.lines)}, Fits in textbox: {result.fits}")
|
|
240
|
+
for line in result.lines:
|
|
241
|
+
print(f"Line ({line.pixel_width}px): {line.text}")
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Architecture and Source Layout
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
miorom/
|
|
250
|
+
├── pyproject.toml # Build system and dependency specifications
|
|
251
|
+
├── README.md # Project overview and quickstart
|
|
252
|
+
├── docs/
|
|
253
|
+
│ ├── API_REFERENCE.md # Comprehensive 60+ class API reference
|
|
254
|
+
│ ├── BINARY_PRIMITIVES.md # Low-level primitives developer guide
|
|
255
|
+
│ ├── CLI_REFERENCE.md # Terminal command manual
|
|
256
|
+
│ ├── PLATFORMS.md # Per-console format specifications
|
|
257
|
+
│ ├── WORKFLOW_GUIDE.md # 6-phase localization pipeline walkthrough
|
|
258
|
+
│ ├── PLUGIN_GUIDE.md # Custom BaseRomHandler registration guide
|
|
259
|
+
│ ├── LIBRARY_CONTRACTS.md # Serialization, streaming, extensibility contracts
|
|
260
|
+
│ └── SECURITY.md # Untrusted-archive extraction safety guide
|
|
261
|
+
├── src/miorom/
|
|
262
|
+
│ ├── core/ # Stream I/O, Structs, Relocation, SymbolMap, HexDiff
|
|
263
|
+
│ ├── patch/ # IPS, BPS, Xdelta, and PatchWriter
|
|
264
|
+
│ ├── asm/ # Universal disassembler, AsmSnippet, Hooks, Anti-piracy
|
|
265
|
+
│ ├── script/ # ScriptVM, AST decompiler, IR lifter, Repackers
|
|
266
|
+
│ ├── text/ # VWF wrapper, CharMap, DTE, PO handler, Aligner
|
|
267
|
+
│ ├── platforms/ # NDS, Wii/GC, N64, GBA, GB, SNES, PSX, MD, ISO9660, CD-ROM
|
|
268
|
+
│ ├── graphics/ # Tile codecs (1-8bpp), Palettes, TileReducer, ImageBridge
|
|
269
|
+
│ ├── compression/ # LZ10, LZ11, RLE, Yaz0, Huffman, Heuristic LZSS
|
|
270
|
+
│ ├── audio/ # SDAT, IMA-ADPCM, CD-XA audio decoders and WAV builders
|
|
271
|
+
│ ├── save/ # Checksum calculators (CRC16/32, Fletcher) and DualSlotSave
|
|
272
|
+
│ ├── archive/ # Container unpackers and in-memory VirtualFileSystem (VFS)
|
|
273
|
+
│ ├── link/ # In-ROM ELF32 object linker and cave injector
|
|
274
|
+
│ ├── rom/ # Universal ROM unpacker and repacker manager
|
|
275
|
+
│ ├── scanner/ # Deep signature inspector, entropy profiling, crypto scans
|
|
276
|
+
│ └── cli/ # Command-line interface commands
|
|
277
|
+
└── tests/ # Pytest verification suite (405 unit tests)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Contributing & Testing
|
|
283
|
+
|
|
284
|
+
Contributions are welcome. Please ensure that all changes include comprehensive unit tests and pass the entire test suite:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Run all unit tests
|
|
288
|
+
pytest
|
|
289
|
+
|
|
290
|
+
# Run tests with coverage reporting
|
|
291
|
+
pytest --cov=miorom tests/
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## License
|
|
297
|
+
|
|
298
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|