马上注册,享用更多功能,让你轻松玩转DOSPY论坛-诺亚方舟号
您需要 登录 才可以下载或查看,没有账号?立即注册
x
找了许多pak解包工具都不行
附:之前找到的一段有关代码
struct __attribute__((aligned(4))) CPak
{
_DWORD vtable;
_BYTE xor_byte; ///< This maybe 4 bytes
_BYTE unk2[3];
_BYTE filename[12];
char unk3[52];
_DWORD pak_fhandle;
};
int __fastcall pak_do_decrypt(CPak *pak, const char *filename, char *buf, int pos, unsigned int size)
{
bool filename_invalid; // zf
FILE *handle; // r7
unsigned int count; // r0
int result = 0;
filename_invalid = buf == 0;
if ( buf )
filename_invalid = filename == 0;
if ( !filename_invalid )
{
if ( size )
{
if ( !strcmp(filename, "data0000.pak") )
{
if ( !pak->pak_fhandle )
{
strcpy(pak->filename, filename);
pak->pak_fhandle = fopen(filename, "rb");
}
fseek(pak->pak_fhandle, pos, 0); // Seek set
fread(buf, size, 1, pak->pak_fhandle);
int counter = 0; // Counter, xor those bytes :DDDDDDDD
if ( size )
{
do
{
buf[counter++] ^= pak->xor_byte;
}
while ( counter < size );
}
}
else
{
strcpy(pak->filename, filename);
handle = fopen(filename, "rb");
fseek(handle, pos, 0);
fread(buf, size, 1, handle);
count = 0;
if ( size )
{
do
{
buf[count++] ^= pak->xor_byte;
}
while ( count < size );
}
result = fclose(handle);
}
}
}
return result;
}
|
-
|