Guest User

inject.cs

a guest
Oct 5th, 2013
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using Syringe;
  2. using System;
  3. using System.Diagnostics;
  4. using System.Windows.Forms;
  5.  
  6. namespace Inject
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.WriteLine("Trying to inject dll into client.exe");
  13.             try
  14.             {
  15.                 using (Injector syringe = new Injector(Process.GetProcessesByName("client")[0]))
  16.                 {
  17.  
  18.                     syringe.InjectLibrary( "C:\\Users\\Felipe\\Desktop\\mydll\\Debug\\mydll.dll" );
  19.                     Console.WriteLine("inject.exe injected into client, trying to call void dummy() with no parameters");
  20.                     syringe.CallExport( "C:\\Users\\Felipe\\Desktop\\mydll\\Debug\\mydll.dll", "dummy" );
  21.                     Application.Run();
  22.                 }
  23.             }
  24.             catch (Exception e)
  25.             {
  26.                 MessageBox.Show( e.Message );
  27.             }
  28.  
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment