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.

How to unpack the NPK file of the Eggy Go published by netease? Plz help me!!!!

Featured Replies

  • Author
  • Localization

Eggy Go, posted Sat Jul 02, 2022 11:44 pm (72392)


Hi,

This is the first time I post here, so I'm really sorry if there's anything wrong!!

I'm playing eggy go recently.
The music of this game is really good and the font&model is cool.
I try to use Netease Games Tool to unpack the NPK file in the APK of the game, but unfortunately, it failed.
Anyone! Please help me!!!! :oops:

and In game file updates seem to be downloading files to

/storage/emulated/0/android/data/com netease. party/files/NeoX/Documents/

it is not NPK file seems: if you want,you can check it.
  • Author
  • Localization

rabatini, posted Sun Jul 03, 2022 12:26 am (72410)


Eggy Go wrote:
I'm playing eggy go recently.
The music of this game is really good and the font&model is cool.
I try to use Netease Games Tool to unpack the NPK file in the APK of the game, but unfortunately, it failed.
Anyone! Please help me!!!! :oops:

GAMEAPK DL:https://adl.netease.com/d/g/party/c/gw

and In game file updates seem to be downloading files to

/storage/emulated/0/android/data/com netease. party/files/NeoX/Documents/

it is not NPK file seems: if you want,you can check it.


Its not allowed post full game links here.
  • Author
  • Localization

Eggy Go, posted Sun Jul 03, 2022 1:39 am (72414)


rabatini wrote:
Eggy Go wrote:
I'm playing eggy go recently.
The music of this game is really good and the font&model is cool.
I try to use Netease Games Tool to unpack the NPK file in the APK of the game, but unfortunately, it failed.
Anyone! Please help me!!!! :oops:

and In game file updates seem to be downloading files to

/storage/emulated/0/android/data/com netease. party/files/NeoX/Documents/

it is not NPK file seems: if you want,you can check it.


Its not allowed post full game links here.


SORRY FOR IT!!!!!
I have re edited my post and deleted the link.
Is this correct?
  • Author
  • Localization

3IMiner, posted Fri Jul 08, 2022 8:22 am (72525)


I don't know if it's right. It's supposed to help you.
Compressed resource format of a game
Two structures are involved :
Code:
struct st_NpkHeader
{
   int _magic;//                   [_offset 0]
   int _count;//                   [_offset 4]   size(count * 28)   
   int _unknonw2;
   int _unknonw3;
   int _bUseTrunkCompressType;
   int _offset;
};




Code:
struct st_NpkTrunk
{
    int _trunkHash;
    int _dataOffset;
    int _compressSize;
    int _realSize;
    int _unknown1;
    int _unknonw2;
    int _compressType;
};



Full code:
Code:
// UnNpk.cpp : Define the entry point for the console application.
//
 
#include "./liblz4/lz4.h"
#include "./zlib/zlib.h"
#include "stdafx.h"
#include
#include
#include
struct st_NpkHeader
{
   int _magic;//                   [_offset 0]
   int _count;//                   [_offset 4]   size(count * 28)   
   int _unknonw2;
   int _unknonw3;
   int _bUseTrunkCompressType;
   int _offset;
};
 
struct st_NpkTrunk
{
   int _trunkHash;
   int _dataOffset;
   int _compressSize;
   int _realSize;
   int _unknown1;
   int _unknonw2;
   int _compressType;
};
std::string GetNpkFileName(char *pData, unsigned int maxLen)
{
   std::string name;
   for (int i = 0; i < maxLen; i)
   {
      if ((pData[i] >= 'a' && pData[i] <= 'z')
         || (pData[i] >= 'A' && pData[i] <= 'Z') )
      {
         name = pData[i];
      }
   }
   return name;
}
 
int _tmain(int argc, _TCHAR* argv[])
{
   if (argc < 2)
   {
      printf("%s npkFile\n", argv[0]);
      return 0;
   }
   FILE *fp = fopen(argv[1], "rb");
   if (!fp)
   {
      return 0;
   }
   unsigned int nFileLen = 0;
   fseek(fp,0,SEEK_END); //Navigate to the end of the file
   nFileLen = ftell(fp); //file length
 
   fseek(fp,0,SEEK_SET);
 
   st_NpkHeader npkHeader;
   fread(&npkHeader, sizeof(npkHeader), 1, fp);
   if (npkHeader._magic != 0x4b50584e)
   {
      printf("not npk file\n");
      return 0;
   }
   fseek(fp,0,SEEK_SET);
 
   st_NpkTrunk* pNpkTrunkList = new st_NpkTrunk[npkHeader._count];
   std::string strDir = "./Dump";
   if (_access(strDir.c_str(), 0) != 0)
   {
      _mkdir(strDir.c_str());
   }
   fseek(fp, npkHeader._offset,SEEK_SET);
   int nRSize = fread(pNpkTrunkList, sizeof(st_NpkTrunk), npkHeader._count, fp);
   for (int i = 0; i < nRSize; i)
   {
      fseek(fp, pNpkTrunkList[i]._dataOffset, SEEK_SET);
      char *pSrc = new char[pNpkTrunkList[i]._compressSize];      
      fread(pSrc, pNpkTrunkList[i]._compressSize, 1, fp);
      char *pDst = new char[pNpkTrunkList[i]._realSize];
      if (pNpkTrunkList[i]._compressType == 2)
      {
         LZ4_decompress_safe(pSrc, pDst, pNpkTrunkList[i]._compressSize, pNpkTrunkList[i]._realSize);
      }
      else if (pNpkTrunkList[i]._compressType == 1)
      {
         int realSize = pNpkTrunkList[i]._realSize;
         int nRet = uncompress((Bytef *)pDst, (uLongf*)&realSize, (Bytef *)pSrc, pNpkTrunkList[i]._compressSize);
      }
      else
      {
         memcpy(pDst, pSrc, pNpkTrunkList[i]._realSize);
      }      
      char fileName[126];      
      std::string format = GetNpkFileName(pDst, 5);   
      sprintf_s<126>(fileName, "%s/%x.%s", strDir.c_str(), pNpkTrunkList[i]._trunkHash, format.c_str());
      FILE *fp2 = fopen(fileName, "wb");
      fwrite(pDst, pNpkTrunkList[i]._realSize, 1, fp2);
      fclose(fp2);
 
      delete[] pSrc;
      delete[] pDst;
   }
   return 0;
}
 


I wish you success in decryption:)
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.