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

RB1 Patch Ark unable to be extracted #11

Closed
AddyMills opened this issue Feb 23, 2022 · 3 comments
Closed

RB1 Patch Ark unable to be extracted #11

AddyMills opened this issue Feb 23, 2022 · 3 comments
Labels

Comments

@AddyMills
Copy link

AddyMills commented Feb 23, 2022

Whenever I try to extract RB1's patch v1.07 for PS3, I get the following error:


Unhandled exception. System.ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length. (Parameter 'value')
   at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
   at Mackiloha.AwesomeReader.ReadInt32()
   at Mackiloha.Ark.ArkFile.ReadStringIndicies(AwesomeReader ar)
   at Mackiloha.Ark.ArkFile.ParseHeader(String input, Stream stream)
   at Mackiloha.Ark.ArkFile.FromFile(String input)
   at ArkHelper.Apps.Ark2DirApp.Parse(Ark2DirOptions op)
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at ArkHelper.Program.Main(String[] args)

This is using the -s and -a commands, but it doesn't work for any combination of commands.

It's strange since every other hdr file before and after seems to work, but this is the only exception. The same seems to happen for the latest RB1 update for 360.

@PikminGuts92
Copy link
Owner

This is because Harmonix used two versions of the v4 ark header. Some track packs and apparently the RB1 updates used a broken version with the offset sizes being of different data types (e.g. 32-bit vs 64-bit).

Luckily @maxton already documented this quirk in his GameArchives library so I can easily add unpack support for it.
https://github.com/maxton/GameArchives/blob/97875280485af067da6adebed5299beaac302fda/Library/Ark/ArkPackage.cs#L154

The difficulty would implementing a good way to denote which v4 type to use when repacking as the current interface uses an integer value as input. Since this is such an edge case I'd opt to not worry about that for now.

But assuming you intend to repack the RB1 update then I would suggest using version 3. Since the base game uses v3 ark header it should have compatibility for it.

@PikminGuts92
Copy link
Owner

I added unpack support for arks with the broken v4 header.

You can download a build for it on AppVeyor until I publish a regular GitHub release.

@AddyMills
Copy link
Author

Amazing, it works now! Thanks very much for that detailed explanation, it's interesting to see how each iteration of ARK changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants