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.

Onigiri Online

Featured Replies

  • Author
  • Localization

Ekey, posted Sun Aug 10, 2014 9:24 pm (92)


Yes local archives do not contain the filenames. They contained in other kxr archive which will downloaded from server while start game.

  • cobralaunch.kxr
  • pkg.json //

Mega Encryption for kxr. Also seems used for decrypt pnut files :)

Code:
int oni_decrypt(unsigned int dwOffset, int pBuffer)
{
  unsigned int Offset;
  unsigned int Buffer;
  int dwSize;
  int Size;
  int result;
  int i;
  char Seed;
  unsigned int NextKey;
  int j;

  Offset = dwOffset;
  Buffer = *(DWORD *)pBuffer;
  dwSize = 4 * *(DWORD *)(pBuffer 8) / 4;
  Size = dwSize *(DWORD *)pBuffer;
  if ( *(DWORD *)pBuffer   {
    do
    {
      *(DWORD *)Buffer ^= Offset;
      Buffer = 4;
      Offset = ~(unsigned __int8)((Offset ^ (Offset >> 3)) >> 13) & 1 | 2 * Offset;
    }
    while ( Buffer   }
  result = *(DWORD *)(pBuffer 8) - dwSize;
  i = 0;
  if ( result > 0 )
  {
    Seed = 0;
    j = 0;
    do
    {
      NextKey = Offset >> Seed;
      i;
      Seed = j 8;
      *(BYTE *)(i Buffer - 1) ^= NextKey;
      j = 8;
    }
    while ( i   }
  return result;
}


Values endian big.

Code:
struct KXRHeader {
 DWORD dwID; // kxrf
 DWORD dwNull; // null
 DWORD dwTableOffset;
 DWORD dwTableSize;
};

   KXRHeader pHeader;
   fread(&pHeader, sizeof(pHeader), 1, fi);
   fseek(fi, pHeader.dwTableOffset, SEEK_SET);

   unsigned char* pBuffer = new unsigned char[pHeader.dwTableSize];
   memset(pBuffer , 0, pHeader.dwTableSize);
   fread(pBuffer, pHeader.dwTableSize, 1, fi);
   
   oni_decrypt(pHeader.dwOffset, (int)pBuffer);


for kotori.pnut

Code:
   oni_decrypt(0x3716F028u, (int)pBuffer);
  • Author
  • Localization

aluigi, posted Sun Aug 10, 2014 10:45 pm (93)


oh come on, that's not fair :)
I went offline to make the job and when I return online I see you did the same.

Anyway I have updated the post.
The only missing thing is the compression algorithm.
My scanner found nothing already existent in the quickbms compression algorithms.
  • Author
  • Localization

Ekey, posted Sun Aug 10, 2014 11:20 pm (94)


Well compressed data featured in this code (see attach). Seems it's zlib.. Maybe modified? :?
  • Author
  • Localization

aluigi, posted Sun Aug 10, 2014 11:24 pm (95)


That algorithm is clearly zlib, but type 0 is different.
Type 0 is more like a rle or something easier than zlib (the first bytes are in clear text like PNG and ggS)
  • Author
  • Localization

Ekey, posted Mon Aug 11, 2014 10:39 am (104)


Ok Luigi. Type 0 it's mean not compressed but encrypted. Algoritm the same :)

Example:

Archive: snd0-0001.kxr
FileName: /2
Type: 0
FileData Offset: 0001a5cb

Here first DWORD already decrypted because passed cycle 1 times
Image

After full cycle
Image
  • Author
  • Localization

aluigi, posted Mon Aug 11, 2014 10:58 am (105)


How it's possible that I didn't notice it yesterday?! Too much stress :)
I have updated the script.

I don't know for what reason but the feature of quickbms that autoguesses the extensions doesn't work, I will check the cause later.

*edit*
The cause is a bug in quickbms, the new feature doesn't work if there are paths in the name (the name must end with a dot or '*' to enable the auto-extension feature with filenames).
  • Author
  • Localization

Ekey, posted Mon Aug 11, 2014 11:01 am (107)


Just need rest! :)
  • Author
  • Localization

aluigi, posted Mon Aug 11, 2014 4:15 pm (112)


I have replaced the decryption function written in bms language, with a dumped one.
Now there are no problems with the slowness.

Unfortunately this is the only method to bypass the speed limitations of quickbms
  • Author
  • Localization

huehuehue, posted Tue Aug 26, 2014 7:39 am (295)


is it possible to encrypt it again?
  • Author
  • Localization

aluigi, posted Tue Aug 26, 2014 8:34 am (297)


type 0 files cannot be reimported because they use that custom encryption, you can reimport files only if they use a native compression/encryption supported by quickbms.
  • Author
  • Localization

HSReina, posted Sun Feb 15, 2015 8:12 am (3181)


Heyllow everyone, Just released my new unpacker who support Onigiri kxr, pnut files.
http://hsreina.shadosoft-tm.com/
I you check well game files, you should be able to repack the game without the future updatae of my tool.
  • Author
  • Localization

aluigi, posted Sun Feb 15, 2015 8:52 am (3183)


It asks username and password.
  • Author
  • Localization

Ekey, posted Sun Feb 15, 2015 4:05 pm (3193)


aluigi wrote:
It asks username and password.

Same
  • Author
  • Localization

HSReina, posted Sun Feb 15, 2015 4:21 pm (3194)


Sorry, I've edited the link, it was a preview of the web site.
To Unpack Onigiri files, you must use KGL Unpacker. You'll can use it on some other Cyberstep games.
  • Author
  • Localization

Apeiron, posted Sun Jun 28, 2015 9:35 pm (5983)


Is there a way to encrypt it again besides re importing?
  • Author
  • Localization

Amped, posted Mon Jun 29, 2015 3:44 am (5986)


HSReina wrote:
Sorry, I've edited the link, it was a preview of the web site.
To Unpack Onigiri files, you must use KGL Unpacker. You'll can use it on some other Cyberstep games.


Where can I find KGL Unpacker? And do you think it will work on GetAmped2's .kxr files?

EDIT: I found it on your site. And it does not work on those files.
  • Author
  • Localization

aluigi, posted Mon Jun 29, 2015 1:34 pm (5994)


I thought that the getamped2.bms script worked, right?
It's valid also for reimporting.
  • Author
  • Localization

Amped, posted Tue Jun 30, 2015 4:20 am (6020)


aluigi wrote:
I thought that the getamped2.bms script worked, right?
It's valid also for reimporting.


Yes, yes, the getamped2.bms script works perfectly. I just thought somebody had an unpacker that could properly view the files within for a second. My bad.
  • Author
  • Localization

huehuehue, posted Sun Aug 02, 2015 1:30 am (6743)


is it possible while extracting , it use the name inside the cobralaunch.kxr>pkg.json?
  • Author
  • Localization

hotsalazar, posted Wed May 04, 2016 6:14 pm (13103)


Hi there, im totally new on this i just wanna ask what this script will do to the game when i unpack it? Sorry for the rookie question but can anyone answer me pls
  • Author
  • Localization

hotsalazar, posted Thu May 05, 2016 9:11 pm (13148)


aluigi wrote:
The script about you refer is this one: http://aluigi.org/bms/onigiri_online.bms
It works with quickbms.
The topic for this game is the following:
viewtopic.php?t=56



Hi aluigi ty for the reply, i as just wondering what the script will change on the game cause my friend told me that theres a hack for this game which need to unpack the files and change something on it and when i read the topic i realized that could be it. Sorry i do not understand any kind of programing codes and maybe the script is just to make the archives avaliable for unpacking and do not change anything on it (for what i understand is this what the script really does).
  • Author
  • Localization

aluigi, posted Fri May 06, 2016 6:34 am (13160)


quickbms allows to reimport/reinject the files back in the original archive.
If you need info about this method read section 3 of quickbms.txt:
http://aluigi.org/papers/quickbms.txt

Regarding this specific script I can say that the files with type 0 "may" or "may not" be reimported, type 4 should work (I don't know if it's zlib or deflate) and all the other types work.
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.