mirror of
https://github.com/araxiaonline/WoW-Launcher.git
synced 2026-06-13 01:22:21 -04:00
Re-introduce init pattern for now...
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
using static Arctium.WoW.Launcher.Misc.Helpers;
|
||||
using System.CommandLine.Parsing;
|
||||
using System.Reflection.PortableExecutable;
|
||||
|
||||
namespace Arctium.WoW.Launcher;
|
||||
|
||||
@@ -145,24 +144,24 @@ class Launcher
|
||||
|
||||
NativeWindows.NtResumeProcess(processInfo.ProcessHandle);
|
||||
|
||||
// Wait for client initialization.
|
||||
var initOffset = memory?.Read(mbi.BaseAddress, (int)mbi.RegionSize)?.FindPattern(Patterns.Windows.Init) ?? 0;
|
||||
|
||||
while (initOffset == 0)
|
||||
{
|
||||
initOffset = memory?.Read(mbi.BaseAddress, (int)mbi.RegionSize)?.FindPattern(Patterns.Windows.Init) ?? 0;
|
||||
|
||||
Console.WriteLine("Waiting for client initialization...");
|
||||
}
|
||||
|
||||
initOffset += BitConverter.ToUInt32(memory.Read(initOffset + memory.BaseAddress + 2, 4), 0) + 10;
|
||||
|
||||
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);
|
||||
|
||||
var patches = new Dictionary<string, (long Address, byte[] Data)>();
|
||||
|
||||
// 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 = (byte)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);
|
||||
|
||||
PrepareAntiCrash(memory, patches, ref mbi, ref processInfo);
|
||||
|
||||
memory.RefreshMemoryData((int)mbi.RegionSize);
|
||||
|
||||
@@ -6,6 +6,8 @@ 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.
|
||||
public static short[] Integrity = { 0x44, 0x89, -1, 0x24, -1, 0x44, 0x89, -1, 0x24, -1, 0x89, -1, 0x24, -1, 0x48, 0x89, -1, 0x24, -1, 0x53, 0x56, 0x57 };
|
||||
public static short[] Integrity2 = { 0x44, 0x89, -1, 0x24, -1, 0x44, 0x89, -1, 0x24, -1, 0x89, -1, 0x24, -1, 0x48, 0x89, -1, 0x24, -1, 0x53, 0x57 };
|
||||
|
||||
Reference in New Issue
Block a user