Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release [C++]DLL Injector
#1
Well,
this a little tool for injecting any DLL in any process.
I know its not a big tool but its my first real "hacking" tool so i upload it.
made with C++
Sooo....here it is

EDIT:

Source code:
PHP Code:
#include <windows.h>
#include <tlhelp32.h>
#include <shlwapi.h>
#include "cus.h"

#define CREATE_THREAD_ACCESS (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ)

using namespace std;


string sProcName;
string sDLLName;

DWORD ProcID;
bool InjectSuccess;
bool hasProcID;

string sDLLStatus;
string sProcessStatus;

charDLLName NULL;
charProcName NULL;

string sEndStatus "Press [F2] to quit";
string sCusInjectStatus "Press [F1] to inject DLL";

bool getProcID(charcPName,DWORD &idAdd);
bool InjectDLL(DWORD pID);
void UI();


int main()
{
    
eigen::central("----------DLL INJECTOR---------");
    
cout << endl;
    
eigen::central("by Tomsen1410");
    
cout << endl;
    
eigen::central("-------------------------------");
    
cout << endl;
    
cout << endl;
    
    
cout << "Type in process name: ";
    
cin >> sProcName;
    
ProcName = new char[sProcName.length()];
    
strcpy(ProcNamesProcName.c_str());
    
    
cout << endl;
    
cout << "Type in the DLL name: ";
    
cin >> sDLLName;
    
DLLName = new char[sDLLName.length()];
    
strcpy(DLLNamesDLLName.c_str());
    
    
sDLLStatus "-";
    
sProcessStatus "-";
    
UI();
    while(!
InjectSuccess){
    
        if(
GetAsyncKeyState(VK_F1))
        {    
            
hasProcID getProcID(ProcName,ProcID);
            
InjectSuccess InjectDLL(ProcID);
            if(
InjectSuccess){sEndStatus "";sCusInjectStatus "";}
            
UI();
            
Sleep(100);
        }
        if(
GetAsyncKeyState(VK_F2))
        {    
            return 
0;
        }
    }
    
Beep(1600,200);
    
UI();
    
cout << endl << endl;
    
cout << "---INJECTED---"<<endl;
    for(
int i=5;i>0;i--){
        
cout << "Closing in " << << endl;
        
Sleep(1000);
    }

    
    return 
0;
}

bool getProcID(charcPName,DWORD &idAdd){

    
bool isHere;
    
PROCESSENTRY32 pe32;
    
HANDLE hSnapShot;

    
hSnapShot CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS0);
    if(
hSnapShot == INVALID_HANDLE_VALUE){return false;}
    
pe32.dwSize sizeof(PROCESSENTRY32);

    
isHere Process32First(hSnapShot,&pe32);

    while(
isHere){

        if(
strcmp(cPName,pe32.szExeFile) == 0){
            
idAdd pe32.th32ProcessID;
            
CloseHandle(hSnapShot);
            
sProcessStatus "--Fine--";
            return 
true;}
        
isHere Process32Next(hSnapShot,&pe32);
        
pe32.dwSize sizeof(PROCESSENTRY32);
    }
    
CloseHandle(hSnapShot);
    
sProcessStatus "Process not found!";


    return 
false;
}

bool InjectDLL(DWORD pID){

   
//check if DLL exists
    
ifstream fDLL(DLLName);
    if(!
fDLL){

            
sDLLStatus "File not found!";
            return 
false;}
    
   
HANDLE Proc;
   
char buf[50]={0};
   
LPVOID RemoteStringLoadLibAddy;

   
Proc OpenProcess(CREATE_THREAD_ACCESSFALSEpID);

   if(!
Proc)
   {    
      return 
false;
   }

   
LoadLibAddy = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
   
RemoteString = (LPVOID)VirtualAllocEx(ProcNULLstrlen(DLLName), MEM_RESERVE|MEM_COMMITPAGE_READWRITE);
   
   
WriteProcessMemory(Proc, (LPVOID)RemoteStringDLLNamestrlen(DLLName), NULL);
   
   
CreateRemoteThread(ProcNULLNULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteStringNULLNULL);   
   
sDLLStatus "--Fine--";
   
CloseHandle(Proc);   
   return 
true;
}

//
void UI(){

    
system("CLS");
    
eigen::central("----------DLL INJECTOR---------");
    
cout << endl;
    
eigen::central("by Tomsen1410");
    
cout << endl;
    
eigen::central("-------------------------------");
    
cout << endl;
    
cout << endl;
    
cout << endl;
    
cout << sCusInjectStatus << endl;
    
cout << sEndStatus << endl << endl;
    
cout << "Process Status: " << sProcessStatus << endl;
    
cout << "DLL Status    : " << sDLLStatus << endl;


And here is the custom header(was jsut for testing) with a custom function to central the text in the console:
PHP Code:
#include <iostream>
#include <string>
#include <fstream>

using namespace std;
namespace 
eigen{
void central(string s){
        
int num 0;
        
int len s.size();
        if(
len 80){
            
num int(len/80);}
        
        
int tmp len;
        
int cur 0;
        
        for(
int i 0<= numi++){

            
            if(
tmp >= 80){
                for(
int q 080;q++){
                    
cur++;
                    
cout << s[q];}
                
tmp -= 80;}

            else{
                
int strt int(40 tmp/2);
                for(
int w 0strtw++){
                    
cout << " ";}
                for(
curcur <= len-1cur++){
                    
cout << s[cur];}
            }
        }
    }


Now have fun Narwhal


Attached Files
.rar   DLLInjector.rar (Size: 11.83 KB / Downloads: 426)
[Image: ctoc.jpg]
Reply

#2
Source ? Big Grin
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
Gonna upload the source tomorrow with tutorial hehe
[Image: ctoc.jpg]
Reply

#4
would be cool if @OrangePL could add this in his 'project'
Reply

#5
lolk will try to make one when I have time


good job @Tomsen1410
[Image: lQDUjba.jpg]
Reply

#6
+rep
Reply

#7
Thx @all...
gonna upload the source when im on ma PC..
and btw @d0h! what does "WURST POWER " mean?

looks like sausage power in german :>
[Image: ctoc.jpg]
Reply

#8
Source attached! Awesome
and updated the exe, cause i accidently attached the debug version
[Image: ctoc.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] FXAA Injector Battlefield 3+Best Settings [Update danoc1 v1.3 Beta] iPaddie 31 64,626 08-30-2013, 00:51
Last Post: Squideh
  [Release] CS Injector Silencemod 14 7,999 11-08-2012, 08:48
Last Post: d0h!
  Help DLL Injector Fails [C++] Tomsen1410 6 5,334 02-24-2012, 14:11
Last Post: Tomsen1410
Brick [Release] [FREE] Optimous dll Injector | Easy to use optimous 5 4,071 02-06-2012, 13:18
Last Post: SuperNovaAO
  [Release] FXAA Injector Battlefield 3 Mod JariZ 6 11,358 01-28-2012, 12:18
Last Post: iPaddie
  Any1 hes working on a mod injector? Mikkelul 9 4,424 07-18-2011, 13:42
Last Post: d0h!

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.