private void FindGameTick(object sender, EventArgs e) { if (m.gameFound) { if (!PatternsFound) { PatternsFound = GetCameraOffsets(); } } else { PatternsFound = false; if (m.FindGame("League of Legends")) { PatternsFound = GetCameraOffsets(); } } if (m.gameFound && PatternsFound) { GetDefaultValues(); SearchForGame.Enabled = false; deltaTime.Restart(); UpdateCamera.Enabled = true; } }
private static void FindGame() { while (true) { switch (ThreadState) { case State.FindGame: string error; FindGameResult result = MemoryEditor.FindGame("League of Legends (TM) Client", out error); //MemoryEditor.Context context = MemoryEditor.GetThreadContext(); if (result == FindGameResult.GameFound) { ThreadState = State.LoadWads; } break; case State.LoadWads: uint addr; if (MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x8B\x4C\x24\x2C\x8A\xD8\x85\xC9", "x????xxxxxxxx", out addr)) { uint thisFunc; MemoryEditor.FindPatternReverse(@"\x81\xEC\x3C\x01\x00\x00\xA1", "xxxxxxx", (IntPtr)addr, out thisFunc); uint ECDSA; MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x84\xC0\x75\x34\x8D\x84\x24\x00\x00\x00\x00", @"x????xxxxxxx????", out ECDSA); int offset; MemoryEditor.ReadInt((IntPtr)ECDSA + 1, out offset); ECDSA = (uint)(ECDSA + offset + 5); int callOffset = (int)addr - (int)thisFunc; MemoryEditor.ReadInt((IntPtr)addr + 1, out offset); addr = (uint)(addr + offset + 5); LoadWadFiles((IntPtr)thisFunc, callOffset, (IntPtr)addr, (IntPtr)ECDSA); ThreadState = State.WaitForNewGame; } break; } Thread.Sleep(1); } }