PikminGuts92 / Mackiloha

A suite of modding software for hacking milo engine based games
MIT License
18 stars 8 forks source link

Rock Band 4 (PS4) Rivals ARKs not properly extracting files from patch_main_ps4_#.ark #13

Closed LlysiX closed 1 year ago

LlysiX commented 1 year ago

The post-Rivals updates of Rock Band 4 use an ark patching system similar to arkhelper's patchcreator function, where there is no patch_ps4.hdr and instead uses main_ps4.hdr. The issue is twofold.

  1. The patch_mainps4#.ark files need to be renamed to mainps4#.ark starting one number greater than the last real main_ps4 ark file.
  2. The way arkhelper's ark2dir function is set up, it will only read the first instance of a file and ignore the later ones.

While arkhelper cannot properly rebuild or create a patch for any version of Rock Band 4 (which should be an issue of its own), I would at least like a solution to problem 2, to get a look at the actual scripts of Rivals instead of leftover pre-Rivals scripts.

PikminGuts92 commented 1 year ago

Mackiloha doesn't support decrypting encrypted RB4 ark parts. So updating ark2dir in arkhelper for RB4 may require more work if those patch ark parts are encrypted. This isn't an issue for patchcreator functionality since it only appends a new ark part. Updating the ark reading logic to have full RB4 ark support is not really something I'm interested in doing as this is primarily a project focused on Milo, not Forge.

LlysiX commented 1 year ago

All versions of RB4 are unencrypted.

LlysiX commented 1 year ago

To add on to my previous statement, it seems that all Forge games use unencrypted ARKs.

RBVR: image

Amplitude 2016: image

AFAICT, The HDR files do use some form of encryption, but for the RB Forge games, it seems to be an encryption that arkhelper can already handle, as patchcreator can append ark parts to RBVR (and theoretically pre-Rivals RB4 if the exe is no-checksum patched).

PikminGuts92 commented 1 year ago

Specific ark parts in RB4 are encrypted. They are designated by appended character sequence of "mcnxyxcmvmcxyxcmskdldkjshagsdhfj". Maxton's GameArchives uses ProtectedFileStream to read those specific parts.

https://github.com/maxton/GameArchives/blob/97875280485af067da6adebed5299beaac302fda/Library/Ark/ArkPackage.cs#L181-L185

https://github.com/maxton/GameArchives/blob/master/Library/Ark/ProtectedFileStream.cs