Guest User

Untitled

a guest
Dec 22nd, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System.IO;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Text;
  7. using WinApi;
  8. using WinApi.Kernel;
  9. using WinApi.FileFormat;
  10.  
  11. namespace gothic_2_edit
  12. {
  13.     class Program
  14.     {  
  15.         public static void Main(string[] args)
  16.         {
  17.  
  18.            
  19.             Console.WriteLine("Kliknij ENTER by rozpocząć grę");
  20.             Console.ReadLine();
  21.  
  22.  
  23.             String dll = "NetInject.dll";
  24.  
  25.             if (!System.IO.File.Exists(dll))
  26.                 throw new Exception("Elementu " + dll + " nie znaleziono");
  27.  
  28.  
  29.             System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
  30.             psi.WorkingDirectory = Environment.CurrentDirectory;
  31.  
  32.  
  33.             psi.Arguments = "-zwindow";
  34.  
  35.  
  36.             psi.FileName = "Gothic2.exe";
  37.             WinApi.Process process = WinApi.Process.Start(psi);
  38.  
  39.             if (process.LoadLibary(dll) == IntPtr.Zero)
  40.                 Error.GetLastError();
  41.             Console.ReadLine();
  42.  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment