Skip to content

Commit 95cf7cb

Browse files
author
Ochii
committed
Fix broken decryption on Tiancity's files
1 parent 21845b9 commit 95cf7cb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/pkgfilesystem.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ enum GameDataProvider
8484

8585
extern GameDataProvider g_GameDataProvider;
8686

87-
inline void DetectGameDataProvider(std::vector<std::string>& vGameFiles)
87+
inline void DetectGameDataProvider( const uint8_t* pFileBuffer )
8888
{
89-
bool bFoundTiancityDll = std::find(vGameFiles.begin(), vGameFiles.end(), "sedata.dll") != vGameFiles.end();
89+
std::string szPkgBuffer = reinterpret_cast<const char*>(pFileBuffer);
90+
bool bFoundTiancityDll = szPkgBuffer.find( ".pkg" ) != std::string::npos;
9091

9192
if (bFoundTiancityDll)
9293
g_GameDataProvider = GAMEDATAPROVIDER_TIANCITY;

src/pkgindex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ bool GetPkgFileNames( const std::filesystem::path& pkgDirectoryPath, std::vector
9696
return false;
9797
}
9898

99+
DetectGameDataProvider( pIndexFileBuffer );
99100
FillPkgArrayFromBuffer(vOutPkgFileNames, pIndexFileBuffer);
100-
DetectGameDataProvider(vOutPkgFileNames);
101101
DBG_WPRINTF(L"Detected game data provider: %s\n", GetGameDataProviderStr());
102102

103103
delete[] pIndexFileBuffer;

0 commit comments

Comments
 (0)