Managed Hooks Unmanaged.. Win32Exception

Dec 22, 2009 at 8:57 AM

I using C# to inject my Managed C# DLL, but i get an Win32Exception.. System cann´t found the file..  I copied all Files into the folder, EasyHook32.dll EasyHook64.dll EasyHook.dll.. and my DLL to Inject

Here to COde to Inject

static void Main(string[] args)
        {
            //Process cs2d = Process.GetProcessesByName("CounterStrike2D")[0];
            int id = 0;

            try
            {
                EasyHook.RemoteHooking.CreateAndInject(
                    @"C:\Program Files (x86)\Counter-Strike 2D\CounterStrike2D.exe",
                    "-windowed", 0, "CS2D_UnitedHaX", "CS2D_UnitedHaX", out id, null);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
        }

Dec 23, 2009 at 6:08 PM

now i tried it with Inject... but i get this error:

System.AccessViolationException: Unable to inject library into target process.

 

            Console.WriteLine(".... | ...");

            RemoteHooking.Inject(
                Process.GetProcessesByName("game")[0].Id,
                InjectionOptions.NoWOW64Bypass,
                "M4Hook_V2.dll",
                "M4Hook_V2.dll",
                null);