public void UsePower(uint actorPtr, uint acdPtr, D3PowerInfo power) { uint flagAddress = GetAddress("UsePower_Flag"); d3.WriteObject(GetAddress("UsePower_PowerInfo"), power, typeof(D3PowerInfo)); d3.WriteUInt(GetAddress("UsePower_ActorPtr"), actorPtr); d3.WriteUInt(GetAddress("UsePower_AcdPtr"), acdPtr); d3.WriteInt(flagAddress, 1); while (d3.ReadInt(flagAddress) == 1) { Thread.Sleep(1); } }
public void SetMouseCoordFlag() { //spour la mouse vite fais avec cheat engine fo enleve et le remettre Memory.WriteInt(TrucVert1, 64); Thread.Sleep(20); Memory.WriteInt(TrucVert2, 438906840); //spour le graph , retrouver avec ida grace a SetChatWindowName Thread.Sleep(20); Memory.WriteByte(0x049C8B3, 0); //Memory.WriteInt(0x0049c743, 0); MxBots.Hook.cliked += new MxBots.Hook.MouseTransfertEvent(getcoordmousse); }
/// <summary> Write the coordinates and action to the memory. </summary> <param /// name="pos">Vector3 containing the X,y & Z coordinates</param> <param name="action">CTM /// Interaction to perform</param> private static void WriteXYZToMemory(Vector3 pos, InteractionType action) { const float distance = 1.5f; AmeisenLogger.Instance.Log(LogLevel.VERBOSE, $"Writing: X [{pos.X},{pos.Y},{pos.Z}] Action [{action}] Distance [{distance}]", "AmeisenCore"); BlackMagic.WriteFloat(Offsets.ctmX, (float)pos.X); BlackMagic.WriteFloat(Offsets.ctmY, (float)pos.Y); BlackMagic.WriteFloat(Offsets.ctmZ, (float)pos.Z); BlackMagic.WriteInt(Offsets.ctmAction, (int)action); BlackMagic.WriteFloat(Offsets.ctmDistance, distance); }
static void Main(string[] args) { BlackMagic wow = new BlackMagic(); Console.WriteLine("Let the window remain open as long as you dont want to be flagged as AFK"); while (true) { Process[] p = Process.GetProcessesByName("WoW"); foreach (Process x in p) { wow.OpenProcessAndThread(x.Id); string version = wow.ReadASCIIString(0x00837C04, 6); if (version == "1.12.1") { wow.WriteInt(0x00CF0BC8, Environment.TickCount); } } System.Threading.Thread.Sleep(10000); } }
public void Hooking() { // Process Connect: if (!Memory.IsProcessOpen) { Memory.OpenProcessAndThread(processId); } if (Memory.IsProcessOpen) { txtDebug.Text += "VirtualAlloc Hook: " + vaHookPtr.ToString("X") + " | " + Memory.ReadByte(vaHookPtr).ToString("X") + "\r\n"; if (Memory.ReadByte(vaHookPtr) == 0xE9 && (injected_code == 0 || eaxStore == 0)) // check if wow is already hooked and dispose Hook { DisposeHooking(); } if (Memory.ReadByte(vaHookPtr) != 0xE9) // check if wow is already hooked { try { threadHooked = false; // allocate memory to store injected code: (Das ist die codecave wohin die Endscene umgeleitet wird) injected_code = Memory.AllocateMemory(2048); txtDebug.Text += "injected_code: " + injected_code.ToString("X") + "\r\n"; // die Adresse in welche EAX hingespeichert wird eaxStore = Memory.AllocateMemory(0x4); txtDebug.Text += "eaxStore: " + eaxStore.ToString("X") + "\r\n"; // allocate memory the pointer return value: retnInjectionAsm = Memory.AllocateMemory(0x4); txtDebug.Text += "retnInjectionAsm: " + retnInjectionAsm.ToString("X") + "\r\n"; Memory.WriteInt(retnInjectionAsm, 0); // Generate the STUB to be injected Memory.Asm.Clear(); // $Asm // save regs //Memory.Asm.AddLine("pushad"); //Memory.Asm.AddLine("pushfd"); Memory.Asm.AddLine("mov [" + eaxStore + "],eax"); // Size asm jumpback int sizeJumpBack = 5; Memory.Asm.AddLine("jmp " + (vaHookPtr + sizeJumpBack)); // inject code in codecave uint sizeAsm = (uint)(Memory.Asm.Assemble().Length); Memory.Asm.Inject(injected_code); txtDebug.Text += "Injecting ...\r\n"; // create hook jump Memory.Asm.Clear(); // $jmpto Memory.Asm.AddLine("jmp " + (injected_code)); Memory.Asm.AddLine("retn 10h"); Memory.Asm.Inject(vaHookPtr); } catch { threadHooked = false; return; } } threadHooked = true; } }
public void SetLoot() { wow.WriteInt(wow.ReadUInt(playerbase + 0xD8) + 0x1020, 1); }
private void HookApplication() { if (!process.IsProcessOpen) { throw new Exception("Process is not open"); } uint baseAddress = (uint)process.MainModule.BaseAddress; uint pDevice = process.ReadUInt(baseAddress + Offsets.Direct3D.Direct3D9__Device); uint pEnd = process.ReadUInt(pDevice + Offsets.Direct3D.Direct3D9__Device__OffsetA); uint pScene = process.ReadUInt(pEnd); uint pEndScene = process.ReadUInt(pScene + Offsets.Direct3D.Direct3D9__Device__OffsetB); if (process.ReadUInt(pEndScene) == 0xE9 && (codeCave == 0 || injectionAddress == 0)) { DisposeOfHook(); } if (process.ReadUInt(pEndScene) != 0xE9) { try { mainThreadHooked = false; codeCave = process.AllocateMemory(2048); injectionAddress = process.AllocateMemory(0x4); process.WriteInt(injectionAddress, 0); returnAddress = process.AllocateMemory(0x4); process.WriteInt(returnAddress, 0); process.Asm.Clear(); process.Asm.AddLine("mov edi, edi"); process.Asm.AddLine("push ebp"); process.Asm.AddLine("mov ebp, esp"); process.Asm.AddLine("pushfd"); process.Asm.AddLine("pushad"); process.Asm.AddLine("mov eax, [" + injectionAddress + "]"); process.Asm.AddLine("test eax, eax"); process.Asm.AddLine("je @out"); process.Asm.AddLine("mov eax, [" + injectionAddress + "]"); process.Asm.AddLine("call eax"); process.Asm.AddLine("mov [" + returnAddress + "], eax"); process.Asm.AddLine("mov edx, " + injectionAddress); process.Asm.AddLine("mov ecx, 0"); process.Asm.AddLine("mov [edx], ecx"); process.Asm.AddLine("@out:"); uint sizeAsm = (uint)(process.Asm.Assemble().Length); process.Asm.Inject(codeCave); int sizeJumpBack = 5; process.Asm.Clear(); process.Asm.AddLine("jmp " + (pEndScene + sizeJumpBack)); process.Asm.Inject(codeCave + sizeAsm); // + (uint)sizeJumpBack); process.Asm.Clear(); // $jmpto process.Asm.AddLine("jmp " + (codeCave)); process.Asm.Inject(pEndScene); } catch { mainThreadHooked = false; return; } mainThreadHooked = true; } }
public void Hooking() { // Offset: uint DX_DEVICE = 0xAD773C + baseAdress; uint DX_DEVICE_IDX = 0x27F8; uint ENDSCENE_IDX = 0xA8; // Process Connect: if (!Memory.IsProcessOpen) { Memory = new BlackMagic((int)_processId); } if (Memory.IsProcessOpen) { // Get address of EndScene uint pDevice = Memory.ReadUInt(DX_DEVICE); uint pEnd = Memory.ReadUInt(pDevice + DX_DEVICE_IDX); uint pScene = Memory.ReadUInt(pEnd); uint pEndScene = Memory.ReadUInt(pScene + ENDSCENE_IDX); if (Memory.ReadByte(pEndScene) == 0xE9 && (injected_code == 0 || addresseInjection == 0)) // check if wow is already hooked and dispose Hook { DisposeHooking(); } if (Memory.ReadByte(pEndScene) != 0xE9) // check if wow is already hooked { try { threadHooked = false; // allocate memory to store injected code: injected_code = Memory.AllocateMemory(2048); // allocate memory the new injection code pointer: addresseInjection = Memory.AllocateMemory(0x4); Memory.WriteInt(addresseInjection, 0); // allocate memory the pointer return value: retnInjectionAsm = Memory.AllocateMemory(0x4); Memory.WriteInt(retnInjectionAsm, 0); Memory.Asm.Clear(); Memory.Asm.AddLine("mov edi, edi"); Memory.Asm.AddLine("push ebp"); Memory.Asm.AddLine("mov ebp, esp"); Memory.Asm.AddLine("pushfd"); Memory.Asm.AddLine("pushad"); //Test for waiting code Memory.Asm.AddLine("mov eax, [" + addresseInjection + "]"); Memory.Asm.AddLine("test eax, ebx"); Memory.Asm.AddLine("je @out"); //Execute waiting code Memory.Asm.AddLine("mov eax, [" + addresseInjection + "]"); Memory.Asm.AddLine("call eax"); //Copy pointer to return value Memory.Asm.AddLine("mov [" + retnInjectionAsm + "], eax"); Memory.Asm.AddLine("mov edx, " + addresseInjection); Memory.Asm.AddLine("mov ecx, 0"); Memory.Asm.AddLine("mov [edx], ecx"); //Close Function Memory.Asm.AddLine("@out:"); //Inject Code uint sizeAsm = (uint)(Memory.Asm.Assemble().Length); Memory.Asm.Inject(injected_code); int sizeJumpBack = 5; // create jump back stub Memory.Asm.Clear(); Memory.Asm.AddLine("jmp " + (pEndScene + sizeJumpBack)); Memory.Asm.Inject(injected_code + sizeAsm);// + (uint)sizeJumpBack); // create hook jump Memory.Asm.Clear(); // $jmpto Memory.Asm.AddLine("jmp " + (injected_code)); Memory.Asm.Inject(pEndScene); } catch { threadHooked = false; return; } } threadHooked = true; } }
/// <summary> /// AntiAFK /// </summary> public static void AntiAFK() { BlackMagic.WriteInt(Offsets.tickCount, Environment.TickCount); }