1515#include < cstdio>
1616#include < windows.h>
1717#include < tlhelp32.h>
18+ #include " CFlashFix.h"
1819#pragma comment(lib, "ws2_32.lib")
1920#pragma comment(lib, "user32.lib")
2021
@@ -38,13 +39,13 @@ CLegacyCipher* legacy;
3839int ClientVersion = 0 , EnableHostName = 0 , UpdatedIPS = 0 ;
3940BYTE patternDynamic = 0x4F ;
4041char HostName[32 ] = " " ;
41- LPCSTR HeaderConfig = " OpenConquerHook " ;
42+ LPCSTR HeaderConfig = " CLHook " ;
4243// Variables of Settings from .ini file
4344char ServerName[16 ] = " ConquerOnline" ;
44- DWORD ServerNameMemoryAddress = 0x005726DC ;
45+ int ServerNameMemoryAddress = 0x005726DC ;
4546// Patterns for working connection
46- BYTE pattern_66XX [] = { 0x85 , 0xC0 , 0x75 , 0x2F , 0x8B , 0x4F , 0x14 , 0xE8 , 0x0D , 0xF1 , 0xFF , 0xFF , 0x83 , 0x4D , 0xFC , 0xFF , 0x8B , 0x4D , 0xF4 }; // Version = 66XX
47- BYTE pattern2_66XX [] = { 0x85 , 0xC9 , 0x74 , 0x0C , 0xFF , 0x75 , 0x0C , 0x57 , 0xE8 , 0x53 , 0xF2 , 0xFF , 0xFF , 0x89 , 0x45 }; // Version = 66XX
47+ BYTE pattern_6617 [] = { 0x85 , 0xC0 , 0x75 , 0x2F , 0x8B , 0x4F , 0x14 , 0xE8 , 0x0D , 0xF1 , 0xFF , 0xFF , 0x83 , 0x4D , 0xFC , 0xFF , 0x8B , 0x4D , 0xF4 }; // Version = 6617
48+ BYTE pattern2_6617 [] = { 0x85 , 0xC9 , 0x74 , 0x0C , 0xFF , 0x75 , 0x0C , 0x57 , 0xE8 , 0x53 , 0xF2 , 0xFF , 0xFF , 0x89 , 0x45 }; // Version = 6617
4849BYTE pattern_60XX[] = { 0x85 , 0xC0 , 0x75 , 0x00 , 0x8B , 0x4F , 0x00 , 0xE8 , 0x00 , 0x00 , 0x00 , 0x00 , 0x83 , 0x4D , 0x00 , 0x00 , 0x8B , 0x00 , 0x00 }; // Version = 60XX
4950BYTE pattern2_60XX[] = { 0x85 , 0xC9 , 0x00 , 0x00 , 0xFF , 0x75 , 0x00 , 0x57 , 0xE8 , 0x00 , 0x00 , 0x00 , 0x00 , 0x89 , 0x45 }; // Version = 60XX
5051BYTE pattern_OLD[] = { 0x85 , 0xC0 , 0x75 , 0x00 , 0x8B , 0x4E , 0x00 , 0xE8 , 0x00 , 0x00 , 0x00 , 0x00 , 0x83 , 0x4D , 0x00 , 0x00 , 0x8B , 0x00 , 0x00 }; // Version = Old Clients
@@ -137,7 +138,7 @@ int __stdcall csv3_connect(SOCKET s, sockaddr_in* name, int len)
137138 char buffer[16 ];
138139 if (ServerNameMemoryAddress != 0 ) {
139140 // Input Servername
140- WriteProcessMemory (GetCurrentProcess (), (LPVOID )ServerNameMemoryAddress, ServerName, sizeof (buffer), NULL );
141+ WriteProcessMemory (GetCurrentProcess (), (void * )ServerNameMemoryAddress, ServerName, sizeof (buffer), 0 );
141142 }
142143 // END Servername Changer
143144
@@ -222,7 +223,7 @@ void csv3_init(HMODULE hModule)
222223 break ;
223224 }
224225 }
225- strcat (szConfig, " OpenConquerHook .ini" );
226+ strcat (szConfig, " CLHook .ini" );
226227
227228 // Find the correct version of client based in user config
228229 char szVersionValue[5 ];
@@ -233,6 +234,12 @@ void csv3_init(HMODULE hModule)
233234 GetPrivateProfileStringA (HeaderConfig, " SERVERNAME" , " ConquerOnline" , ServerName, 16 , szConfig);
234235 ServerNameMemoryAddress = GetPrivateProfileIntA (HeaderConfig, " SERVERNAME_MEMORYADDRESS" , 0 , szConfig);
235236
237+ // Fix Flash for old clients
238+ if (ClientVersion <= 6000 ) {
239+ CFlashFix flash;
240+ flash.Hook ();
241+ }
242+
236243 if (ClientVersion >= 5600 ) {
237244 //
238245 // hook packet processor
@@ -247,9 +254,8 @@ void csv3_init(HMODULE hModule)
247254 if (ClientVersion >= 6000 ) {
248255 match = (PBYTE)FindMemoryPattern (pattern_60XX, wildcards, 19 );
249256 }
250- if (ClientVersion >= 6600 ) {
251- match = (PBYTE)FindMemoryPattern (pattern_66XX, wildcards, 19 );
252-
257+ if (ClientVersion >= 6617 ) {
258+ match = (PBYTE)FindMemoryPattern (pattern_6617, wildcards, 19 );
253259 }
254260
255261 if (match == NULL )
@@ -275,8 +281,8 @@ void csv3_init(HMODULE hModule)
275281 if (ClientVersion >= 6000 ) {
276282 match = (PBYTE)FindMemoryPattern (pattern2_60XX, wildcards2, 15 );
277283 }
278- if (ClientVersion >= 6600 ) {
279- match = (PBYTE)FindMemoryPattern (pattern2_66XX , wildcards2, 15 );
284+ if (ClientVersion >= 6617 ) {
285+ match = (PBYTE)FindMemoryPattern (pattern2_6617 , wildcards2, 15 );
280286 }
281287
282288 if (match == NULL )
0 commit comments