Final commit.

This commit is contained in:
Fabian
2023-09-30 02:40:27 +02:00
parent 4ceab93e1d
commit 3deaa3f50b
8 changed files with 84 additions and 166 deletions

View File

@@ -7,36 +7,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arctium.WoW.Launcher", "src
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
ReleaseCustomFiles|ARM64 = ReleaseCustomFiles|ARM64
ReleaseCustomFiles|x64 = ReleaseCustomFiles|x64
ReleaseCustomFilesSilentMode|ARM64 = ReleaseCustomFilesSilentMode|ARM64
ReleaseCustomFilesSilentMode|x64 = ReleaseCustomFilesSilentMode|x64
ReleaseSilentMode|ARM64 = ReleaseSilentMode|ARM64
ReleaseSilentMode|x64 = ReleaseSilentMode|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Debug|ARM64.ActiveCfg = Debug|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Debug|ARM64.Build.0 = Debug|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Debug|x64.ActiveCfg = Debug|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Debug|x64.Build.0 = Debug|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Release|ARM64.ActiveCfg = Release|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Release|ARM64.Build.0 = Release|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Release|x64.ActiveCfg = Release|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.Release|x64.Build.0 = Release|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFiles|ARM64.ActiveCfg = ReleaseCustomFiles|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFiles|ARM64.Build.0 = ReleaseCustomFiles|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFiles|x64.ActiveCfg = ReleaseCustomFiles|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFiles|x64.Build.0 = ReleaseCustomFiles|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFilesSilentMode|ARM64.ActiveCfg = ReleaseCustomFilesSilentMode|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFilesSilentMode|ARM64.Build.0 = ReleaseCustomFilesSilentMode|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFilesSilentMode|x64.ActiveCfg = ReleaseCustomFilesSilentMode|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseCustomFilesSilentMode|x64.Build.0 = ReleaseCustomFilesSilentMode|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseSilentMode|ARM64.ActiveCfg = ReleaseSilentMode|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseSilentMode|ARM64.Build.0 = ReleaseSilentMode|ARM64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseSilentMode|x64.ActiveCfg = ReleaseSilentMode|x64
{661B173A-D445-4706-9FF2-C0408ED62FA2}.ReleaseSilentMode|x64.Build.0 = ReleaseSilentMode|x64
EndGlobalSection

View File

@@ -1,91 +1,17 @@
# WoW-Launcher
A game launcher for World of Warcraft that allows you to connect to custom servers.
# THE FUTURE OF THIS LAUNCHER
[![Support](https://img.shields.io/badge/discord-join-7289DA.svg)](https://arctium.io/discord)
As of today (2023-09-30) this project goes closed source and is not longer be MIT licensed.
### License, Copyright & Contributions
This does not affect the license of already published sources.
Please see our Open Source project [Documentation Repo](https://github.com/Arctium/Documentation)
### This launcher is going to be closed source in future.
### IMPORTANT NOTE FOR LOCAL DEVELOPMENT & SERVER CONNECTIONS
#### Applies to: 1.14.4 or later, 3.4.2 or later, 10.1.5 or later
* **Dev Mode is enabled by default for local game portals.**
* LOCAL HOSTNAME & IP: `USE` the `--dev` command line parameter to force the dev mode to avoid issues with invalid certificate chains.
* EXTERNAL HOSTNAME:
* `DO NOT` use the `--dev` command line parameter.
* `USE` a valid certificate matching your authentication/bnet server host name.
* That certificate needs to be loaded by the authentication/bnet server too.
* EXTERNAL IP: `NOT SUPPORTED`
What does this mean?
### Binary Releases
You can find signed binary releases at [Releases](https://github.com/Arctium/WoW-Launcher/releases)
- **No new MIT licensed binary releases.**
- **No new features, game support updates or OS updates on this repo.**
- **Current source with the listed supported game versions and supported systems stays public as it is.**
- **Future releases with updates for new game versions, operating systems, ... will be available at the same link (https://arctium.io/wow)**
### Supported Game Versions (Windows x86 64 bit, Release)
* Dragonflight: 10.x
* Shadowlands: 9.x
* Classic BC/WotLK: 2.5.x, 3.4.x (--version Classic)
* Classic Era: 1.14.x (--version ClassicEra)
### Supported Game Versions (Windows ARM 64 bit, Release)
* Retail: Coming Soon
* Classic: Coming Soon
* Classic Era: Coming Soon
## Building
### Build Prerequisites
* [.NET Core SDK 7.0.0 or later](https://dotnet.microsoft.com/download/dotnet/7.0)
* Optional for native builds: C++ workload through Visual Studio 2022 or latest C++ build tools
### Build Instructions Windows (native)
* Available runtime identifiers/platforms: win-x64/x64, win-arm64/ARM64
* Available release configurations: Release, ReleaseSilentMode, ReleaseCustomFiles, ReleaseCustomFilesSilentMode
* Execute `dotnet publish -r RuntimeIdentifier -c Configuration -p:platform="Platform"`
* Native output is placed in `build\Configuration\bin\native`
## Usage
### Windows Usage
1. Copy `Actium WoW Launcher.exe` to your World of Warcraft folder.
2. Optional: Edit the `WTF/Config.wtf` to set your portal or use a different config file with the `-config Config2.wtf` launch arg.
3. Run the `Actium WoW Launcher.exe`
### Static Auth Seed Usage
* Use the --staticseed launch parameter
* On server side add `179D3DC3235629D07113A9B3867F97A7` as auth seed in the database.
### Custom File Loading Usage
1. Get or create your own file mapping (.txt) file(s) and place it in the `mappings` folder.
File Format: `fileId;filePath`
2. Place your custom files (mods) in the `files` folder. Be sure to follow the correct folder structure.
### File mapping sources
* https://github.com/wowdev/wow-listfile
### Launch Parameters (--help)
```
Usage:
"Arctium WoW Launcher.exe" [options] [[--] <additional arguments>...]]
Options:
--version <Classic|ClassicEra|Retail> [default: Retail]
--path <path>
--binary <binary>
--keepcache [default: True]
--staticseed
--dev [default: False], Required for local development without valid certificates.
-?, -h, --help Show help and usage information
Additional Arguments:
Arguments passed to the application that is being run.
```
## WARNING
DO NOT USE THIS AS BASE FOR ANY OFFICIAL SERVER TOOLS.
IT WILL GET YOU BANNED THERE!!!
## Special Request <3
Please do NOT remove the name `arctium` from the final binary.
Blizzard filters their crash logs based on localhost and the string `arctium` in the binary name.
#### Old README
Most recent README available here: [README](README_OLD.md)

70
README_OLD.md Normal file
View File

@@ -0,0 +1,70 @@
# WoW-Launcher
A game launcher for World of Warcraft that allows you to connect to custom servers.
### License, Copyright & Contributions
Please see our Open Source project [Documentation Repo](https://github.com/Arctium/Documentation)
## Special Request <3
Please do NOT remove the name `arctium` from the final binary.
Blizzard filters their crash logs based on localhost and the string `arctium` in the binary name.
### NOTE FOR LOCAL DEVELOPMENT & SERVER CONNECTIONS
#### Applies to: 1.14.4 or later, 3.4.2 or later, 10.1.5 or later
* **Dev Mode is enabled by default for local game portals.**
* LOCAL HOSTNAME & IP: `REQUIRES` the `--dev` command line parameter to force the dev mode to avoid issues with invalid certificate chains. The launcher auto detectes local addresses and enables it.
* EXTERNAL HOSTNAME:
* `DO NOT` use the `--dev` command line parameter. It's blocked by the launcher.
* `USE` a valid certificate matching your authentication/bnet server host name.
* That certificate needs to be loaded by the authentication/bnet server too.
* EXTERNAL IP: `NOT SUPPORTED`
### Binary Releases
You can find signed binary releases at [Releases](https://github.com/Arctium/WoW-Launcher/releases)
### Supported Game Versions (Windows x86 64 bit, Release)
* Dragonflight: 10.x
* Shadowlands: 9.x
* Classic BC/WotLK: 2.5.x, 3.4.x (--version Classic)
* Classic Era: 1.14.x (--version ClassicEra)
## Building
### Build Prerequisites
* [.NET Core SDK 7.0.0 or later](https://dotnet.microsoft.com/download/dotnet/7.0)
* Optional for native builds: C++ workload through Visual Studio 2022 or latest C++ build tools
### Build Instructions Windows (native)
* Available runtime identifiers/platforms: win-x64/x64, win-arm64/ARM64
* Available release configurations: Release, ReleaseSilentMode, ReleaseCustomFiles, ReleaseCustomFilesSilentMode
* Execute `dotnet publish -r RuntimeIdentifier -c Configuration -p:platform="Platform"`
* Native output is placed in `build\Configuration\bin\native`
## Usage
### Windows Usage
1. Copy `Actium WoW Launcher.exe` to your World of Warcraft folder.
2. Optional: Edit the `WTF/Config.wtf` to set your portal or use a different config file with the `-config Config2.wtf` launch arg.
3. Run the `Actium WoW Launcher.exe`
### Static Auth Seed Usage
* Use the --staticseed launch parameter
* On server side add `179D3DC3235629D07113A9B3867F97A7` as auth seed in the database.
### Custom File Loading Usage
1. Get or create your own file mapping (.txt) file(s) and place it in the `mappings` folder.
File Format: `fileId;filePath`
2. Place your custom files (mods) in the `files` folder. Be sure to follow the correct folder structure.
### File mapping sources
* https://github.com/wowdev/wow-listfile
### Launch Parameters
Use `--help`
## WARNING
DO NOT USE THIS AS BASE FOR ANY OFFICIAL SERVER TOOLS.
IT WILL GET YOU BANNED THERE!!!

View File

@@ -4,7 +4,7 @@
<AssemblyName>Arctium WoW Launcher</AssemblyName>
<ApplicationIcon>logo.ico</ApplicationIcon>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>False</AppendRuntimeIdentifierToOutputPath>
@@ -13,7 +13,8 @@
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<FileVersion>10.0.0.0</FileVersion>
<Copyright>Arctium</Copyright>
<Platforms>x64;ARM64</Platforms>
<Platforms>x64</Platforms>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ImplicitUsings>enable</ImplicitUsings>
<DefineConstants>$(DefineConstants);$(Platform)</DefineConstants>
<Configurations>Debug;Release;ReleaseSilentMode;ReleaseCustomFiles;ReleaseCustomFilesSilentMode</Configurations>
@@ -34,14 +35,6 @@
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x64'">
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants);$(Platform);CUSTOM_FILES</DefineConstants>
<Optimize>False</Optimize>
@@ -72,7 +65,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="7.*" />
<PackageReference Include="System.CommandLine" Version="2.0.0-*" />
</ItemGroup>
</Project>

View File

@@ -19,15 +19,9 @@ static class Launcher
var gameVersion = commandLineResult.GetValueForOption(LaunchOptions.Version);
var (subFolder, binaryName, majorGameVersion, minGameBuild) = gameVersion switch
{
#if x64
GameVersion.Retail => ("_retail_", "Wow.exe", new[] { 9, 10 }, 37862),
GameVersion.Classic => ("_classic_", "WowClassic.exe", new[] { 2, 3 }, 39926),
GameVersion.ClassicEra => ("_classic_era_", "WowClassic.exe", new[] { 1 }, 40347),
#elif ARM64
GameVersion.Retail => ("_retail_", "Wow-ARM64.exe", new[] { 9, 10 }, 37862),
GameVersion.Classic => ("_classic_", "WowClassic-arm64.exe", new[] { 2, 3 }, 39926),
GameVersion.ClassicEra => ("_classic_era_", "WowClassic-arm64.exe", new[] { 1 }, 40347),
#endif
_ => throw new NotImplementedException("Invalid game version specified."),
};
@@ -286,7 +280,6 @@ static class Launcher
WaitForUnpack(ref processInfo, memory, ref mbi, gameAppData, antiCrash);
#if x64
if (!commandLineResult.GetValueForOption(LaunchOptions.SkipConnectionPatching))
{
if (legacyCertMode)
@@ -342,14 +335,6 @@ static class Launcher
}
#endif
#elif ARM64
Task.WaitAll(new[]
{
memory.QueuePatch(Patterns.Windows.CertBundle, Patches.Windows.Branch, "CertBundle", 19),
memory.QueuePatch(Patterns.Windows.CertCommonName, Patches.Windows.CertCommonName, "CertCommonName", 6),
}, CancellationTokenSource.Token);
#endif
NativeWindows.NtResumeProcess(processInfo.ProcessHandle);
if (memory.RemapAndPatch(antiCrash))
@@ -399,7 +384,6 @@ static class Launcher
static long GenerateAuthSeedFunctionPatch(WinMemory memory, long modulusOffset)
{
#if x64
var authSeedLoadOffset = memory.Data.FindPattern(Patterns.Windows.AuthSeed);
if (authSeedLoadOffset == 0)
@@ -416,14 +400,10 @@ static class Launcher
Unsafe.WriteUnaligned(ref Patches.Windows.AuthSeed[3], (uint)(modulusOffset - authSeedFunctionOffset - 7));
return authSeedFunctionOffset;
#else
throw new NotImplementedException();
#endif
}
static void WaitForUnpack(ref ProcessInformation processInfo, WinMemory memory, ref MemoryBasicInformation mbi, Stream gameAppData, bool antiCrash)
{
#if x64
// Wait for client initialization.
var initOffset = memory.Read(mbi.BaseAddress, (int)mbi.RegionSize)?.FindPattern(Patterns.Windows.Init) ?? 0;
@@ -439,23 +419,7 @@ static class Launcher
while (memory.Read(initOffset + memory.BaseAddress, 1)?[0] == null ||
memory.Read(initOffset + memory.BaseAddress, 1)?[0] == 0)
memory.Data = memory.Read(mbi.BaseAddress, (int)mbi.RegionSize);
#else
// Get PE header info for client initialization.
var peHeaders = new PEHeaders(gameAppData);
SectionHeader textSectionHeader = peHeaders.SectionHeaders.Single(sectionHeader => sectionHeader.Name.ToLower() == ".text");
gameAppData.Position = textSectionHeader.VirtualSize + textSectionHeader.PointerToRawData;
var textSectionEndValue = gameAppData.ReadByte();
Console.WriteLine("Waiting for client initialization...");
var virtualTextSectionEnd = memory.BaseAddress + textSectionHeader.VirtualAddress + textSectionHeader.VirtualSize;
while (memory?.Read(virtualTextSectionEnd, 1)?[0] == null || memory?.Read(virtualTextSectionEnd, 1)?[0] == textSectionEndValue)
Thread.Sleep(100);
#endif
if (antiCrash)
PrepareAntiCrash(memory, ref mbi, ref processInfo);

View File

@@ -3,7 +3,6 @@
namespace Arctium.WoW.Launcher;
#if x64
class ModLoader
{
static readonly HashSet<uint> _loadedFileIds = new();
@@ -188,4 +187,3 @@ class ModLoader
return (idAlloc, stringAlloc);
}
}
#endif

View File

@@ -5,7 +5,6 @@ namespace Arctium.WoW.Launcher.Patches;
static class Windows
{
#if x64
public static byte[] Integrity = { 0xC2, 0x00, 0x00 };
public static byte[] CertBundle = { 0x90, 0x90 };
public static byte[] CertCommonName = { 0xB0, 0x01 };
@@ -13,11 +12,6 @@ static class Windows
public static byte[] ShortJump = { 0xEB };
public static byte[] NoJump = { 0x00, 0x00, 0x00, 0x00 };
public static byte[] AuthSeed = { 0x0F, 0x28, 0x05, 0xEF, 0xBE, 0xAD, 0xDE, 0x0F, 0x11, 0x02, 0xC3 };
#elif ARM64
public static byte[] Integrity = { };
public static byte[] Branch = { 0xB5 };
public static byte[] CertCommonName = { 0x20 };
#endif
// Registry entry used for -launcherlogin.
public static byte[] LauncherLogin = Encoding.UTF8.GetBytes(@"Software\Custom Game Server Dev\Battle.net\Launch Options\");

View File

@@ -5,7 +5,6 @@ namespace Arctium.WoW.Launcher.Patterns;
static class Windows
{
#if x64
public static short[] Init = { 0xC7, 0x05, -1, -1, -1, -1, 0x01, 0x00, 0x00, 0x00, 0x48, 0x8D, -1, -1, -1, -1, -1, 0x48, 0x8D, -1, -1, -1, -1, -1, 0xE8, -1, -1, -1, -1, 0x85 };
// Anti Crash.
@@ -29,16 +28,6 @@ static class Windows
public static short[] LoadByFilePath = { 0x01, 0x0F, 0x84, -1, -1, -1, -1, 0x48, 0x8B, -1, -1, -1, -1, -1, 0x44, 0x89, -1, -1, -1, 0x48, 0x85, 0xC9 };
public static short[] LoadByFilePathAlternate = { 0x01, 0x0F, 0x84, -1, -1, -1, -1, 0x48, 0x8B, -1, -1, -1, -1, -1, 0x44, 0x89, -1, -1, -1, 0x00, 0x00, 0x00, 0x48, 0x85, 0xC9 };
public static short[] CustomFileIdHook = { 0x48, 0x89, 0x5C, 0x24, 0x08, 0x57, 0x48, 0x83, 0xEC, 0x20, 0x48, 0x8B, -1, 0x48, -1, -1, 0x48, -1, -1, -1, -1, -1, -1, 0xE8, -1, -1, -1, -1, 0x48, -1, -1, -1, -1, -1, -1, 0x48, -1, -1, 0x74, -1, 0x48, -1, 0xCD };
#elif ARM64
// Anti Crash.
public static short[] Integrity = { };
public static short[] Integrity2 = { };
public static short[] Remap = { };
// Certificate bundle loading.
public static short[] CertBundle = { 0xA0, 0xA0, -1, -1, 0x80, 0x02, -1, -1, -1, -1, -1, 0x97 };
public static short[] CertCommonName = { 0x00, -1, -1, -1, 0xFF, 0x54, 0x00, 0x00, 0x80, 0x52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0xC0, 0x03, -1, -1, -1, -1, -1, 0xEB };
#endif
// Registry entry used for -launcherlogin.
public static short[] LauncherLogin = @"Software\Blizzard Entertainment\Battle.net\Launch Options\".ToPattern();