Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.33 KB | None | 0 0
  1. public void inject()
  2.         {
  3.             long BWrite = 0;
  4.             uint iThread = 0;
  5.             string OverwatchPath = "C:\\Program Files (x86)\\Overwatch\\Overwatch.exe";
  6.             if (File.Exists("Overwatch.exe"))
  7.             {
  8.                 OverwatchPath = "Overwatch.exe";
  9.             }
  10.             Process[] Proc = Process.GetProcessesByName("Overwatch");
  11.             if(Proc.Count() > 0)
  12.             {
  13.                 Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Killing Overwatch First");
  14.                 OverwatchPath = Proc[0].MainModule.FileName;
  15.                 foreach(var p in Proc)
  16.                 {
  17.                     p.Kill();
  18.                 }
  19.             }
  20.             else
  21.             {
  22.                 Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Overwatch not found running, try again nigger");
  23.                 return;
  24.             }
  25.             if (OverwatchPath == "")
  26.             {
  27.                 Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Error, Overwatch not found!");
  28.                 Console.ReadLine();
  29.                 return;
  30.             }
  31.             if(DllPath == "")
  32.             {
  33.                 Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Error, Injecting failed, Are you premium?");
  34.                 Console.ReadLine();
  35.                 return;
  36.             }
  37.             ProcessStartInfo startInfo = new ProcessStartInfo();
  38.             startInfo.FileName = OverwatchPath;
  39.             Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Starting Overwatch..");
  40.             Process target = Process.Start(startInfo);
  41.             Thread.Sleep(2500);
  42.             //IntPtr hThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)target.Threads[0].Id);
  43.             //SuspendThread(hThread);
  44.  
  45.             //Do Inject Stuff
  46.             this.DllPath = Environment.CurrentDirectory + "\\out.dll";
  47.             IntPtr rHandle = OpenProcess(2035711, false, target.Id);
  48.  
  49.             byte[] AsmCave = { 0x90, 0x54, 0x48, 0x8B, 0xEC, 0x48, 0xB9, 0xEF, 0xBE, 0xAD, 0xDE, 0xDE, 0xC0, 0xAD, 0xDE, 0x6A, 0x00, 0x6A, 0x00, 0xFF, 0x15, 0x02, 0x00, 0x00, 0x00, 0xEB, 0x08, 0xEF, 0xBE, 0xAD, 0xDE, 0xDE, 0xC0, 0xAD, 0xDE, 0x58, 0x58, 0x48, 0x8B, 0xE5, 0x5D, 0xC3 };
  50.             uint size = (uint)(AsmCave.Length + DllPath.Length);
  51.             byte[] TotalAsmCave = new byte[size];
  52.  
  53.             long pLoadLibraryExA = (long)GetProcAddress(GetModuleHandle("KERNEL32.dll"), "LoadLibraryA");
  54.             for (int i = 0x1B; i < 0x1B + 0x08; i++)
  55.             {
  56.                 AsmCave[i] = BitConverter.GetBytes(pLoadLibraryExA)[i - 0x1B];
  57.             }
  58.             long AllocM = (long)VirtualAllocEx(rHandle, 0, size, AllocationType.Commit, MemoryProtection.ExecuteReadWrite);
  59.             Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Calling 0x" + AllocM.ToString("X"));
  60.             for (int i = 0x07; i < 0x07 + 0x08; i++)
  61.             {
  62.                 AsmCave[i] = BitConverter.GetBytes(AllocM + AsmCave.Length)[i - 0x07];
  63.             }
  64.             for (int i = 0; i < DllPath.Length; i++)
  65.             {
  66.                 TotalAsmCave[i + AsmCave.Length] = (byte)DllPath[i];
  67.             }
  68.             for (int i = 0; i < AsmCave.Length; i++)
  69.             {
  70.                 TotalAsmCave[i] = AsmCave[i];
  71.             }
  72.             WriteProcessMemory(rHandle, AllocM, TotalAsmCave, TotalAsmCave.Length, out BWrite);
  73.             this.DllPath = Environment.CurrentDirectory + "\\out.dll";
  74.             if(File.Exists(this.DllPath))
  75.                 File.Delete(this.DllPath);
  76.             File.WriteAllBytes(this.DllPath, this.DllBuffer);
  77.             //ResumeThread(hThread);
  78.             //CloseHandle(hThread);
  79.  
  80.             BypasAntiCheat01(target.Id, true, rHandle);
  81.             CreateRemoteThread(rHandle, IntPtr.Zero, 0, (IntPtr)AllocM, IntPtr.Zero, 0, out iThread);
  82.             if (iThread == 0)
  83.                 Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] CRT failed");
  84.  
  85.             Thread.Sleep(150);
  86.  
  87.             BypasAntiCheat01(target.Id, false, rHandle);
  88.             CloseHandle(rHandle);
  89.             this.DllPath = "";
  90.             Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss.fffff") + "] Done!");
  91.             Thread.Sleep(5000);
  92.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement