Page 3 of 6 FirstFirst 12345 ... LastLast
Results 31 to 45 of 84
  1. #31
    _VERSTROATE_'s Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    My Mood
    Stressed
    Quote Originally Posted by _VERSTROATE_ View Post
    Can you convert the source code into another extension? Visual Studio 2010 gives me the error that's attached (The project type (.csproj) is not supported by this version of the application).
    I tried to resolve it by re-installing VS and I even executed devenv /ResetSkipPkgs in the Visual Studio Command Prompt, but without a result.
    As for the InjectionLibrary.dll, I'm getting errors also. Well no errors in fact, I do not see any errors but when I try to debug, it says that there were build errors (and still no errors in the box at the bottom). I did what I had to do I believe. Hope you guys can help me out.
    Never mind. Used the InjectionLibrary.dll on a Framework 4.0 project.

    ---------- Post added at 02:38 PM ---------- Previous post was at 02:17 PM ----------

    Ins't this meant to be multi-dll? It only injects the last dll I add to my listbox. Somebody who can help?

  2. #32
    DeadCode's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    8
    My Mood
    Amazed
    Quote Originally Posted by _VERSTROATE_ View Post
    As for the InjectionLibrary.dll, I'm getting errors also. Well no errors in fact, I do not see any errors but when I try to debug, it says that there were build errors (and still no errors in the box at the bottom). I did what I had to do I believe. Hope you guys can help me out.
    Simple! Simply do what I said on top!

  3. #33
    Xzevos's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    104
    @Jason

    I have a question.
    How is the Inject() method used exactly? Do you need only the (.dll , processID) or are you suppose to find the handle before that?

    This what I have so far:
    Code:
            Dim pID As Integer = 0
            Dim p() As Process = Process.GetProcesses
            Dim hModule As IntPtr = IntPtr.Zero
            For Each x As Process In p
                If x.ProcessName = txtProcess.Text Then
                    pID = x.Id
                    hModule = FindWindow(Nothing, x.MainWindowTitle) ' <-------- Do I set it here or is that not what I'm suppose to do
                End If
            Next
    
            If hModule = IntPtr.Zero Then
                MessageBox.Show("process not found", "Error")
            Else
                Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
                Using img As New PortableExecutable(My.Resources.kajsdh)
                    hModule = injector.Inject(img, pID)  <---------- Because hModule is being set here when the inject function performs
                End Using
                If hModule <> IntPtr.Zero Then '--------------------------- I know everything below this is off or kinda extra coding ↓
                    
                Else
    
                    If injector.GetLastError() IsNot Nothing Then
                        MessageBox.Show(injector.GetLastError().Message)
                    End If
                End If
            End If

  4. #34
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Xzevos View Post
    @Jason

    I have a question.
    How is the Inject() method used exactly? Do you need only the (.dll , processID) or are you suppose to find the handle before that?

    This what I have so far:
    Code:
            Dim pID As Integer = 0
            Dim p() As Process = Process.GetProcesses
            Dim hModule As IntPtr = IntPtr.Zero
            For Each x As Process In p
                If x.ProcessName = txtProcess.Text Then
                    pID = x.Id
                    hModule = FindWindow(Nothing, x.MainWindowTitle) ' <-------- Do I set it here or is that not what I'm suppose to do
                End If
            Next
    
            If hModule = IntPtr.Zero Then
                MessageBox.Show("process not found", "Error")
            Else
                Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
                Using img As New PortableExecutable(My.Resources.kajsdh)
                    hModule = injector.Inject(img, pID)  <---------- Because hModule is being set here when the inject function performs
                End Using
                If hModule <> IntPtr.Zero Then '--------------------------- I know everything below this is off or kinda extra coding ↓
                    
                Else
    
                    If injector.GetLastError() IsNot Nothing Then
                        MessageBox.Show(injector.GetLastError().Message)
                    End If
                End If
            End If
    There are various overloads on the Inject method that you can use. For your example, I would just use the following:
    Code:
    Dim targets As Process() = Process.GetProcessesByName(txtProcess.Text)
    If targets.Length > 0 Then
        Dim processId As Integer = targets(0).Id
        Dim hModule As IntPtr = IntPtr.Zero
        Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
    
        Using img As New PortableExecutable(My.Resources.kajsdh)
            hModule = injector.Inject(img, processId)
        End Using
    
        If hModule <> IntPtr.Zero Then
            ' File was injected successfully, do whatever you want here
        Else
            ' an error occured, let the user know
            If injector.GetLastError() IsNot Nothing Then
                MessageBox.Show(String.Format("An error occurred when injecting:{0}{0}{1}", Environment.NewLine, injector.GetLastError().Message))
            Else
                MessageBox.Show("An unknown error occurred when injecting")
            End If
        End If
    Else
        MessageBox.Show("Target process is not running")
    End If
    There is no need for "FindWindow" here at all. The handle that FindWindow returns is a HWND (Handle to Window), not a HMODULE (Handle to Module), the two are completely different. Apologies if the above code doesn't compile as-is, I haven't used VB.NET in a while and I don't have a compiler or IDE at work.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. #35
    ccman32's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Germany
    Posts
    1,306
    Reputation
    325
    Thanks
    22,221
    My Mood
    Devilish
    How about additional options like remove PE header? For example when i inject with Radject it only works with these options. When i just manual map with this lib then my hack gets detected.

    EDIT: I just added a remove PE header method manually and it works now
    Last edited by ccman32; 06-12-2013 at 02:48 PM.

  6. #36
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by ccman32 View Post
    How about additional options like remove PE header? For example when i inject with Radject it only works with these options. When i just manual map with this lib then my hack gets detected.
    It was a tradeoff in writing this library as pure injection library. If I added the functionality to remove the PE header into this library, then it'd be moving outside the scope of just injection and it'd open up the project to get bloated with unnecessary crap.

    However, writing your own method to remove the PE header is easy anyway:
    Code:
    IntPtr hProcess = OpenProcess(...); // whatever way you want to get a read/write/operation handle to the target process
    IntPtr hModule = method.Inject(...); // as normal
    var crapware = new byte[0x40]; // size of an IMAGE_DOS_HEADER (each element of a new byte array is initialized with itsdefault value (0) in C#)
    WriteProcessMemory(hProcess, hModule, crapware, crapware.Length, IntPtr.Zero);
    CloseHandle(hProcess);
    Given that the PE header is always at the beginning of the module (the pointer to which you get from my library's "Inject" method), it's a simple matter to just set the entire DOS header to 0. You can, of course, take this even further and make it more sophisticated but that's the basics of it.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  7. #37
    molot's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    MPGH OR BED
    Posts
    1,796
    Reputation
    41
    Thanks
    223
    My Mood
    Cold
    nice job man

  8. #38
    ccman32's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Germany
    Posts
    1,306
    Reputation
    325
    Thanks
    22,221
    My Mood
    Devilish
    I got another problem @Jason. After adding the removepeheader method and compiling i added the reference to the library in my vb.net injector project. Now, every time when i compile my project im getting an error during build process. Just a popup message telling me that without any other information. Somehow i managed to compile and run the program but right when it injects i get a JIT Debugger error that InjectionLibrary.InjectionMethod in the assembly "InjectionLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" could not be loaded. Why am i getting this error pissing me off since like 2 hours now?!?

  9. #39
    dino42's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Location
    C++
    Posts
    343
    Reputation
    10
    Thanks
    223
    My Mood
    Sad
    Nice work jason! now i can finish euro farmer for AVA.

  10. #40
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by ccman32 View Post
    I got another problem @Jason. After adding the removepeheader method and compiling i added the reference to the library in my vb.net injector project. Now, every time when i compile my project im getting an error during build process. Just a popup message telling me that without any other information. Somehow i managed to compile and run the program but right when it injects i get a JIT Debugger error that InjectionLibrary.InjectionMethod in the assembly "InjectionLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" could not be loaded. Why am i getting this error pissing me off since like 2 hours now?!?
    It usually has more information than that. It might be that you're compiling with the wrong target architecture. I can't remember now if the DLL was x86 or AnyCPU.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  11. #41
    R4v0r's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    London
    Posts
    234
    Reputation
    11
    Thanks
    142
    My Mood
    Amazed
    @Jason, why can't I download?

  12. #42
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by R4v0r View Post
    @Jason, why can't I download?
    I can still see the download link. Make sure you're on the first page of the thread.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  13. #43
    meldino's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    73
    Reputation
    14
    Thanks
    1,876
    My Mood
    Yeehaw
    There are no downloadable files.. Wut?
    EDIT::: Works now. lulz
    Last edited by meldino; 02-21-2014 at 07:58 AM.

  14. #44
    Rastajan's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    Celadon City
    Posts
    1
    Reputation
    10
    Thanks
    0
    This sounds really interesting and i'd like to deal with it but i am not able to see the attached files...

    Regards, Rastajan.

  15. #45
    R3DDOT's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    C://Windows/system32
    Posts
    347
    Reputation
    38
    Thanks
    2,366
    My Mood
    Cheerful
    Quote Originally Posted by Jason View Post
    Wazzzuuuup.

    Been working on this for a while now. It's a .NET library with various injection methods which make it very straightforward to make your own injectors/loaders. It even includes a public Manual Map injection method.

    Although the source is in C#, the compiled library is usable in both VB.NET and C#, depending on your language preferences. I have included both the raw binary as well as the project folder in the attachments to this post.

    The source is fairly documented, but I get lazy so there may be sections that you'll need to work out for yourself when looking into the source. The project targets .NET 2.0, so there should be no compatibility issues with projects you want to make.

    To use the library, simply create a new .NET project and add the library as a project reference. (Project >> Add Reference >> Browse >> Locate DLL)

    I've implemented this library using a factory pattern, so using the various different injection methods are very straightforward. All the various types of injection inherit from the base "InjectionMethod" class, which implements two different methods for injecting.

    Code:
    Inject(...)           // inject a single module
    or
    InjectAll(...)        // inject a range of modules
    Both of these methods have various overloads but the key point is that each method can either inject from a PortableExecutable object, or from a file location. A PortableExecutable object can be created in-memory, or from a file location. This means that when using ManualMap injection, it's possible to inject a DLL without it ever touching the harddisk during the injection process. Standard/ThreadHijack methods both call LoadLibrary, so even if you pass a PortableExecutable object to these injection methods, the module will be written to disk in a random location.

    The two main namespaces you'll likely refer to are going to be
    Code:
    C#
    using InjectionLibrary;
    using JLibrary.PortableExecutable;
    
    VB.NET
    Imports InjectionLibrary
    Imports JLibrary.PortableExecutable
    Example 1: Using the creation factory to make an injection method
    Code:
    C# -
    InjectionMethod injector = InjectionMethod.Create(InjectionMethodType.ManualMap);
    
    VB.NET -
    Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
    Example 2: Super-stealthy injection from resources.
    Code:
    C# -
    var injector = InjectionMethod.Create(InjectionMethodType.ManualMap);
    var processId = Process.GetProcessesByName("engine")[0].Id;
    var hModule = IntPtr.Zero;
    
    using (var img = new PortableExecutable(Properties.Resources.TestDll))
        hModule = injector.Inject(img, processId);
    
    if (hModule != IntPtr.Zero)
    {
        // injection was successful
    }
    else
    {
        // injection failed
        if (injector.GetLastError() != null)
            MessageBox.Show(injector.GetLastError().Message);
    }
    
    
    
    
    VB.NET -
    Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
    Dim processId As Integer = Process.GetProcessesByName("engine")(0).Id
    Dim hModule As IntPtr = IntPtr.Zero
    
    Using img As New PortableExecutable(My.Resources.TestDll)
        hModule = injector.Inject(img, processId)
    End Using
    
    If hModule <> IntPtr.Zero
        ' injection successful
    Else
        ' injection failed
        If injector.GetLastError() IsNot Nothing
            MessageBox.Show(injector.GetLastError().Message)
        End If
    End If
    Virus Scans
    Binary:
    [x][x]
    Source:
    [x][x]

    That's about the crux of it, the injector is on x86 compatible, meaning you won't be able to inject into x64 processes, but that shouldn't be too much of an issue. If you have any other questions about using the library, just ask in the thread.
    The library is released under the GNU GPL, so you're free to use the library however you wish, I'm not responsible for whatever you make with it though, and I ask for a mention if you release an injector/loader using my library, nothing fancy just an acknowledgement of my work.

    Cheers,
    Jason
    Why is it that when I try to import the library into an assembly, I can't build it?
    When I try to build it, it says there were build errors, then I go see what errors are there and the error tab shows up blank o.o

Page 3 of 6 FirstFirst 12345 ... LastLast

Similar Threads

  1. [Tutorial] Finding Source Code of Not Open Source Programs
    By treeham in forum C++/C Programming
    Replies: 21
    Last Post: 03-28-2010, 08:35 AM
  2. Open Source Release. Semi-Useless Timer Source Code!
    By User1 in forum Visual Basic Programming
    Replies: 6
    Last Post: 09-20-2009, 02:55 AM
  3. Combat Arms Utilities Open Source Project
    By User1 in forum Combat Arms Hacks & Cheats
    Replies: 28
    Last Post: 09-20-2009, 02:08 AM
  4. Replies: 0
    Last Post: 09-01-2008, 08:28 PM