static void Main(string[] args) { Process.EnterDebugMode(); Process[] wow = Process.GetProcessesByName("WoW"); IntPtr hProcess = OpenProcess(0x1F0FFF, false, (uint)wow[0].Id); //allocate memory for codecave uint dwBaseAddress = VirtualAllocEx(hProcess, 0, 0x1000, 0x1000, 0x40); Fasm.ManagedFasm fasm = new Fasm.ManagedFasm(hProcess); fasm.SetMemorySize(0x500); //fasm.AddLine("org " + dwBaseAddress.ToString("X")); //not necessary, .Inject does automatically fasm.AddLine("retn"); fasm.AddLine("jmp 0x410000"); fasm.AddLine("call 0x410000"); byte[] a = fasm.Assemble(); fasm.InjectAndExecute(hProcess, dwBaseAddress); fasm.Dispose(); VirtualFreeEx(hProcess, dwBaseAddress, 0, 0x8000); //release memory }
static void Main(string[] args) { Process.EnterDebugMode(); Process[] wow = Process.GetProcessesByName("WoW"); IntPtr hProcess = OpenProcess(0x1F0FFF, false, (uint)wow[0].Id); //allocate memory for codecave uint dwBaseAddress = VirtualAllocEx(hProcess, 0, 0x1000, 0x1000, 0x40); Fasm.ManagedFasm fasm = new Fasm.ManagedFasm(hProcess); fasm.SetMemorySize(0x500); //fasm.AddLine("org " + dwBaseAddress.ToString("X")); //not necessary, .Inject does automatically fasm.AddLine("retn"); fasm.AddLine("jmp 0x410000"); fasm.AddLine("call 0x410000"); byte[] a = fasm.Assemble(); fasm.InjectAndExecute(hProcess, dwBaseAddress); fasm.Dispose(); VirtualFreeEx(hProcess, dwBaseAddress, 0, 0x8000); //release memory }
public static uint ClickBox(uint x, uint y) { uint codeCave = MineProcess.AllocateMemory(); uint result = 0; Fasm.ManagedFasm fasm = new Fasm.ManagedFasm(MineProcess.ProcessHandle); fasm.AddLine("push {0}", y); fasm.AddLine("push {0}", x); fasm.AddLine("mov eax, 0x1003512"); fasm.AddLine("call eax"); fasm.AddLine("retn"); try { result = fasm.InjectAndExecute(codeCave); } finally { MineProcess.FreeMemory(codeCave); } return result; }
public static uint ClickBox(uint x, uint y) { uint codeCave = MineProcess.AllocateMemory(); uint result = 0; Fasm.ManagedFasm fasm = new Fasm.ManagedFasm(MineProcess.ProcessHandle); fasm.AddLine("push {0}", y); fasm.AddLine("push {0}", x); fasm.AddLine("mov eax, 0x1003512"); fasm.AddLine("call eax"); fasm.AddLine("retn"); try { result = fasm.InjectAndExecute(codeCave); } finally { MineProcess.FreeMemory(codeCave); } return(result); }