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.

Xenoblade - .pkh/.pkb files

Featured Replies

  • Author
  • Localization

AnonBaiter, posted Tue Jun 07, 2016 1:02 pm (14140)


Cool. This script worked for almost all files except for adx.pkb/.pkh and ahx.pkb/.pkh.
Code:
  offset   filesize   filename
--------------------------------------
- enter in folder E:\Dolphin-x64\Games\xenoblade
  coverage file 0     0%   0          1430
- open input file E:\Dolphin-x64\Games\xenoblade\adx.pkh
- enter in folder E:\Dolphin-x64\Games\xenoblade
- open input file E:\Dolphin-x64\Games\xenoblade\adx.pkb

Error: incomplete input file 0: E:\Dolphin-x64\Games\xenoblade\adx.pkh
       Can't read 4 bytes from offset 00000596.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.

  coverage file 0    93%   1334       1430

Last script line before the error or that produced the error:
  25  get OFFSET long

-----

  offset   filesize   filename
--------------------------------------
- enter in folder E:\Dolphin-x64\Games\xenoblade
  coverage file 0     0%   0          67510
- open input file E:\Dolphin-x64\Games\xenoblade\ahx.pkh
- enter in folder E:\Dolphin-x64\Games\xenoblade
- open input file E:\Dolphin-x64\Games\xenoblade\ahx.pkb

Error: incomplete input file 0: E:\Dolphin-x64\Games\xenoblade\ahx.pkh
       Can't read 4 bytes from offset 000107b6.
       Anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted.
       Please check the following coverage information to know if it's ok.

  coverage file 0    99%   67414      67510

Last script line before the error or that produced the error:
  25  get OFFSET long

Since the adx.pkb and ahx.pkb files are AFS archives themselves...
  • Author
  • Localization

aluigi, posted Tue Jun 07, 2016 1:39 pm (14147)


Script 0.2

The problem was caused by the lack of OFFSETs in these 2 archives... yeah completely missing, so I use the size to get the offsets.
  • Author
  • Localization

AnonBaiter, posted Tue Jun 07, 2016 2:06 pm (14150)


Huh. I tested these files on your updated script and they worked fine.
However, I also tested these files with the afs.bms script, so this is sort of an alternative solution.
  • Author
  • Localization

aluigi, posted Tue Jun 07, 2016 3:16 pm (14156)


I think that AFS is one of the archived files, you should have multiple AFS files in the archives.
  • Author
  • Localization

AnonBaiter, posted Tue Jun 07, 2016 3:26 pm (14161)


"multiple AFS files"... So you're saying that most of the .pkb files have .afs files in them?
  • Author
  • Localization

aluigi, posted Tue Jun 07, 2016 3:38 pm (14163)


Well, it's an archive so it's meant to contain multiple files.
With only 2Mb I can't give you a complete answer because it's possible that for those 2 archives it opts for the AFS archive format instead of the pkh/pkb used for the other files. That would explain why the offsets are missing from pkh.
I'm no longer surprised of the weird choices of developers :)
  • Author
  • Localization

AnonBaiter, posted Tue Jun 07, 2016 6:59 pm (14167)


So that means the adx.pkb and ahx.pkb files are meant to be AFS files, isn't that so?
Ma'am, these developer choices are confusing me...
  • Author
  • Localization

aluigi, posted Tue Jun 07, 2016 8:13 pm (14170)


You can do a very simple test.
Open one of these two pkb files in a hex editor and search for the occurrences of the following bytes 0x41 0x46 0x53 0x00 ("AFS\0").
From a quick check that I have just made it appears that adx.pkb and adx.pkb are just AFS archives because the offset containing the filenames (retrieved with afs.bms) is very close to the end of the pkb archives, so there is no space for other files.

After this finding I have updated the xenoblade.bms script for telling the user to use afs.bms with these pkb archives.
  • Author
  • Localization

AnonBaiter, posted Tue Jun 07, 2016 8:31 pm (14171)


That's good enough, thanks.
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.