public static void Exec(string szCmd) { if (_address == IntPtr.Zero) { var allocator = new Memory.Allocator(); _address = allocator.Alloc(Size); if (_address == IntPtr.Zero) { return; } } if (szCmd.Length > 255) { szCmd = szCmd.Substring(0, 255); } var szCmdBytes = Encoding.UTF8.GetBytes(szCmd + "\0"); Memory.WriteProcessMemory(Memory.pHandle, _address, szCmdBytes, szCmdBytes.Length, 0); var remoteThread = WinAPI.CreateRemoteThread(Memory.pHandle, (IntPtr)null, IntPtr.Zero, new IntPtr(Memory.Engine + CalcedOffsets.ClientCMD), _address, 0, (IntPtr)null); WinAPI.CloseHandle(remoteThread); WinAPI.WaitForSingleObject(remoteThread, 0xFFFFFFFF); }
public static void Set(string tag) { if (Address == IntPtr.Zero) { var alloc = new Memory.Allocator(); Address = alloc.Alloc(Size); alloc.Free(); if (Address == IntPtr.Zero) { return; } Buffer.BlockCopy(BitConverter.GetBytes((int)(Address + 18)), 0, Shellcode, 1, 4); Buffer.BlockCopy(BitConverter.GetBytes((int)(Address + 18)), 0, Shellcode, 6, 4); Buffer.BlockCopy(BitConverter.GetBytes(Memory.Engine + Signatures.dwSetClanTag), 0, Shellcode, 11, 4); } if (!Engine.InGame) { return; } var tag_bytes = Encoding.UTF8.GetBytes(tag + "\0"); var reset = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; Buffer.BlockCopy(reset, 0, Shellcode, 18, reset.Length); Buffer.BlockCopy(tag_bytes, 0, Shellcode, 18, tag.Length > 15 ? 15 : tag.Length); WinAPI.CreateThread(Address, Shellcode); }