Skip to content

Commit 12911cd

Browse files
Loader updated for working fine. New options added in settings
1 parent 75dbb5b commit 12911cd

13 files changed

Lines changed: 1603 additions & 101 deletions

File tree

ConquerHook/CSV3Hook.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ BYTE pattern_OLD[] = { 0x85, 0xC0, 0x75, 0x00, 0x8B, 0x4E, 0x00, 0xE8, 0x00, 0x0
4747
BYTE pattern2_OLD[] = { 0x85, 0xC9, 0x00, 0x00, 0xFF, 0x75, 0x00, 0x57, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x89, 0x45 }; // Version = Old Clients
4848
BYTE pattern_56XX[] = { 0x85, 0xC0, 0x75, 0x00, 0x8B, 0x4F, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x83, 0x4D, 0x00, 0x00, 0x8B, 0x00, 0x00 }; // Version = 56XX
4949
BYTE pattern2_56XX[] = { 0x85, 0xC9, 0x00, 0x00, 0xFF, 0x75, 0x00, 0x57, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x89, 0x45 }; // Version = 56XX
50+
//BYTE pattern_55XX[] = { 0x85, 0xC0, 0x74, 0x0E, 0x8B, 0x45, 0x20, 0xC7, 0x00, 0x01, 0x00, 0x00, 0x00, 0xE9, 0xA2, 0x00, 0x00, 0x00, 0x00 }; // Version = 55XX
51+
//BYTE pattern2_55XX[] = { 0x85, 0xC9, 0x00, 0x00, 0xFF, 0x75, 0x00, 0x57, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x89, 0x45 }; // Version = 55XX
5052

5153
extern LPVOID FindMemoryPattern(PBYTE pattern, bool* wildCards, int len);
5254

@@ -209,8 +211,11 @@ void csv3_init(HMODULE hModule)
209211
}
210212
}
211213
strcat(szConfig, "OpenConquerHook.ini");
214+
212215
// Find the correct version of client based in user config
213-
ClientVersion = GetPrivateProfileIntA(HeaderConfig, "SERVER_VERSION", 0, szConfig);
216+
char szVersionValue[5];
217+
GetPrivateProfileStringA(HeaderConfig, "SERVER_VERSION", "0", szVersionValue, 5, szConfig);
218+
ClientVersion = atoi(szVersionValue);
214219

215220
if (ClientVersion >= 5600) {
216221
//
@@ -231,8 +236,7 @@ void csv3_init(HMODULE hModule)
231236

232237
if (match == NULL)
233238
{
234-
//sprintf(szDebug, "Failed to find correct pattern1", (DWORD)match);
235-
sprintf(szDebug, HeaderConfig, (DWORD)match);
239+
sprintf(szDebug, "Failed to find correct pattern1", (DWORD)match);
236240
MessageBoxA(NULL, szDebug, "ERROR", MB_OK);
237241
return;
238242
}

ConquerLoader/ConquerLoader/ConquerLoader.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
<PlatformTarget>AnyCPU</PlatformTarget>
2121
<DebugSymbols>true</DebugSymbols>
2222
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
23+
<Optimize>true</Optimize>
2424
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<DefineConstants>
26+
</DefineConstants>
2627
<ErrorReport>prompt</ErrorReport>
2728
<WarningLevel>4</WarningLevel>
2829
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -37,15 +38,19 @@
3738
<WarningLevel>4</WarningLevel>
3839
</PropertyGroup>
3940
<PropertyGroup>
40-
<ApplicationIcon>conquer.ico</ApplicationIcon>
41+
<ApplicationIcon>ConquerLoaderLogo.ico</ApplicationIcon>
4142
</PropertyGroup>
43+
<PropertyGroup />
4244
<PropertyGroup>
4345
<ApplicationManifest>app.manifest</ApplicationManifest>
4446
</PropertyGroup>
4547
<ItemGroup>
4648
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
4749
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
4850
</Reference>
51+
<Reference Include="INIFileParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL">
52+
<HintPath>..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll</HintPath>
53+
</Reference>
4954
<Reference Include="MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a, processorArchitecture=MSIL">
5055
<HintPath>..\packages\MetroModernUI.1.4.0.0\lib\net\MetroFramework.dll</HintPath>
5156
</Reference>
@@ -121,7 +126,7 @@
121126
<None Include="App.config" />
122127
</ItemGroup>
123128
<ItemGroup>
124-
<Content Include="conquer.ico" />
129+
<Content Include="ConquerLoaderLogo.ico" />
125130
</ItemGroup>
126131
<ItemGroup>
127132
<ProjectReference Include="..\CLCore\CLCore.csproj">
42.7 KB
Binary file not shown.

ConquerLoader/ConquerLoader/Main.Designer.cs

Lines changed: 18 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ConquerLoader/ConquerLoader/Main.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using ConquerLoader.CLCore;
22
using ConquerLoader.Models;
3+
using IniParser;
4+
using IniParser.Model;
35
using MetroFramework.Controls;
46
using System;
57
using System.Diagnostics;
@@ -29,8 +31,6 @@ public Main()
2931
/*
3032
* TODO LIST
3133
* Change servername on new clients with encrypted Server.dat (Maybe the best option is find the String of first Server in Server.dat (Decrypting it with the tool in the oc forum) in memory and remplace this with the custom string of LoaderConfig.SelectedServer.ServerName
32-
* Create a page with wordpress and storefront theme for anounce the ConquerLoader with the domain conquerloader.com (Simple page only for now, in future have complements for sell and implement in this loader)
33-
* Premium Features (Control with IP of servername in some AccessList, json or via Database) with the features are payed for the user (User = Server IP)
3434
* */
3535

3636
private void Main_Load(object sender, EventArgs e)
@@ -64,6 +64,7 @@ private void LoadConfigInForm()
6464
{
6565
cbxServers.Items.Add(server.ServerName);
6666
}
67+
RefreshServerList();
6768
}
6869

6970
private void RefreshServerList(bool CheckServerStatus = true)
@@ -125,6 +126,27 @@ private void BtnStart_Click(object sender, EventArgs e)
125126
+ Environment.NewLine + "SERVER_VERSION=" + SelectedServer.ServerVersion
126127
);
127128
Core.LogWritter.Write("Created the Hook Configuration");
129+
// Modify Setup of client
130+
string SetupIniPath = Path.Combine(Directory.GetCurrentDirectory(), "ini", "GameSetup.ini");
131+
var parser = new FileIniDataParser();
132+
IniData data = parser.ReadFile(SetupIniPath);
133+
if (LoaderConfig.HighResolution)
134+
{
135+
/*
136+
* ScreenModeRecord
137+
* 0 = 800x600, windowed
138+
1 = 800x600, full-screen
139+
2 = 1024x768, windowed
140+
3 = 1024x768, full-screen
141+
* */
142+
data["ScreenMode"]["ScreenModeRecord"] = LoaderConfig.FullScreen ? "3" : "2";
143+
parser.WriteFile(SetupIniPath, data);
144+
}
145+
if (LoaderConfig.FullScreen)
146+
{
147+
data["ScreenMode"]["FullScrType"] = LoaderConfig.FullScreen ? "1" : "0";
148+
parser.WriteFile(SetupIniPath, data);
149+
}
128150
worker.RunWorkerAsync();
129151
}
130152
}
@@ -145,6 +167,12 @@ private void Worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs
145167
Core.LogWritter.Write("Found Env_DX8 Folder. Setting the folder for run executable...");
146168
PathToConquerExe = CheckPathEnvDX8;
147169
WorkingDir = Path.GetDirectoryName(PathToConquerExe);
170+
string OutputCopyDll = Path.Combine(Application.StartupPath, "Env_DX8", HookINI);
171+
if (File.Exists(OutputCopyDll))
172+
{
173+
File.Delete(OutputCopyDll);
174+
}
175+
File.Copy(Path.Combine(Application.StartupPath, HookINI), OutputCopyDll);
148176
}
149177
if (SelectedServer.UseDirectX9)
150178
{
@@ -153,6 +181,12 @@ private void Worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs
153181
Core.LogWritter.Write("Found Env_DX9 Folder. Setting the folder for run executable...");
154182
PathToConquerExe = CheckPathEnvDX9;
155183
WorkingDir = Path.GetDirectoryName(PathToConquerExe);
184+
string OutputCopyDll = Path.Combine(Application.StartupPath, "Env_DX9", HookINI);
185+
if (File.Exists(OutputCopyDll))
186+
{
187+
File.Delete(OutputCopyDll);
188+
}
189+
File.Copy(Path.Combine(Application.StartupPath, HookINI), OutputCopyDll);
156190
}
157191
}
158192
Process conquerProc = Process.Start(new ProcessStartInfo() { FileName = PathToConquerExe, WorkingDirectory = WorkingDir, Arguments = "blacknull" });

0 commit comments

Comments
 (0)