A collection of Python tools and batch scripts for extracting, decompressing, compressing, and rebuilding BGI/Ethornell .arc archive and DSC (Extensionless) files.
A tool to extract all the files inside a .arc archive file. The extracted files are compressed DSC files, so to work on them you need to decompress them first.
Usage: python arc_extract.py <arc_file> [output_dir]
Examples:
python arc_extract.py data01500.arc(Output directory is the name of the file +"_extracted")python arc_extract.py data01500.arc "Extracted files"
A tool to remake the .arc file in order to replace it for the patch. Works with both compressed and decompressed DSC (extensionless) files.
Usage: python arc_rebuild.py <input_folder> <output_arc_file>
Examples:
python arc_rebuild.py extracted/data01500 data01500_edited(subfolder)python arc_rebuild.py data01500 data01500_edited(plain folder)
Note: The script automatically adds .arc.new extension to the output file. You should remove the .new extension when replacing the original .arc file.
A tool to decompress the DSC (extensionless) files you get when extracting the .arc archives using Arc_extract.
Based on the logic GARbro uses when extracting files from a .arc archive file, so you don't need this if you extracted the .arc files using GARbro.
Usage: python dsc_decompress.py <input> [output_file_or_folder]
Examples:
python dsc_decompress.py 01_Epilogue1 01_Epilogue1_decompressedpython dsc_decompress.py 01_Epilogue1 decompressed/(saves to folder with original filename)
A tool to compress back the DSC (extensionless) files in order to rebuild the .arc file while minimizing the final size. To get the key, you need Analyze_key.
Usage: python dsc_compress.py <input_file> <output_dsc> <key_hex>
Example: python dsc_compress.py 01_epilogue1_decompressed 01_epilogue1_compressed 02207D06
Note: Each DSC file has its own encryption key. Use analyze_key.py to extract the key from the original file before compressing.
A tool to get the encryption key of the original DSC file. The only special thing you need for DSC_compress to work.
Usage: python analyze_key.py <dsc_file>
Example: python analyze_key.py 01_prologue1
Output: Displays the encryption key in hex format (e.g., 0x02207D06)
There are batch files for both Windows (.bat) and Linux (.sh) files in the Batch (windows) and Batch (linux) folders respectively. These scripts can be run from their folders or from the parent directory, they automatically search for the Python scripts in both locations.
They're made to process multiple files at once, minimizing your work if you're working with the whole game. Plus, they're interactive, so you'll know what each batch file needs.
Before starting, make sure you have:
- Python 3.x installed and available in your PATH
- Original .arc files in a folder (for extraction)
- Original compressed DSC files preserved (needed to extract encryption keys)
A complete workflow working with these tools should look like:
- Extract_all - Extract all .arc files to subfolders
- Analyze_all - Analyze original compressed DSC files to get encryption keys → generates
keys.txt - Decompress_all - Decompress all DSC files for editing
- (Edit your decompressed files as needed)
- Compress_all - Compress edited files using keys from
keys.txt - Rebuild_all - Rebuild .arc files from compressed DSC files
- (Files are already decompressed)
- Analyze_all - Run on original compressed DSC files (you need to keep these!) → generates
keys.txt - (Edit your files as needed)
- Compress_all - Compress edited files using keys from
keys.txt - Rebuild_all - Rebuild .arc files from compressed DSC files
Extracts all .arc archive files and organizes them into subfolders.
Interactive prompts:
- Folder containing .arc files
- Parent folder name to create (e.g., "extracted")
Output structure:
extracted/
├── data01500/
│ └── (compressed DSC files)
├── data01600/
│ └── (compressed DSC files)
└── script/
└── (compressed DSC files)
Decompresses all DSC (extensionless) files from subfolders and organizes them into corresponding output subfolders.
Interactive prompts:
- Parent folder with subfolders containing DSC files
- Output parent folder name (e.g., "decompressed")
Input structure:
extracted/
├── data01500/
│ └── (compressed DSC files)
└── data01600/
└── (compressed DSC files)
Output structure:
decompressed/
├── data01500/
│ └── (decompressed DSC files)
└── data01600/
└── (decompressed DSC files)
Note: Files keep their original names, just decompressed.
Analyzes all DSC (extensionless) files in a folder and extracts their encryption keys into a keys.txt file.
Interactive prompts:
- Folder with original compressed DSC files to analyze
Output: Creates keys.txt in the current directory with format:
filename - 0x12345678
01_prologue1 - 0x02207D06
01_epilogue1 - 0x02207D06
...
Important:
- Run this on the original compressed DSC files (from extract_all output)
- Do NOT delete the original compressed files until after running this
- The
keys.txtfile is required for compress_all to work
Compresses all DSC (extensionless) files using the encryption keys from keys.txt.
Interactive prompts:
- Folder with decompressed DSC files to compress
Requirements:
keys.txtmust exist in the current directory (generated by analyze_all)- Each file in the input folder must have a matching key in
keys.txt
Output: Creates files with _compressed suffix (e.g., 01_prologue1_compressed)
Note: If a file doesn't have a key in keys.txt, it will be skipped with a warning.
Rebuilds .arc archive files from subfolders containing DSC files (compressed or decompressed).
Interactive prompts:
- Parent folder name containing subfolders (e.g., "extracted")
Input structure:
extracted/
├── data01500/
│ └── (DSC files)
└── data01600/
└── (DSC files)
Output: Creates .arc.new files:
data01500.arc.new
data01600.arc.new
Note: Remove the .new extension when you're ready to replace the original .arc files.
- Keep your original files: Always preserve the original compressed DSC files until you've generated
keys.txt - Organize your folders: The batch scripts work best with a clear folder structure
- Test your changes: Before replacing the original .arc files, test the uncompressed files by putting them in the parent folder, where the game's executable is at.
- Backup everything: Always keep backups of original game files before modifying
- Check keys.txt: After running analyze_all, verify that all files have keys in
keys.txt - Most dialog scripts are almost always stored in
data015x0.arc. (data01500.arc,data01510.arc,data01520.arcand so on) - Sometimes, menu images and CGs you might want to edit are stored in
data025x0.arc. - I strongly recommend you use marcussacana's SacanaWrapper with the plugin for BGI files to work with the scenario scripts and make translation easier.
"keys.txt not found" error:
- Run
analyze_allfirst on your original compressed DSC files
"No key found for [filename]" warning:
- The file is missing from
keys.txt - Re-run
analyze_allon the original compressed files
Python script not found:
- Make sure the Python scripts (
.pyfiles) are in the same directory as the batch scripts, or in the parent directory
Files not being processed:
- Batch scripts only process extensionless files (DSC files have no extension like
.txtor.bin) - Check that your files don't have hidden extensions
DSC compression/decompression logic based on GARbro by Morkt.