Results 1 to 13 of 13
  1. #1
    Tukjedude's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    The Netherlands
    Posts
    25
    Reputation
    10
    Thanks
    13
    My Mood
    Sleepy

    [Release][Source Code] DLL Injection

    DLL Injection

    This is not a injector wich can inject everybody's DLL in every proccess. You can release it with your DLL to make it easier for people.

    You can edit the name of the DLL to your DLL and edit the process of the process where i should be injected to.

    Just something easy you can use for your hack.
    This is free of use and you may modify it, but just leave my name on it.


    Code:
    // Filename: DLL Injector.cpp
    // Author: HadFuny
    // Date: 31-05-2010
    // HadFuny Copyright 2010
    
    #include <windows.h> 
    #include <tlhelp32.h> 
    #include <shlwapi.h> 
    #include <conio.h> 
    #include <stdio.h> 
    #include <iostream>
    
    
    #define WIN32_LEAN_AND_MEAN 
    #define CREATE_THREAD_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ) 
    
    BOOL Inject(DWORD pID, const char * DLL_NAME); 
    DWORD GetTargetThreadIDFromProcName(const char * ProcName); 
    using namespace std;
    
    int main(int argc, char * argv[]) 
    {
       // The name of the process you want to inject
       DWORD pID = GetTargetThreadIDFromProcName("notepad.exe"); 
        
       // Get the dll's full path name 
       char buf[MAX_PATH] = {0}; 
       GetFullPathName("Project1.dll", MAX_PATH, buf, NULL);  // On the place where is Project1.dll you can put the name of your dll
       printf(buf); 
       printf("\n"); 
        
       // Inject our main dll
       if(!Inject(pID, buf)) 
       { 
         printf("Not loaded!"); // If injection is not sucsessfull 
       }
       else
       { 
         printf("Loaded!"); //  If injection is sucsessfull 
       } 
       _getch(); 
       return 0; 
    } 
    
    BOOL Inject(DWORD pID, const char * DLL_NAME) 
    { 
       HANDLE Proc; 
       HMODULE hLib; 
       char buf[50] = {0}; 
       LPVOID RemoteString, LoadLibAddy; 
       if(!pID) 
          return false; 
       Proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID); 
       if(!Proc) 
       { 
          sprintf(buf, "OpenProcess() failed: %d", GetLastError()); 
          //MessageBox(NULL, buf, "Loader", MB_OK); 
          printf(buf); 
          return false; 
       } 
       LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); 
       // Allocate space in the process for our DLL
       RemoteString = (LPVOID)VirtualAllocEx(Proc, NULL, strlen(DLL_NAME), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); 
       // Write the string name of our DLL in the memory allocated 
       WriteProcessMemory(Proc, (LPVOID)RemoteString, DLL_NAME, strlen(DLL_NAME), NULL); 
       // Load our <strong class="highlight">DLL</strong> 
       CreateRemoteThread(Proc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, NULL); 
       CloseHandle(Proc); 
       return true; 
    } 
    
    DWORD GetTargetThreadIDFromProcName(const char * ProcName) 
    { 
       PROCESSENTRY32 pe; 
       HANDLE thSnapShot; 
       BOOL retval, ProcFound = false; 
    
       thSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 
       if(thSnapShot == INVALID_HANDLE_VALUE) 
       { 
          //MessageBox(NULL, "Error: Unable to create toolhelp snapshot!", "2MLoader", MB_OK); 
          printf("Error: Unable to create toolhelp snapshot!"); 
          return false; 
       } 
       pe.dwSize = sizeof(PROCESSENTRY32); 
       retval = Process32First(thSnapShot, &pe); 
       while(retval) 
       { 
          if(StrStrI(pe.szExeFile, ProcName)) 
          { 
             return pe.th32ProcessID; 
          } 
          retval = Process32Next(thSnapShot, &pe); 
       } 
       return 0; 
    }
    To turn it in a unversial injector wich can inject any DLL into any process:
    DOWNLOAD COMPILED UNIVERSAL INJECTOR: Download
    VIRUSTOTAL:Virustotal. MD5: cd43aef8fbdf49f7a3bfe0f5879f5db7


    Code:
    // Filename: DLL Injector.cpp
    // Author: HadFuny
    // Date: 31-05-2010
    // HadFuny Copyright 2010
    
    #include <windows.h> 
    #include <tlhelp32.h> 
    #include <shlwapi.h> 
    #include <conio.h> 
    #include <stdio.h> 
    #include <iostream>
    
    
    #define WIN32_LEAN_AND_MEAN 
    #define CREATE_THREAD_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ) 
    
    BOOL Inject(DWORD pID, const char * DLL_NAME); 
    DWORD GetTargetThreadIDFromProcName(const char * ProcName); 
    using namespace std;
    char* proc = "text";
    char* dll = "text";
    
    int main(int argc, char * argv[]) 
    {
       // The name of the process you want to inject
       printf("Name of process:");
       cin >> proc;
       printf("/nName of DLL:");
       cin >> dll;
       DWORD pID = GetTargetThreadIDFromProcName(proc); 
        
       // Get the dll's full path name 
       char buf[MAX_PATH] = {0}; 
       GetFullPathName(dll, MAX_PATH, buf, NULL);  // On the place where is Project1.dll you can put the name of your dll
       printf(buf); 
       printf("\n"); 
        
       // Inject our main dll
       if(!Inject(pID, buf)) 
       { 
        printf("Not loaded!"); // If injection is not sucsessfull 
       }
       else
       { 
         printf("Loaded!"); //  If injection is sucsessfull 
       } 
       _getch(); 
       return 0; 
    } 
    
    BOOL Inject(DWORD pID, const char * DLL_NAME) 
    { 
       HANDLE Proc; 
       HMODULE hLib; 
       char buf[50] = {0}; 
       LPVOID RemoteString, LoadLibAddy; 
       if(!pID) 
          return false; 
       Proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID); 
       if(!Proc) 
       { 
          sprintf(buf, "OpenProcess() failed: %d", GetLastError()); 
          //MessageBox(NULL, buf, "Loader", MB_OK); 
          printf(buf); 
          return false; 
       } 
       LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); 
       // Allocate space in the process for our DLL
       RemoteString = (LPVOID)VirtualAllocEx(Proc, NULL, strlen(DLL_NAME), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); 
       // Write the string name of our DLL in the memory allocated 
       WriteProcessMemory(Proc, (LPVOID)RemoteString, DLL_NAME, strlen(DLL_NAME), NULL); 
       // Load our <strong class="highlight">DLL</strong> 
       CreateRemoteThread(Proc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, NULL); 
       CloseHandle(Proc); 
       return true; 
    } 
    
    DWORD GetTargetThreadIDFromProcName(const char * ProcName) 
    { 
       PROCESSENTRY32 pe; 
       HANDLE thSnapShot; 
       BOOL retval, ProcFound = false; 
    
       thSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 
       if(thSnapShot == INVALID_HANDLE_VALUE) 
       { 
          //MessageBox(NULL, "Error: Unable to create toolhelp snapshot!", "2MLoader", MB_OK); 
          printf("Error: Unable to create toolhelp snapshot!"); 
          return false; 
       } 
       pe.dwSize = sizeof(PROCESSENTRY32); 
       retval = Process32First(thSnapShot, &pe); 
       while(retval) 
       { 
          if(StrStrI(pe.szExeFile, ProcName)) 
          { 
             return pe.th32ProcessID; 
          } 
          retval = Process32Next(thSnapShot, &pe); 
       } 
       return 0; 
    }
    Sorry if there any error's in the code above i did it straight away without reading anything just straigt out of my mind..
    Last edited by Tukjedude; 05-31-2010 at 11:53 PM.

  2. #2
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    way 2 jack someone's code without any credit. which I notice by this huge giveaway
    Code:
    <strong class="highlight">DLL</strong>
    which occurs multiple times through out ur code.

    EDIT: hmmm... might be wrong abt this accusation. if I am let me know.
    Last edited by why06; 05-31-2010 at 01:12 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  3. #3
    Tukjedude's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    The Netherlands
    Posts
    25
    Reputation
    10
    Thanks
    13
    My Mood
    Sleepy
    Sorry i was trying some highlights in the text, but is doesn't work.
    Fixed the errror, it should compile fine now..

    But how do you mean:
    "way 2 jack someone's code without any credit. which I notice by this huge giveaway "

    Do you say that i jacked it or people can easly jack it from me?

  4. #4
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    The first one.

    Could you explain this comment:

    Code:
    // Get the <strong class="highlight">dll</strong>'s full path name
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  5. #5
    mwb1234's Avatar
    Join Date
    May 2009
    Gender
    male
    Posts
    460
    Reputation
    7
    Thanks
    65
    Quote Originally Posted by zhaoyun333 View Post
    The first one.

    Could you explain this comment:

    Code:
    // Get the <strong class="highlight">dll</strong>'s full path name
    Actually no he can't.
    This was leeched I believe.

  6. The Following User Says Thank You to mwb1234 For This Useful Post:

    Pronome191 (06-23-2012)

  7. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Tukjedude View Post
    Sorry i was trying some highlights in the text, but is doesn't work.
    Fixed the errror, it should compile fine now..

    But how do you mean:
    "way 2 jack someone's code without any credit. which I notice by this huge giveaway "

    Do you say that i jacked it or people can easily jack it from me?
    I would say its quite obvious that Im saying I think u took the code from someone else, due to the inconsistencies in code like this that comes from copying code from a browser. I usually don't beat around the bush. either you did or you didn't. I don't know u because you haven't been here very long. If I were still mod I would spend the time to find out for sure, but since Im not anymore idc. Just tellin you wat I think.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #7
    Tukjedude's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    The Netherlands
    Posts
    25
    Reputation
    10
    Thanks
    13
    My Mood
    Sleepy
    Yes i did copy some parts of code from a friend of mine.. but it isn't leeched.
    And i copied the the comments too..but i fixed it. if you don't belive just search around the internet..

    btw i fixed the comments

  9. #8
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    leeched ?

  10. #9
    Tukjedude's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    The Netherlands
    Posts
    25
    Reputation
    10
    Thanks
    13
    My Mood
    Sleepy
    Don't you know what leeching is (leech, leeched, leeching) ?

    Steal sombody's code, release it.. that's leeching

  11. #10
    r_arraz's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Your desktop h4x1n up your compooter
    Posts
    370
    Reputation
    16
    Thanks
    76
    My Mood
    Cool
    When I compile and run the universal one I get an error with debugger when entering in process name lol
    [IMG]https://lh4.ggph*****m/_-aCmMp6G0AQ/S4-phW7LRvI/AAAAAAAAALc/3cpKkpjIgUM/s400/display.php.png[/IMG]




  12. #11
    Tukjedude's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    The Netherlands
    Posts
    25
    Reputation
    10
    Thanks
    13
    My Mood
    Sleepy
    Tryed the compiled one ? With wich compiler did you try to compile it ?
    It compiled fine with the latest version of dev c++.....
    I already said the universial on wasnt tested i wrote it directly from my mind.
    Last edited by Tukjedude; 06-01-2010 at 09:01 AM.

  13. #12
    That0n3Guy's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    1,137
    Reputation
    13
    Thanks
    271
    My Mood
    Sleepy
    I'm not trying to be an asshole, but if you're going to steal code, atleast attempt to cover your tracks.

    This is the exact same code that is posted on another website (the only change is the addition of "using namespace std;". The other main difference being that the code was posted on the other website over a year ago. Due to the fact I can't post outside links, I can't say anything further than Google

    Code:
    DWORD pID = GetTargetThreadIDFromProcName("notepad.exe");
    and click the first result. The fourth result is also very similar if not exactly the same.

    You are full of fail, stop trying to be a kewl kid leecher.
    Quotes Hall of Fame

    Quote Originally Posted by martijno0o0 View Post
    ok, i got visual basic 2008 and i got some expirients but i need c++ to make hacks rigth?
    so i need c++ and my question is!?¿? where i dontload it? and is c++ a own program or a update for vb08?
    [IMG]https://i660.photobucke*****m/albums/uu327/EddieTheWin/duff.png[/IMG]

  14. #13
    qwerty01's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    180
    Reputation
    9
    Thanks
    225
    My Mood
    Lurking
    did a little digging and...

    Code:
          #include <windows.h>
          #include <tlhelp32.h>
          #include <shlwapi.h>
          #include <conio.h>
          #include <stdio.h>
    
          #define WIN32_LEAN_AND_MEAN
          #define CREATE_THREAD_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ)
    
          BOOL Inject(DWORD pID, const char * DLL_NAME);
          DWORD GetTargetThreadIDFromProcName(const char * ProcName);
    
          int main(int argc, char * argv[])
          {
          // Retrieve process ID
          DWORD pID = GetTargetThreadIDFromProcName("notepad.exe");
    
          // Get the dll's full path name
          char buf[MAX_PATH] = {0};
          GetFullPathName("Project1.dll", MAX_PATH, buf, NULL);
          printf(buf);
          printf("\n");
    
          // Inject our main dll
          if(!Inject(pID, buf))
          {
          printf("DLL Not Loaded!");
          }else{
          printf("DLL Loaded!");
          }
    
          _getch();
          return 0;
          }
    
          BOOL Inject(DWORD pID, const char * DLL_NAME)
          {
          HANDLE Proc;
          HMODULE hLib;
          char buf[50] = {0};
          LPVOID RemoteString, LoadLibAddy;
    
          if(!pID)
          return false;
    
          Proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
          if(!Proc)
          {
          sprintf(buf, "OpenProcess() failed: %d", GetLastError());
          //MessageBox(NULL, buf, "Loader", MB_OK);
          printf(buf);
          return false;
          }
    
          LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
    
          // Allocate space in the process for our DLL
          RemoteString = (LPVOID)VirtualAllocEx(Proc, NULL, strlen(DLL_NAME), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
    
          // Write the string name of our DLL in the memory allocated
          WriteProcessMemory(Proc, (LPVOID)RemoteString, DLL_NAME, strlen(DLL_NAME), NULL);
    
          // Load our DLL
          CreateRemoteThread(Proc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, NULL);
          CloseHandle(Proc);
          return true;
          }
    
          DWORD GetTargetThreadIDFromProcName(const char * ProcName)
          {
          PROCESSENTRY32 pe;
          HANDLE thSnapShot;
          BOOL retval, ProcFound = false;
    
          thSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
          if(thSnapShot == INVALID_HANDLE_VALUE)
          {
          //MessageBox(NULL, "Error: Unable to create toolhelp snapshot!", "2MLoader", MB_OK);
          printf("Error: Unable to create toolhelp snapshot!");
          return false;
          }
    
          pe.dwSize = sizeof(PROCESSENTRY32);
    
          retval = Process32First(thSnapShot, &pe);
          while(retval)
          {
          if(StrStrI(pe.szExeFile, ProcName))
          {
          return pe.th32ProcessID;
          }
          retval = Process32Next(thSnapShot, &pe);
          }
          return 0;
          }
    look familiar?

    can't post site, but do a quick search if you're interested:
    Code:
    "GetFullPathName("Project1.dll", MAX_PATH, buf, NULL);"

Similar Threads

  1. [Release] Enc DLL Injector v1.3 + Source Code
    By encrypted94 in forum Visual Basic Programming
    Replies: 7
    Last Post: 03-25-2011, 09:16 AM
  2. [Release/Source Code]Some API's made Easier
    By 'Bruno in forum C++/C Programming
    Replies: 5
    Last Post: 08-24-2010, 10:18 AM
  3. [Request] Source Code DLL Injector (Text) - VB 2008 Codes
    By deocute in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-21-2009, 12:16 AM
  4. [Release] ****** DLL Source Code
    By OneWhoSighs in forum WarRock - International Hacks
    Replies: 20
    Last Post: 10-25-2007, 07:41 AM