Results 1 to 3 of 3
  1. #1

    vb 2008 DLL injector?

    im looking for a src or a finished of a DLL injector any one have one?
    i dont want it to be a virus.
    please help



    thx, LolBoT.
    Lmfao!
    Ya Better Not!

  2. #2
    VIP FreckleS's Avatar
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    2,121

    Re: vb 2008 DLL injector?

    Here is a C# one but you should be able to convert it quite easily.
    Code:
    using System;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    
    //This is used to actually inject the specific DLL into the selected process
    
    namespace InjectMe
    {
        public static class Inject
        {
            private static class WINAPI
            {
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern IntPtr OpenProcess(
                    UInt32 dwDesiredAccess,
                    Int32 bInheritHandle,
                    UInt32 dwProcessId);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern Int32 CloseHandle(
                    IntPtr hObject);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern IntPtr GetProcAddress(
                    IntPtr hModule,
                    string lpProcName);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern IntPtr GetModuleHandle(
                    string lpModuleName);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern IntPtr VirtualAllocEx(
                    IntPtr hProcess,
                    IntPtr lpAddress,
                    IntPtr dwSize,
                    uint flAllocationType,
                    uint flProtect);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern Int32 WriteProcessMemory(
                    IntPtr hProcess,
                    IntPtr lpBaseAddress,
                    byte[] buffer,
                    uint size,
                    out IntPtr lpNumberOfBytesWritten);
    
                [DllImport("kernel32.dll", SetLastError = true)]
                public static extern IntPtr CreateRemoteThread(
                    IntPtr hProcess,
                    IntPtr lpThreadAttribute,
                    IntPtr dwStackSize,
                    IntPtr lpStartAddress,
                    IntPtr lpParameter,
                    uint dwCreationFlags,
                    IntPtr lpThreadId);
    
                public static class VAE_Enums
                {
                    public enum AllocationType
                    {
                        MEM_COMMIT = 0x1000,
                        MEM_RESERVE = 0x2000,
                        MEM_RESET = 0x80000,
                    }
    
                    public enum ProtectionConstants
                    {
                        PAGE_EXECUTE = 0X10,
                        PAGE_EXECUTE_READ = 0X20,
                        PAGE_EXECUTE_READWRITE = 0X40,
                        PAGE_EXECUTE_WRITECOPY = 0X80,
                        PAGE_NOACCESS = 0X01
                    }
                }
            }       
    
            public static bool DoInject(
                Process pToBeInjected,
                string sDllPath,
                out string sError)
            {
                IntPtr hwnd = IntPtr.Zero;
                if (!CRT(pToBeInjected, sDllPath, out sError, out hwnd)) //CreateRemoteThread
                {
                    //close the handle, since the method wasn't able to get to that
                    if (hwnd != (IntPtr)0)
                        WINAPI.CloseHandle(hwnd);
                    return false;
                }
                int wee = Marshal.GetLastWin32Error();
                return true;
            }
    
            private static bool CRT(
                Process pToBeInjected,
                string sDllPath,
                out string sError,
                out IntPtr hwnd)
            {
                sError = String.Empty; //in case we encounter no errors
    
                IntPtr hndProc = WINAPI.OpenProcess(
                    (0x2 | 0x8 | 0x10 | 0x20 | 0x400), //create thread, query info, operation
                    //write, and read
                    1,
                    (uint)pToBeInjected.Id);
    
                hwnd = hndProc;
    
                if (hndProc == (IntPtr)0)
                {
                    sError = "Unable to attatch to process.\n";
                    sError += "Error code: " + Marshal.GetLastWin32Error();
                    return false;
                }
    
                IntPtr lpLLAddress = WINAPI.GetProcAddress(
                    WINAPI.GetModuleHandle("kernel32.dll"),
                    "LoadLibraryA");
    
                if (lpLLAddress == (IntPtr)0)
                {
                    sError = "Unable to find address of \"LoadLibraryA\".\n";
                    sError += "Error code: " + Marshal.GetLastWin32Error();
                    return false;
                }
    
                IntPtr lpAddress = WINAPI.VirtualAllocEx(
                    hndProc,
                    (IntPtr)null,
                    (IntPtr)sDllPath.Length, //520 bytes should be enough
                    (uint)WINAPI.VAE_Enums.AllocationType.MEM_COMMIT |
                    (uint)WINAPI.VAE_Enums.AllocationType.MEM_RESERVE,
                    (uint)WINAPI.VAE_Enums.ProtectionConstants.PAGE_EXECUTE_READWRITE);
    
                if (lpAddress == (IntPtr)0)
                {
                    if (lpAddress == (IntPtr)0)
                    {
                        sError = "Unable to allocate memory to target process.\n";
                        sError += "Error code: " + Marshal.GetLastWin32Error();
                        return false;
                    }
                }
    
                byte[] bytes = CalcBytes(sDllPath);
                IntPtr ipTmp = IntPtr.Zero;
    
                WINAPI.WriteProcessMemory(
                    hndProc,
                    lpAddress,
                    bytes,
                    (uint)bytes.Length,
                    out ipTmp);
    
                if (Marshal.GetLastWin32Error() != 0)
                {
                    sError = "Unable to write memory to process.";
                    sError += "Error code: " + Marshal.GetLastWin32Error();
                    return false;
                }
    
                IntPtr ipThread = WINAPI.CreateRemoteThread(
                    hndProc,
                    (IntPtr)null,
                    (IntPtr)0,
                    lpLLAddress,
                    lpAddress,
                    0,
                    (IntPtr)null);
    
                if (ipThread == (IntPtr)0)
                {
                    sError = "Unable to load dll into memory.";
                    sError += "Error code: " + Marshal.GetLastWin32Error();
                    return false;
                }
    
                return true;
            }
    
            private static byte[] CalcBytes(string sToConvert)
            {
                byte[] bRet = System.Text.Encoding.ASCII.GetBytes(sToConvert);
                return bRet;
            }
        }
    }
    "The pain you feel today, will be the strength you feel tomorrow"

  3. #3

    Re: vb 2008 DLL injector?

    wow man thnx!!!! will do
    Lmfao!
    Ya Better Not!

Similar Threads

  1. I'm bit experienced with VB 2008
    By vallismall in forum Visual Basic
    Replies: 8
    Last Post: January 5th, 2010, 00:28
  2. any Aim Bot in vb 2008 or c# ?
    By codehpro in forum Visual Basic
    Replies: 3
    Last Post: July 3rd, 2009, 04:42
  3. Warrock 2/06/2008
    By Hell_Demon in forum Warrock Cheat Downloads
    Replies: 2
    Last Post: October 12th, 2008, 22:54
  4. EK 2008 Standings !
    By Hc4lNickNL in forum Non-Gaming Related
    Replies: 30
    Last Post: June 30th, 2008, 19:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •