Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[PC] The Last of Us Remake PSARC extractor?

Featured Replies

  • Author
  • Localization

amrshaheen61, posted Thu Mar 30, 2023 3:56 pm (76111)


Datura wrote:
I used NoobInCoding's PSARC tool to export, but got error files and mess up, please help NoobInCoding you need to update the tool

PSARC here: https://drive.google.com/file/d/14UbM8Phyjo0SViWF8x2lBWdJErPmVNTh/view?usp=sharing


can you send another example?

exported files:
https://www.mediafire.com/file/6qwegsjl ... folder.rar
  • Author
  • Localization

infogram, posted Mon Apr 03, 2023 3:45 pm (76205)


"An attempt was made to move the file pointer before the beginning of the file." when extracting core.psarc or any of the other large ones like sp-common.psarc.

Seems there's some issues with code using signed int to store uint data
eg. if offset stored in psarc header is 0x87DFAABC it would become -2015384900 as int, and seeking there would make it "move the file pointer before the beginning of the file"

I tried changing out a bunch of int / GetIntValue to use uint / GetUIntValue, it seems the file pointer error goes away, but some files then give "Decompression failed. Verification size does not match given size." error inside OodleLZ_Decompress, with verificationSize = 0 while decompressedSize = 65536.

Hope it can be fixed, one thing that would be interesting would be to extract all game files & then repack as uncompressed psarc, maybe could help reduce the CPU hit from oodle.

E: think I almost got it fixed, issue seems to be the code for working out how many blocks file uses always adds 1 to it, so if file size is exactly same as data block length, it'd try reading another block after it

To fix that I changed

Code:
int bufferCount = (uncompressedSize / psarc.header.DataBlockSize)   1

to
Code:
long bufferCount = (uncompressedSize   (psarc.header.DataBlockSize - 1)) / psarc.header.DataBlockSize;


That should make it use correct block count AFAIK, now I'm getting an issue where a file that seems to be decompressed in the psarc is being passed to oodle though, hm

E: okay think I found reason for that, the size table entry for it was 0, which seems to mean the block is decompressed, GetFileSizes seems to handle that by setting uncompressedSize = compressedSize, and then does this strange loop:
https://github.com/amrshaheen61/TLOU_PS ... rc.cs#L136
Not really sure what that is for, but removing that loop seems to let the file be extracted without error (seems file had first block uncompressed, and then following ones were compressed)

With these changes I could extract core.psarc fine, and checking some .png files extracted from it they all seem valid.

(E: there's a PR with the changes, was able to fully extract/repack and then run game fine :))
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.