# Filesystem The scripts in this folder are used to extract .app and .opt files. ## How to decrypt updates There are two tools you can use to decrypt and extract updates. * [unsega_v0.1727.exe](./Unsega/unsega_v0.1727.exe): Fast but closed source. * [fsdecrypt.exe](./Fsdecrypt/fsdecrypt.exe): Slow but open source. Unsega is sourced directly from 1cc and should be totally safe but if you don't feel like running shady .exe's, you can build fsdecrypt from source instead. Both tools do exactly the same thing and work in a very similar way so use whatever you like. ### .app decryption and extraction 1) Drag and drop the .app file on [unsega_v0.1727.exe](./Unsega/unsega_v0.1727.exe) or [fsdecrypt.exe](./Fsdecrypt/fsdecrypt.exe) 2) Mount the resulting .vhd(unsega) or .ntfs(fsdecrypt) file with [osfmount.exe](./Extra/osfmount.exe) (using default settings) 3) Copy the internal_x.vhd partition from the vhd you just mounted. * If the extracted vhd is named **internal_0.vhd**, you can just double click it to open it. * If the extracted vhd is named **internal_X.vhd** where X is anything else than 0, you'll need to merge the file with a base update first! See [Merging incremental updates](#merging-incremental-updates) 4) Once mounted, copy the files from internal_0.vhd. ### .opt decryption and extraction You'll need to install the [ExFat7z](./Extra/ExFat7z/) 7zip plugin before proceeding. Install instructions are in the plugin's folder. You can find the original download page for the plugin [here](https://www.tc4shell.com/en/7zip/exfat7z/) 1) Drag and drop the .opt file on [fsdecrypt.exe](./Fsdecrypt/fsdecrypt.exe) or [unsega_v0.1727.exe](./Unsega/unsega_v0.1727.exe) 2) Extract the resulting .vhd(unsega) or .exfat(fsdecrypt) file with 7zip. ## Merging incremental updates Sega updates are incremental, If you want to open latest versions, you'll need to merge the vhd files first. The game's vhds are called internal_X.vhd where X can be any number. **internal_0** is your *base* update. **internal_1-9** are *incremental* updates. You *NEED* a base to be able to open the incremental updates, so make sure you're not missing that. Let's say you have a base update and 2 incrementals, here's an example on how to merge them to have the latest version : ```powershell Set-VHD -Path "internal_2.vhd" -ParentPath "internal_1.vhd" Set-VHD -Path "internal_1.vhd" -ParentPath "internal_0.vhd" Merge-VHD -Path "internal_2.vhd" -DestinationPath "internal_1.vhd" Merge-VHD -Path "internal_1.vhd" -DestinationPath "internal_0.vhd" ``` You can now open internal_0.vhd, which contains the updated version of your game. You'll need Hyper-V to be enabled for these commands to work. You'll also need administrator privileges!