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.

Need help for extracting NPK files

Featured Replies

  • Author
  • Localization

Lucas Hood, posted Mon Aug 17, 2020 5:14 pm (58124)


Thanks to the effort of Ekey that i have got resources of Kishin Hishou now, currently me and my friend only have one game left that is Kishin Houkou Demonbane. The game used NPK engine and came out from last year, we used Garbro but it didn't work even if used engine from 3 games which are Minikui Mojika no Ko, Sonicomi and Tokyo Necro. We will extremely grateful if you guys can help.

Image

Editted: Solved, creditted to Ekey again for his effort.
  • Author
  • Localization

Ekey, posted Tue Aug 18, 2020 12:05 am (58129)


Code:
# Demonbane (??????????) NPK (NPK2) format
# script for QuickBMS http://quickbms.aluigi.org

comtype deflate_noerror
set KEY binary "\xBE\x28\x02\xAD\x5E\x91\xDD\x8E\x26\xEA\xD6\xB1\x61\xFE\xDB\x8A\x17\xE2\x36\x2F\x53\x33\x6D\x1B\x17\xD8\x0A\xE9\x55\xC0\x5A\xED"

idstring "NPK2"
get VERSION long #2
getdstring IV 16
get FILES long
get TABLE_SIZE long
savepos TABLE_OFFSET

encryption aes_256_cbc KEY IV
log MEMORY_FILE TABLE_OFFSET TABLE_SIZE
encryption "" ""

for i = 0 < FILES
   get ZERO byte MEMORY_FILE
   get NSIZE short MEMORY_FILE
   getdstring NAME NSIZE MEMORY_FILE
   get SIZE long MEMORY_FILE
   getdstring SHA2 32 MEMORY_FILE
   get CHUNKS long MEMORY_FILE
   
   log NAME 0 0
   append
      for j = 0 < CHUNKS
      get CHUNK_OFFSET longlong MEMORY_FILE
      get CHUNK_ESIZE long MEMORY_FILE
      get CHUNK_ZSIZE long MEMORY_FILE
      get CHUNK_SIZE long MEMORY_FILE

      encryption "cipherfinal aes_256_cbc" KEY IV
      clog NAME CHUNK_OFFSET CHUNK_ESIZE CHUNK_SIZE 0 CHUNK_ESIZE
      encryption "" ""
   next j
   append
next i
  • Author
  • Localization

Lucas Hood, posted Tue Aug 18, 2020 4:47 am (58147)


YOU ARE TRULY OUR LORD AND SAVIOR, THANK YOU VERY MUCH!
  • Author
  • Localization

aluigi, posted Tue Aug 18, 2020 6:39 am (58148)


@Ekey
Does it solve the problem I noticed with the first 16bytes?
http://zenhax.com/viewtopic.php?f=9&t=2720

You used comtype deflate_noerror so I guess you just ignored the invalid bytes, correct?
  • Author
  • Localization

Lucas Hood, posted Tue Aug 18, 2020 7:14 am (58152)


Currently me and my friend are also having trouble with the movie files though - except for the CGs and Scripts, Sounds since all are fine, most of the movie files are either distorted or unreadable, like it played for a bit then it froze. Let's wait for Ekey to help then.

https://imgur.com/a/g1nFWWm
  • Author
  • Localization

Ekey, posted Tue Aug 18, 2020 9:53 am (58155)


aluigi wrote:
@Ekey
Does it solve the problem I noticed with the first 16bytes?

I have not found any files with the invalid first 16 bytes.

aluigi wrote:
You used comtype deflate_noerror so I guess you just ignored the invalid bytes, correct?

No, some chunks are simply not compressed in the case of small files, since there are no flags, to check this I set "noerror".Anyway it works correctly.

Lucas Hood wrote:
Currently me and my friend are also having trouble with the movie files though - except for the CGs and Scripts, Sounds since all are fine, most of the movie files are either distorted or unreadable, like it played for a bit then it froze. Let's wait for Ekey to help then.

https://imgur.com/a/g1nFWWm

There is such a problem, but I don't know what caused it.

Edited*: I modified a arc_unpacker by replacing the key from Sonicomi and it extracts exactly the same videos, some play and some break off. I don't know what could be the matter, sorry.

Edited2*: So I found the reason why they break off. Extra 16 bytes are appended to the beginning of some decompressed chunks -> 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
  • Author
  • Localization

Lucas Hood, posted Tue Aug 18, 2020 12:09 pm (58158)


Ekey wrote:
aluigi wrote:
@Ekey
Does it solve the problem I noticed with the first 16bytes?

I have not found any files with the invalid first 16 bytes.

aluigi wrote:
You used comtype deflate_noerror so I guess you just ignored the invalid bytes, correct?

No, some chunks are simply not compressed in the case of small files, since there are no flags, to check this I set "noerror".Anyway it works correctly.

Lucas Hood wrote:
Currently me and my friend are also having trouble with the movie files though - except for the CGs and Scripts, Sounds since all are fine, most of the movie files are either distorted or unreadable, like it played for a bit then it froze. Let's wait for Ekey to help then.

https://imgur.com/a/g1nFWWm

There is such a problem, but I don't know what caused it.

Edited*: I modified a arc_unpacker by replacing the key from Sonicomi and it extracts exactly the same videos, some play and some break off. I don't know what could be the matter, sorry.

Edited2*: So I found the reason why they break off. Extra 16 bytes are appended to the beginning of some decompressed chunks -> 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10


So is there anyway to fix them?
  • Author
  • Localization

Ekey, posted Tue Aug 18, 2020 12:58 pm (58159)


Download latest GARbro here
Download fixed Format.dat from attach
Copy it to GARbro\GameData folder
Run GARbro and use Sonicomi scheme

Image

result

Image
  • Author
  • Localization

aluigi, posted Tue Aug 18, 2020 1:10 pm (58162)


Ekey wrote:
Edited2*: So I found the reason why they break off. Extra 16 bytes are appended to the beginning of some decompressed chunks -> 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

I know how to fix it.
It's the calling of DecryptFinal done by OpenSSL and it can be done in quickbms by simply using the DecryptFinal prefix (or cipherfinal) in front of the algorithm, for example:
Code:
encryption "cipherfinal aes_256_cbc" KEY IV
  • Author
  • Localization

Ekey, posted Tue Aug 18, 2020 1:18 pm (58164)


aluigi wrote:
I know how to fix it.
It's the calling of DecryptFinal done by OpenSSL and it can be done in quickbms by simply using the DecryptFinal prefix (or cipherfinal) in front of the algorithm, for example:
Code:
encryption "cipherfinal aes_256_cbc" KEY IV

Works fine, thanks :)

@Lucas Hood - Use whatever method you like, GARbro or fixed script in my post or script from aluigi :)

aluigi wrote:
This is the edited script with automatic scanning of the keys:
http://aluigi.org/bms/sonicomi.bms

I didn't test it but I hope it works :D

Also works fine :P
  • Author
  • Localization

Lucas Hood, posted Tue Aug 18, 2020 1:20 pm (58165)


Thank you you guys so much for helping us, we couldn't have done it without you guys. Everything went smoothly now.
  • Author
  • Localization

MSQ, posted Fri Mar 17, 2023 6:56 pm (75969)


Hi, sorry to dig up this topic.

I've tried to unpack the files from Tokyo Necro with sonicomi.bms however I suffer an error:

Code:
Error: no key available, please post on https://zenhax.com


I believe the key may have changed.

I have uploaded below a sample of two archives and the game executable. Hopefully this error can be fixed! Thanks!
https://www95.zippyshare.com/v/Hz8di10y/file.html
  • Author
  • Localization

spiritovod, posted Sat Mar 18, 2023 1:01 pm (75974)


Key for steam version of Tokyo Necro is "AAE616FB7DB7EE84ED424C474AADDAD69A8372799AD576629601EF9B8938E20F", you can replace any of existing ones in original sonicomi script or just add a new entry.
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.