private void DoSigScan_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) //Run Signature scan in a separate thread so it doesn't kill the GUI { //Find and set Base address to scan from ClientBase = Function.GetModuleBaseAddress("League of Legends", "League of Legends.exe"); if (ClientBase.ToInt32() == 0) { ClientBase = Function.GetModuleBaseAddress("League of Legends", "League Of Legends.exe"); } Status = "Scanning..."; SigScan scan = new SigScan(new IntPtr(ClientBase.ToInt32() + 0x1000), 0xffffff); sig_MinMax1 = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_MixMax2 = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_ThirdPerson = sscan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_Fly = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_FieldOfView = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_Blank = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_AltZoom = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_FogofWar = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_X_Rotation = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_CreateHero = scan.FindPattern(new byte[] { 0x00 }, "x", 1); //Draw distance sig is in another part of the executable (rdata?) so to save time and memory start a new scan further north of the base address. sig_DrawDistance = scan.FindPattern(new byte[] { 0x00 }, "x", 1); //Clean Up GC.Collect(); //Check if one or all of the patterns are broken if (sig_MinMax1 == IntPtr.Zero || sig_MixMax2 == IntPtr.Zero || sig_ThirdPerson == IntPtr.Zero || sig_Fly == IntPtr.Zero || sig_FieldOfView == IntPtr.Zero || sig_Blank == IntPtr.Zero || sig_AltZoom == IntPtr.Zero || sig_FogofWar == IntPtr.Zero || sig_X_Rotation == IntPtr.Zero || sig_DrawDistance == IntPtr.Zero) { //Check if just one or more patterns are broken if ((sig_MinMax1.ToInt32() + sig_MixMax2.ToInt32() + sig_ThirdPerson.ToInt32() + sig_Fly.ToInt32() + sig_FieldOfView.ToInt32() + sig_Blank.ToInt32() + sig_AltZoom.ToInt32() + sig_FogofWar.ToInt32() + sig_X_Rotation.ToInt32() + sig_DrawDistance.ToInt32()) != 0) { Status = "Scan Fail, Check Updates"; Thread.Sleep(100); FP.Enabled = false; } //Check if all patterns are broken or there was an issue scanning the executable. if ((sig_MinMax1.ToInt32() + sig_MixMax2.ToInt32() + sig_ThirdPerson.ToInt32() + sig_Fly.ToInt32() + sig_FieldOfView.ToInt32() + sig_Blank.ToInt32() + sig_AltZoom.ToInt32() + sig_FogofWar.ToInt32() + sig_X_Rotation.ToInt32() + sig_DrawDistance.ToInt32()) == 0) { //Scan failed so add 1 to scan fail ScanFail = ScanFail + 1; //Target Process might not be fully loaded yet so wait one second and then continue. Thread.Sleep(1000); //If scan has failed 10 times switch off the find process timer and display error status. if (ScanFail > 10) { Status = "Scan Error"; Thread.Sleep(100); FP.Enabled = false; } } } }
//Run Signature scan in a separate thread so it doesn't kill the GUI private void DoSigScan_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { //Find and set Base address to scan from ClientBase = Function.GetModuleBaseAddress("League of Legends", "League of Legends.exe"); if (ClientBase.ToInt32() == 0) { ClientBase = Function.GetModuleBaseAddress("League of Legends", "League Of Legends.exe"); } Status = "Scanning..."; SigScan scan = new SigScan(new IntPtr(ClientBase.ToInt32() + 0x1000), 0xffffff); sig_MinMax1 = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_MixMax2 = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_ThirdPerson = sscan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_Fly = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_FieldOfView = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_Blank = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_AltZoom = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_FogofWar = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_X_Rotation = scan.FindPattern(new byte[] { 0x00 }, "x", 1); sig_CreateHero = scan.FindPattern(new byte[] { 0x00 }, "x", 1); //Draw distance sig is in another part of the executable (rdata?) so to save time and memory start a new scan further north of the base address. sig_DrawDistance = scan.FindPattern(new byte[] { 0x00 }, "x", 1); //Clean Up GC.Collect(); //Check if one or all of the patterns are broken if (sig_MinMax1 == IntPtr.Zero || sig_MixMax2 == IntPtr.Zero || sig_ThirdPerson == IntPtr.Zero || sig_Fly == IntPtr.Zero || sig_FieldOfView == IntPtr.Zero || sig_Blank == IntPtr.Zero || sig_AltZoom == IntPtr.Zero || sig_FogofWar == IntPtr.Zero || sig_X_Rotation == IntPtr.Zero || sig_DrawDistance == IntPtr.Zero) { //Check if just one or more patterns are broken if ((sig_MinMax1.ToInt32() + sig_MixMax2.ToInt32() + sig_ThirdPerson.ToInt32() + sig_Fly.ToInt32() + sig_FieldOfView.ToInt32() + sig_Blank.ToInt32() + sig_AltZoom.ToInt32() + sig_FogofWar.ToInt32() + sig_X_Rotation.ToInt32() + sig_DrawDistance.ToInt32()) != 0) { Status = "Scan Fail, Check Updates"; Thread.Sleep(100); FP.Enabled = false; } //Check if all patterns are broken or there was an issue scanning the executable. if ((sig_MinMax1.ToInt32() + sig_MixMax2.ToInt32() + sig_ThirdPerson.ToInt32() + sig_Fly.ToInt32() + sig_FieldOfView.ToInt32() + sig_Blank.ToInt32() + sig_AltZoom.ToInt32() + sig_FogofWar.ToInt32() + sig_X_Rotation.ToInt32() + sig_DrawDistance.ToInt32()) == 0) { //Scan failed so add 1 to scan fail ScanFail = ScanFail + 1; //Target Process might not be fully loaded yet so wait one second and then continue. Thread.Sleep(1000); //If scan has failed 10 times switch off the find process timer and display error status. if (ScanFail > 10) { Status = "Scan Error"; Thread.Sleep(100); FP.Enabled = false; } } } }