Guest User

Untitled

a guest
Jul 21st, 2017
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1.      public class Injector
  2.         {
  3.             public static void Inject(byte[] data)
  4.             {
  5.                 var injector = InjectionMethod.Create(InjectionMethodType.ManualMap);
  6.                 var processId = Process.GetProcessesByName("csgo")[0].Id;
  7.                 var hModule = IntPtr.Zero;
  8.      
  9.                 using (var dll = new PortableExecutable(data))
  10.                     hModule = injector.Inject(dll, processId);
  11.      
  12.                 if (hModule != IntPtr.Zero)
  13.                 {
  14.                     Worker.instance.owninjector.InjectionFinished();
  15.                 }
  16.                 else
  17.                 {
  18.                     // injection failed
  19.                     if (injector.GetLastError() != null)
  20.                         MessageBox.Show(injector.GetLastError().Message);
  21.                 }
  22.      
  23.             }
Advertisement
Add Comment
Please, Sign In to add comment