Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extractions and Repacker fix #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wood5578
Copy link

@wood5578 wood5578 commented Mar 29, 2024

Here are a few rough fixes to allow the program to extract most of the DRPs that were previously not extractable, code is a bit messy since I don't really have much experience on C#. I have provided my findings and solutions within the descriptions of the commits below.

Overview
DRP Extractor :

  1. Entry offset fix, some stage drp should now be extractable with the changes.
  2. Check for the value of unk of drp as that determines if the file is compressed or not, this should allow some of the chrind files to be fully extracted instead of having only bindpose and helperbone extracted.

DRP Repacker :

  1. Don't compress files with unk value of 0.

Original method determines the offset by offsetting the reader.BaseStream.postion with the value of Fileend Offset , which will results in the wrong offset, causing the char buffer issue or any other unexpected errors.

This method offsets the BaseAddress of the current file with its Entry Size to find the BaseAddress of the next file.
Fixed an issue where certain drp not being fully extracted. 

This was caused by file entries with an unk variable of 0, the unk variable within the drp.Entries[] determines whether or not the file is zlib compressed.  

The program unexpectedly exits with code 0xc0000374 if it attempts to decompress a file with unk variable of 0. I've added a check to skip the decompression process if it detects the entry has an unk variable of 0.
Skip compression process with file entries that has a unk variable of 0
Whoops, forgot to count the amount of subfiles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant