Skip to content

Commit

Permalink
新版本诛仙索引大小284->288,修改以适配
Browse files Browse the repository at this point in the history
  • Loading branch information
stsm85 committed Dec 26, 2018
1 parent 46ae717 commit 4921c48
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 9 deletions.
8 changes: 3 additions & 5 deletions PckDll/MapViewFile/MapViewFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,11 @@ LPBYTE CMapViewFile::View(QWORD dwAddress, DWORD dwSize)
void CMapViewFile::SetFilePointer(QWORD lDistanceToMove, DWORD dwMoveMethod)
{
UNQWORD uqwCurrentPos;
uqwCurrentPos.qwValue = lDistanceToMove;

if (INVALID_SET_FILE_POINTER != ::SetFilePointer(hFile, uqwCurrentPos.dwValue, &uqwCurrentPos.lValueHigh, dwMoveMethod)) {
uqwCurrentPos.qwValue = lDistanceToMove;
}
else {
if (INVALID_SET_FILE_POINTER == ::SetFilePointer(hFile, uqwCurrentPos.dwValue, &uqwCurrentPos.lValueHigh, dwMoveMethod))
throw std::exception("SetFilePointer fail");
}

}

QWORD CMapViewFile::GetFilePointer()
Expand Down
12 changes: 10 additions & 2 deletions PckDll/PckClass/PckClassIndexRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,21 @@ BOOL CPckClassIndex::ReadPckFileIndexes()
m_PckLog.PrintLogEL(TEXT_READ_INDEX_FAIL, __FILE__, __FUNCTION__, __LINE__);
return FALSE;
}

DWORD dwFileBytesRead = dwFileIndexTableClearDataLength;
DWORD dwFileBytesRead = MAX_INDEXTABLE_CLEARTEXT_LENGTH/*dwFileIndexTableClearDataLength*/;
BYTE pckFileIndexBuf[MAX_INDEXTABLE_CLEARTEXT_LENGTH];

m_zlib.decompress(pckFileIndexBuf, &dwFileBytesRead,
lpFileBuffer, dwFileIndexTableCryptedDataLength[0]);

#ifdef _DEBUG
/*
新诛仙索引大小改成了288,新加了4字节内容
PCKFILEINDEX_V2030->
*/
PCKFILEINDEX_V2031* testnewindex = (PCKFILEINDEX_V2031*)pckFileIndexBuf;
#endif

m_PckAllInfo.lpDetectedPckVerFunc->PickIndexData(&lpPckIndexTable->cFileIndex, pckFileIndexBuf);

lpFileBuffer += dwFileIndexTableCryptedDataLength[0];
Expand Down
1 change: 1 addition & 0 deletions PckDll/PckClass/PckClassZlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ int CPckClassZlib::decompress(void *dest, unsigned long *destLen, const void *s
assert(0 != *destLen);
int rtnd = uncompress((Bytef*)dest, destLen, (Bytef*)source, sourceLen);
assert(0 != *destLen);
//return (0 != *destLen);
assert(rtnd == Z_OK);
return (rtnd == Z_OK);
}
Expand Down
18 changes: 18 additions & 0 deletions PckDll/PckClass/PckStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ typedef struct _PCK_FILE_INDEX_V2030
DWORD dwUnknown2;
}PCKFILEINDEX_V2030, *LPPCKFILEINDEX_V2030;

#ifdef _DEBUG
/*
新诛仙索引大小改成了288,新加了4字节内容
目前影响不大,暂时不添加
*/
typedef struct _PCK_FILE_INDEX_V2031
{
char szFilename[MAX_PATH_PCK_260];
DWORD dwUnknown1;
QWORD dwAddressOffset;
DWORD dwFileClearTextSize;
DWORD dwFileCipherTextSize;
DWORD dwUnknown2;
DWORD dwUnknown3;
}PCKFILEINDEX_V2031, *LPPCKFILEINDEX_V2031;

#endif

typedef struct _PCK_FILE_INDEX_VXAJH
{
char szFilename[MAX_PATH_PCK_256];
Expand Down
4 changes: 2 additions & 2 deletions PckDll/include/pck_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ typedef char * LPSTR;
typedef PCK_UNIFIED_FILE_ENTRY* LPPUFE;
typedef const PCK_UNIFIED_FILE_ENTRY* CLPPUFE;

#define WINPCK_VERSION "1.30.0.17"
#define WINPCK_VERSION_NUMBER 1,30,0,17
#define WINPCK_VERSION "1.30.0.18"
#define WINPCK_VERSION_NUMBER 1,30,0,18

typedef enum _PCKRTN
{
Expand Down
Binary file modified Release/WinPCK_x64.exe
Binary file not shown.
Binary file modified Release/WinPCK_x86.exe
Binary file not shown.
Binary file modified Release/pckdll_x64.dll
Binary file not shown.
Binary file modified Release/pckdll_x86.dll
Binary file not shown.
Binary file modified Release_static/WinPCK_x64.exe
Binary file not shown.
Binary file modified Release_static/WinPCK_x86.exe
Binary file not shown.

0 comments on commit 4921c48

Please sign in to comment.