Results 1 to 3 of 3
  1. #1
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love

    C# Injector Source?

    Add this to your code in Button1_click (or w/e you want)
    Code:
     AttachProcess();
    Then add this code anywhere.
    Code:
            int processId = 0;
            private void AttachProcess()
            {
                bool newInstanceFound = false;
    
                while (!newInstanceFound)
                {
                    Process[] processes = Process.GetProcessesByName(Engine.exe); // or Engine (I don't know)
                    foreach (Process process in processes)
                    {
                        // Simply attach to the first one found.
    
                        // If the process doesn't have a mainwindowhandle yet, skip it (we need to be able to get the hwnd to set foreground etc)
                        if (process.MainWindowHandle == IntPtr.Zero)
                        {
                            continue;
                        }
    
                        // Keep track of hooked processes in case more than one need to be hooked
                        HookManager.AddHookedProcess(process.Id);
                        processId = process.Id;
    
                        // Inject DLL into target process
                        RemoteHooking.Inject(
                            process.Id,
                            InjectionOptions.Default,
                            "FlamesHack32.dll", // 32-bit version (the same because AnyCPU) could use different assembly that links to 32-bit C++ helper dll
                            "FlamesHack64.dll", // 64-bit version (the same because AnyCPU) could use different assembly that links to 64-bit C++ helper dll
        // the optional parameter list...
                            ChannelName // The name of the IPC channel for the injected assembly to connect to
                            );
    
                        // Ensure the target process is in the foreground,
                        // this prevents issues where the target app appears to be in 
                        // the foreground but does not receive any user inputs.
                        // Note: the first Alt+Tab out of the target application after injection
                        //       may still be an issue - switching between windowed and 
                        //       fullscreen fixes the issue however (see ScreenshotInjection.cs for another option)
                        BringProcessWindowToFront(process);
    
                        newInstanceFound = true;
                        break;
                    }
                    Thread.Sleep(10);
    
                }
            }
    Please Test for me and enjoy if it works
    No I do not make game hacks anymore, please stop asking.


    Been MPGH Minion: 6 July 2011 - 1 August 2012

  2. #2
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by flameswor10 View Post
    Add this to your code in Button1_click (or w/e you want)
    Code:
     AttachProcess();
    Then add this code anywhere.
    Code:
            int processId = 0;
            private void AttachProcess()
            {
                bool newInstanceFound = false;
    
                while (!newInstanceFound)
                {
                    Process[] processes = Process.GetProcessesByName(Engine.exe); // or Engine (I don't know)
                    foreach (Process process in processes)
                    {
                        // Simply attach to the first one found.
    
                        // If the process doesn't have a mainwindowhandle yet, skip it (we need to be able to get the hwnd to set foreground etc)
                        if (process.MainWindowHandle == IntPtr.Zero)
                        {
                            continue;
                        }
    
                        // Keep track of hooked processes in case more than one need to be hooked
                        HookManager.AddHookedProcess(process.Id);
                        processId = process.Id;
    
                        // Inject DLL into target process
                        RemoteHooking.Inject(
                            process.Id,
                            InjectionOptions.Default,
                            "FlamesHack32.dll", // 32-bit version (the same because AnyCPU) could use different assembly that links to 32-bit C++ helper dll
                            "FlamesHack64.dll", // 64-bit version (the same because AnyCPU) could use different assembly that links to 64-bit C++ helper dll
        // the optional parameter list...
                            ChannelName // The name of the IPC channel for the injected assembly to connect to
                            );
    
                        // Ensure the target process is in the foreground,
                        // this prevents issues where the target app appears to be in 
                        // the foreground but does not receive any user inputs.
                        // Note: the first Alt+Tab out of the target application after injection
                        //       may still be an issue - switching between windowed and 
                        //       fullscreen fixes the issue however (see ScreenshotInjection.cs for another option)
                        BringProcessWindowToFront(process);
    
                        newInstanceFound = true;
                        break;
                    }
                    Thread.Sleep(10);
    
                }
            }
    Please Test for me and enjoy if it works

    You do realise you failed at posting this code? /:

    What does the WinAPI function "BringProcessWindowToFront(...);" have to do with injection?

    The entire namespace "RemoteHooking" does not exist, let alone the "RemoteHooking.Inject(...)" method. Same with the "HookManager" namespace, as is the function "newInstanceFound".

  3. #3
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love
    Quote Originally Posted by freedompeace View Post
    You do realise you failed at posting this code? /:

    What does the WinAPI function "BringProcessWindowToFront(...);" have to do with injection?

    The entire namespace "RemoteHooking" does not exist, let alone the "RemoteHooking.Inject(...)" method. Same with the "HookManager" namespace, as is the function "newInstanceFound".

    LOL whoopsies. Lemme get the rest

Similar Threads

  1. INJECToR SOURCE
    By martijno0o0 in forum Visual Basic Programming
    Replies: 20
    Last Post: 01-12-2010, 11:06 AM
  2. ~ DLL Injector Source Code ~
    By Silk[H4x] in forum Visual Basic Programming
    Replies: 32
    Last Post: 12-17-2009, 12:18 AM
  3. Need new injector source (warrock)
    By weide43 in forum Visual Basic Programming
    Replies: 2
    Last Post: 11-27-2009, 05:20 PM
  4. Combat Arms Injector Source Code
    By Melikepie in forum Combat Arms Discussions
    Replies: 6
    Last Post: 10-21-2009, 04:24 PM
  5. Injector source help
    By qsc in forum C++/C Programming
    Replies: 7
    Last Post: 06-17-2009, 05:33 PM