Donate Now Goal amount for this month: 95 USD, Received: 20 USD (21%)

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18

  Click here to go to the first staff post in this thread.   Thread: Laser Injector v1.0 source code

  1. #1
    Join Date
    Dec 2006
    Posts
    41
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    43

    Smile Laser Injector v1.0 source code

    Inject your library to a target process, NOT USE CreateRemoteThread() API, so Support Win98, WinMe, Win2000, WinXP, Win2003 or later.

    It can inject your library into running process or process created by your loader,
    and so on... anyway i think it is simple to use.

    If you use these in your project, don't forget credits
    Miguel Feijao, yoda, patrick, Azorbix and me ^_^
    Special credits given to Jeffrey Richter

    i do my learning start at GD, there are so many great src and tuts, i want to give regards to all of you nice people, thank you!

    because of my poor english, so just puts code here( scroll down to project package )

    PHP Code:
    /////////////////////////////////////////////////////////////////////////////////////
    // File        : InjectLibrary.h
    // Author      : liuzewei
    // Date        : 2007.1.17
    // Description : Inject your library to a target process
    //               Support Win98, WinMe, Win2000, WinXP, Win2003 or later
    // Credits     : If you use these in your project, don't forget credits
    //               Miguel Feijao, yoda, patrick, Azorbix and me ^_^
    //               Special credits given to Jeffrey Richter
    /////////////////////////////////////////////////////////////////////////////////////
    #ifndef INJECT_LIBRARY_H
    #define INJECT_LIBRARY_H

    #include <windows.h>

    // Parameter
    // targetName  : target process's exe name, if this name are indeterminate, 
    //               we can use '/'(means or) to space each of possible names
    //               for example, "nameA.exe/nameB.exe/nameC.exe"
    // libraryPath : our library's full path
    //
    // Return Value
    // 0  : inject unsuccessfully
    // 1  : target process was already injected with our library before, so 
    //      just returned but did nothing
    // >1 : inject successfully, this return value is the base address of 
    //      our library in target process
    DWORD InjectLibrary( CONST CHAR *targetName, CONST CHAR *libraryPath );

    #endif 
    PHP Code:
    /////////////////////////////////////////////////////////////////////////////////////
    // File        : InjectLibrary.cpp
    // Author      : liuzewei
    // Date        : 2007.1.17
    // Description : Kernel32 function got dynamically, because not all of these 
    //               functions are available on all OS
    /////////////////////////////////////////////////////////////////////////////////////
    #include "InjectLibrary.h"
    #include <stddef.h>
    #include <tlhelp32.h>

    #pragma pack( 1 ) // Make injectcode are consecutive
    struct InjectCode
    {
        
    BYTE  PushOpc;
        
    DWORD PushAdd;
        
    BYTE  CallOpc;
        
    DWORD CallAdd;
        
    WORD  Jmp_$;
        
    char  LibraryPath[MAX_PATH];
    };
    #pragma pack()

    HANDLE  WINAPI *pCreateToolhelp32Snapshot )( DWORD  dwFlagsDWORD th32ProcessID );
    BOOL    WINAPI *pProcess32First )          ( HANDLE hSnapshotLPPROCESSENTRY32 lppe ); 
    BOOL    WINAPI *pProcess32Next )           ( HANDLE hSnapshotLPPROCESSENTRY32 lppe );
    BOOL    WINAPI *pModule32First )           ( HANDLE hSnapshotLPMODULEENTRY32 lpme ); 
    BOOL    WINAPI *pModule32Next )            ( HANDLE hSnapshotLPMODULEENTRY32 lpme );
    BOOL    WINAPI *pThread32First )           ( HANDLE hSnapshotLPTHREADENTRY32 lpte );
    BOOL    WINAPI *pThread32Next )            ( HANDLE hSnapshotLPTHREADENTRY32 lpte );
    LPVOID  WINAPI *pVirtualAllocEx )          ( HANDLE hProcess,
                                                   
    LPVOID lpAddress,
                                                   
    SIZE_T dwSize,
                                                   
    DWORD  flAllocationType,
                                                   
    DWORD  flProtect
                                                 
    );
    BOOL    WINAPI *pVirtualFreeEx )           ( HANDLE hProcess,
                                                   
    LPVOID lpAddress,
                                                   
    SIZE_T dwSize,
                                                   
    DWORD  dwFreeType
                                                 
    );
    HANDLE  WINAPI *pOpenProcess )             ( DWORD dwDesiredAccess,
                                                   
    BOOL  bInheritHandle,
                                                   
    DWORD dwProcessId
                                                 
    );
    HANDLE  WINAPI *pOpenThread )              ( DWORD dwDesiredAccess,
                                                   
    BOOL  bInheritHandle,
                                                   
    DWORD dwThreadId
                                                 
    );

    // From patrick's vec proof base for cs1.6
    DWORD SearchPatternDWORD startDWORD lengthBYTE *patternCHAR *mask )
    {
        
    BYTE *currentAddress;
        
    BYTE *currentPattern;
        
    CHAR *currentMask;
        for ( 
    DWORD i=0i<lengthi++ )
        {
            
    currentAddress = (BYTE*)(start+i);
            
    currentPattern pattern;
            
    currentMask    mask;
            for ( ; *
    currentMaskcurrentAddress++,currentPattern++,currentMask++ )
            {
                if ( *
    currentMask=='x' && *currentAddress!=*currentPattern )
                    break;
            }
            if ( *
    currentMask == NULL ) return ( start );
        }
        
        return 
    NULL;
    }

    LPVOID WINAPI VirtualAllocEx9xHANDLE hProcessLPVOID lpAddressDWORD dwSizeDWORD flAllocationTypeDWORD flProtect )
    {
        
    LPVOID WINAPI *pVirtualAlloc )( LPVOIDSIZE_TDWORDDWORD );
        *(
    PDWORD)(&pVirtualAlloc) = (DWORD)GetProcAddressLoadLibraryTEXT"kernel32.dll" ) ), "VirtualAlloc" );
        
        return 
    pVirtualAlloclpAddressdwSizeflAllocationType|0x8000000flProtect );          
    }

    BOOL WINAPI VirtualFreeEx9xHANDLE hProcessLPVOID lpAddressDWORD dwSizeDWORD dwFreeType )
    {
        
    BOOL WINAPI *pVirtualFree )( LPVOIDSIZE_TDWORD );
        *(
    PDWORD)(&pVirtualFree) = (DWORD)GetProcAddressLoadLibraryTEXT"kernel32.dll" ) ), "VirtualFree" );
        
        return 
    pVirtualFreelpAddressdwSize,dwFreeType );
    }

    HANDLE WINAPI OpenThread9xDWORD dwDesiredAccessBOOL bInheritHandleDWORD dwThreadId )
    {
        
    // Description : 
        // 1> what System API OpenProcess() do?
        //    1st, check target is really a process
        //    2nd, call undocument system function GetHandle()
        // 2> what our OpenThread9x do?
        //    Just get thread's TDB first, then call GetHandle()
        
    DWORD  processIDobsfucator, *pThreadDataBase;
        
    HANDLE hThread;
        
    HANDLE WINAPI *pInternalOpenProcess )( DWORDBOOLDWORD );
        
        
    processID GetCurrentProcessId();
        
    __asm mov eax,fs:[0x30];
        
    __asm xor eax,processID;
        
    __asm mov obsfucator,eax;
        
        
    pThreadDataBase = ( DWORD* ) ( dwThreadId obsfucator );
        if ( 
    IsBadReadPtrpThreadDataBasesizeof(DWORD) ) || ( ( *pThreadDataBase 0x7 ) != 0x7 ) )
            return 
    NULL;
        
        *(
    PDWORD)(&pInternalOpenProcess) = SearchPattern( (DWORD)pOpenProcess0xFF, (BYTE*)"\xB9\x00\x00\x00\x00""xxxxx" );
        if ( 
    pInternalOpenProcess == NULL )
            return 
    NULL;
        
        
    __asm mov   eaxpThreadDataBase;
        
    __asm push  dwThreadId;
        
    __asm push  bInheritHandle;
        
    __asm push  dwDesiredAccess;
        
    __asm call  pInternalOpenProcess;
        
    __asm mov   hThreadeax;
          
        return 
    hThread;
    }

    BOOL GetKernel32FunctionVOID )
    {
        static 
    BOOL GOT FALSE;
        if( 
    GOT ) return TRUE;
        
        
    // get OS Version
        
    BOOL OSWin98OSWinMeOSWinXP;
        
    OSVERSIONINFO OSVI;
        
    OSVI.dwOSVersionInfoSize sizeofOSVERSIONINFO );
        if ( !
    GetVersionEx( &OSVI ) ) return FALSE;
        
    OSWin98 = ( OSVI.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS && OSVI.dwMajorVersion==&& OSVI.dwMinorVersion<=10 ) ? TRUE FALSE;
        
    OSWinMe = ( OSVI.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS && OSVI.dwMajorVersion==&& OSVI.dwMinorVersion>=90 ) ? TRUE FALSE;
        
    OSWinXP = ( OSVI.dwPlatformId==VER_PLATFORM_WIN32_NT ) ? TRUE FALSE;
        
        
    // get kernel32 function pointers dynamically
        
    HINSTANCE hKernel32 LoadLibraryTEXT"kernel32.dll" ) );
        if ( 
    hKernel32 == NULL ) return FALSE;
           *(
    PDWORD)(&pCreateToolhelp32Snapshot) = (DWORD)GetProcAddresshKernel32"CreateToolhelp32Snapshot" );
        *(
    PDWORD)(&pProcess32First) = (DWORD)GetProcAddresshKernel32"Process32First" );
        *(
    PDWORD)(&pProcess32Next)  = (DWORD)GetProcAddresshKernel32"Process32Next" );
        *(
    PDWORD)(&pModule32First)  = (DWORD)GetProcAddresshKernel32"Module32First" );
        *(
    PDWORD)(&pModule32Next)   = (DWORD)GetProcAddresshKernel32"Module32Next" );
        *(
    PDWORD)(&pThread32First)  = (DWORD)GetProcAddresshKernel32"Thread32First" );
        *(
    PDWORD)(&pThread32Next)   = (DWORD)GetProcAddresshKernel32"Thread32Next" );
        *(
    PDWORD)(&pVirtualAllocEx) = (DWORD)GetProcAddresshKernel32"VirtualAllocEx" );
        *(
    PDWORD)(&pVirtualFreeEx)  = (DWORD)GetProcAddresshKernel32"VirtualFreeEx" );
        *(
    PDWORD)(&pOpenProcess)    = (DWORD)GetProcAddresshKernel32"OpenProcess" );
        *(
    PDWORD)(&pOpenThread)     = (DWORD)GetProcAddresshKernel32"OpenThread" );
        if ( 
    OSWin98 || OSWinMe )
        {
            *(
    PDWORD)(&pVirtualAllocEx) = (DWORD)VirtualAllocEx9x;
            *(
    PDWORD)(&pVirtualFreeEx)  = (DWORD)VirtualFreeEx9x;
        }
        if ( 
    OSWin98 )
            *(
    PDWORD)(&pOpenThread) = (DWORD)OpenThread9x;
        
        return ( 
    GOT = ( pCreateToolhelp32Snapshot
                         
    && pProcess32First
                         
    && pProcess32Next
                         
    && pModule32First 
                         
    && pModule32Next
                         
    && pThread32First
                         
    && pThread32Next
                         
    && pVirtualAllocEx
                         
    && pVirtualFreeEx
                         
    && pOpenProcess
                         
    && pOpenThread
                       
    )
               );
    }

    BOOL CheckPattern( CONST CHAR *targetString, CONST CHAR *sourceString )
    {
        CONST 
    CHAR *index, *i, *j;
        
        for( 
    index=i=targetString; *indexindex++ )
            if ( *
    index == '\\' )
                
    index+1;
            
        for( 
    index=j=sourceString; *indexindex++ )
            if ( *
    index == '\\' )
                
    index+1;
                
        for ( ; *
    && *i++,j++ )
        {
            if ( 
    tolower( *) != tolower( *) )
                return 
    FALSE;
        }
                
        return ( *
    == );
    }

    DWORD GetProcessInfo( CONST CHAR *targetName, CONST CHAR *libraryPathPROCESS_INFORMATION *processInfo )

        CONST 
    DWORD GET_PROCESS_INFO_SUCCESS 2;
        
        
    // interpret parameter targetName
        
    if( targetName==NULL || targetName[0]==)
            return 
    0;
        
    CHAR target[MAX_PATH][MAX_PATH];
        
    DWORD countTarget 0;
        
    DWORD i 00;
        while ( 
    targetName[i] && countTarget<MAX_PATH )
        {
            if ( 
    targetName[i] == '/' )
            {
                
    target[countTarget++][j] = 0;
                
    = -1;
            }
            else
            {
                
    target[countTarget][j] = targetName[i];
            }
            
    i++,j++;
        }
        
    target[countTarget++][j] = 0;
        
        
    // search target's processID
        
    HANDLE hSnapshotProcess pCreateToolhelp32SnapshotTH32CS_SNAPPROCESS);
        if ( 
    hSnapshotProcess == INVALID_HANDLE_VALUE )
            return 
    0;
        
    PROCESSENTRY32 PE32;
        
    PE32.dwSize sizeofPROCESSENTRY32 );
        
    BOOL gotPE32 FALSE;
        if ( 
    pProcess32FirsthSnapshotProcess, &PE32 ) )
        {
            do
            {
                for ( 
    DWORD k=0k<countTargetk++)
                {
                    
    // do not just use stricmp(), because .szExeFile
                    // means target's fullpath when on Win9x
                    
    if ( CheckPatternPE32.szExeFiletarget[k] ) )
                    {
                        
    CloseHandlehSnapshotProcess );
                        
    gotPE32 TRUE;
                        break;
                    }
                }
            } while ( (!
    gotPE32) && pProcess32NexthSnapshotProcess, &PE32 ) );
        }
        if ( !
    gotPE32 )
        {
            
    CloseHandlehSnapshotProcess );
            return 
    0;
        }
        
        
    // check target's loaded module
        
    HANDLE hSnapshotModule pCreateToolhelp32SnapshotTH32CS_SNAPMODULEPE32.th32ProcessID );
        if ( 
    hSnapshotModule == INVALID_HANDLE_VALUE )
            return 
    0;
        
    MODULEENTRY32  ME32;
        
    ME32.dwSize sizeofMODULEENTRY32 );
        if ( 
    pModule32FirsthSnapshotModule, &ME32 ) )
        {
            do
            {
                if ( 
    CheckPatternME32.szExePathlibraryPath ) )
                {    
                    
    // our library was already injected before
                    
    CloseHandlehSnapshotModule );
                    return 
    1;
                }
            } while ( 
    pModule32NexthSnapshotModule, &ME32 ) );
        }
        
        
    // find out one of target's threads
        
    HANDLE hSnapshotThread pCreateToolhelp32SnapshotTH32CS_SNAPTHREAD);
        if ( 
    hSnapshotThread == INVALID_HANDLE_VALUE )
            return 
    0;
        
    THREADENTRY32 TE32;
        
    TE32.dwSize sizeofTHREADENTRY32 );
        
    BOOL gotTE32 FALSE;
        if ( 
    pThread32FirsthSnapshotThread, &TE32 ) )
        {
            do
            {
                if ( 
    TE32.th32OwnerProcessID == PE32.th32ProcessID )
                {
                    
    CloseHandlehSnapshotThread );
                    
    gotTE32 TRUE;
                }
            } while ( (!
    gotTE32) && pThread32NexthSnapshotThread, &TE32 ) );
        }
        if ( !
    gotTE32 )
        {
            
    CloseHandlehSnapshotThread );
            return 
    0;
        }
        
        
    // get target's hProcess and hThread
        
    processInfo->dwProcessId PE32.th32ProcessID;
        
    processInfo->hProcess pOpenProcessPROCESS_ALL_ACCESSFALSEPE32.th32ProcessID );
        
    processInfo->dwThreadId TE32.th32ThreadID;
        
    processInfo->hThread pOpenThreadTHREAD_ALL_ACCESSFALSETE32.th32ThreadID );
        if ( 
    processInfo->hProcess==NULL || processInfo->hThread==NULL )
            return 
    0;
        
        return 
    GET_PROCESS_INFO_SUCCESS;
    }

    DWORD InjectLibrary( CONST CHAR *targetName, CONST CHAR *libraryPath )
    {
        
    PROCESS_INFORMATION processInfo;
        
    InjectCode injectCode;
        
    DWORD      basePointloadLibraryAendPoint;
        
    CONTEXT    orgContextrunContext;
        
    DWORD      libraryBase;
        
        
    // get kernel32 funciton pointers
        
    if ( !GetKernel32Function() )
            return 
    0;
        
        
    // get target's processInfo
        
    DWORD returnValue GetProcessInfotargetNamelibraryPath, &processInfo );
        if ( 
    returnValue==|| returnValue==)
            return 
    returnValue;
        
        
    // initialize injectCode
        
    if ( !( basePoint = (DWORD)pVirtualAllocExprocessInfo.hProcessNULLsizeofInjectCode ), MEM_COMMITPAGE_EXECUTE_READWRITE ) ) )
            return 
    0;
        if ( !( 
    loadLibraryA = (DWORD)GetProcAddressLoadLibraryTEXT"kernel32.dll" ) ), "LoadLibraryA" ) ) )
            return 
    0;
        
    injectCode.PushOpc 0x68;   // 0x68 means push
        
    injectCode.PushAdd basePoint offsetofInjectCodeLibraryPath );
        
    injectCode.CallOpc 0xE8;   // 0xE8 is a relative type call
        
    injectCode.CallAdd loadLibraryA basePoint offsetofInjectCodeJmp_$ );
        
    injectCode.Jmp_$   = 0xFEEB// 0xFEEB means jmp here, loop until we checked
        
    strcpyinjectCode.LibraryPathlibraryPath );
        
    endPoint basePoint offsetofInjectCodeJmp_$ );
        
        
    // writes injectCode to target's process
        
    if ( !WriteProcessMemoryprocessInfo.hProcess, (VOID*)basePoint, &injectCodesizeofInjectCode ), new DWORD ) )
        {
            
    pVirtualFreeExprocessInfo.hProcess, (VOID*)basePointsizeofInjectCode ), MEM_DECOMMIT );
            return 
    0;
        }

        
    // let target's process excute our injectCode
        
    SuspendThreadprocessInfo.hThread );
        
    orgContext.ContextFlags CONTEXT_FULL;
        if ( !
    GetThreadContextprocessInfo.hThread, &orgContext ) )
            return 
    0;
           
    runContext orgContext;
        
    runContext.Eip basePoint;
        if ( !
    SetThreadContextprocessInfo.hThread, &runContext ) )
            return 
    0;  
        
    ResumeThreadprocessInfo.hThread );
        do
        {
            
    Sleep10 );
               
    GetThreadContextprocessInfo.hThread, &runContext );
        }  while ( 
    runContext.Eip != endPoint );
        
    libraryBase runContext.Eax;
        
    SuspendThreadprocessInfo.hThread );
        if ( !
    SetThreadContextprocessInfo.hThread, &orgContext ) )
            return 
    0;
        
    ResumeThreadprocessInfo.hThread );
        
        
    // release resource
        
    pVirtualFreeExprocessInfo.hProcess, (VOID*)basePointsizeofInjectCode ), MEM_DECOMMIT );
        
    CloseHandleprocessInfo.hProcess );
        
    CloseHandleprocessInfo.hThread );
        
        return 
    libraryBase;

    PHP Code:
    /////////////////////////////////////////////////////////////////////////////////////
    // File        : LaserInjector.cpp
    // Author      : liuzewei
    // Date        : 2006.1.12
    // Description : Just make a simple example
    /////////////////////////////////////////////////////////////////////////////////////
    #include "InjectLibrary.h"
    #include "Resource.h"
    #include <stdio.h>

    #define WM_TRAY ( WM_USER+1 )
    NOTIFYICONDATA trayIcon;
    HWND hwnd;

    // target's exe name, changes if you want to inject another program
    CONST CHAR targetName[MAX_PATH] = "cstrike.exe/hl.exe";

    // function declarations
    DWORD WINAPI LaserInjectorThreadLPVOID lpParam );
    VOID TrayIconWPARAM wParamLPARAM lParam );
    LRESULT CALLBACK LaserInjectorDialogHWND hDlgUINT MsgWPARAM wParamLPARAM lParam );

    INT WINAPI WinMainHINSTANCE hInstanceHINSTANCE hPrevInstanceLPSTR lpCmdLineint nShowCmd )
    {
        
    // credits Azorbix
        
    HANDLE handle CreateMutexNULLTRUE"Laser" );
        if ( 
    GetLastError() != ERROR_SUCCESS )
        {
            
    MessageBox(0,"Program was already on running!","LaserInjector",0);
            return 
    0;
        }
        
        
    // inintialize tray icon
        
    trayIcon.cbSize sizeofNOTIFYICONDATA );
        
    trayIcon.uCallbackMessage WM_TRAY;
        
    trayIcon.uFlags NIF_MESSAGE NIF_ICON NIF_TIP;
        
    trayIcon.uID 1;
        
    trayIcon.hIcon LoadIconhInstance, (CHAR*)IDI_LASERINJECTOR );
        
    sprintftrayIcon.szTip"Monitoring..." );
        
        
    // creat injector thread
        
    CreateThreadNULL0LaserInjectorThreadNULL0, new DWORD );
        
        
    // creat injector dialog
        
    DialogBoxhInstanceMAKEINTRESOURCE(IDD_LASERINJECTOR), hwnd, (DLGPROC)LaserInjectorDialog );
        
        return 
    0;
    }

    DWORD WINAPI LaserInjectorThreadLPVOID lpParam )
    {
        
    // get library's path
        
    CHAR mainDllName[MAX_PATH];
        
    GetModuleFileNameNULLmainDllNameMAX_PATH );
        
    mainDllNamestrlenmainDllName ) - ] = 0;
        
    strcatmainDllName"dll" );
        
        
    // check library exists
        
    WIN32_FIND_DATA WFD;
        if ( 
    FindFirstFilemainDllName, &WFD ) == INVALID_HANDLE_VALUE )
        {
            
    CHAR failMsg[512] = { };
            
    sprintffailMsg"couldn't found file:\n\n\"%s\""mainDllName );
            
    MessageBoxNULLfailMsg"LaserInjector");
            exit( 
    );
        }
        
        
    // monitoring target and inject our library
        
    while ( TRUE )
        {
            static 
    interval;
            static 
    returnValue;
            
            
    returnValue InjectLibrarytargetNamemainDllName );
            if ( 
    returnValue == // target is not exist or inject unsuccessfully
                
    interval 10;
            else                      
            {
                
    // inject successfully, just minimize injector window,
                // and keep monitoring target
                
    interval 2000;       
                if ( 
    returnValue 
                    
    PostMessageFindWindowNULL"LaserInjector" ), WM_SYSCOMMANDSC_MINIMIZENULL );
            }
            
            
    Sleepinterval );
        }
        
        return 
    0;
    }

    VOID TrayIconWPARAM wParamLPARAM lParam )
    {
        if ( (
    UINT)lParam == WM_LBUTTONDOWN )
        {
            
    Shell_NotifyIconNIM_DELETE, &trayIcon );
            
    ShowWindow( (HWND)wParamSW_SHOW );
        }
    }

    LRESULT CALLBACK LaserInjectorDialogHWND hDlgUINT MsgWPARAM wParamLPARAM lParam )
    {
        switch ( 
    Msg )
        {
        case 
    WM_INITDIALOG:
            return 
    TRUE;
        case 
    WM_COMMAND:
            if ( 
    LOWORD(wParam) == IDCANCEL 
            {
                
    EndDialoghDlgLOWORD(wParam) );
                return 
    TRUE;
            }
            break;
        case 
    WM_SYSCOMMAND:
            if ( 
    wParam == SC_MINIMIZE )
            {
                
    trayIcon.hWnd hDlg;
                
    Shell_NotifyIconNIM_ADD, &trayIcon );
                
    ShowWindowhDlgSW_HIDE );
                return 
    TRUE;
            }
            break;
        case 
    WM_TRAY:
            
    TrayIcon( (WPARAM)(hDlg), lParam );
            break;
        }
        
        return 
    FALSE;

    thank you ^_^
    Attached Files

  2. The Following User Says Thank You to liuzewei For This Useful Post:

    v3n0m4 (05-15-2010)

  3. #2
    Join Date
    Jun 2003
    Location
    das Land der kalten Herzen
    Posts
    2,755
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Rep Power
    188
    very nice indeed

  4. #3
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    neat stuff thnx

  5. #4
    Join Date
    Jan 2005
    Posts
    1,044
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    111
    nice, it has prettymuch all you need
    < this person is absent at the moment, please direct your call elsewhere >

  6. #5
    Join Date
    Dec 2006
    Location
    The Cliffs of Insanity
    Posts
    87
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    44
    I like this one a lot.

    What's reason for having it sit in the systray after the injection is completed?

  7. #6
    Join Date
    Dec 2006
    Posts
    41
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    43
    Quote Originally Posted by silverfish View Post
    I like this one a lot.

    What's reason for having it sit in the systray after the injection is completed?
    em...when you open the game again you needn't open the injector again.

  8. #7
    Join Date
    Dec 2006
    Location
    The Cliffs of Insanity
    Posts
    87
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    44
    Probably doesn't matter much. I just don't like to give PB anything to look for.

  9. #8
    Join Date
    Jul 2006
    Location
    UK
    Posts
    213
    Thanks
    2
    Thanked 5 Times in 2 Posts
    Rep Power
    55
    Quote Originally Posted by silverfish View Post
    Probably doesn't matter much. I just don't like to give PB anything to look for.
    PB doesnt scan other processes, imagine trying to scan all the running processes and try to work out whether the process is an injector :/ - and even then an injector isn't a cheat, not even necessary cheat related..

    nice source - call me lazy i just use detours.lib (but its good to write it urself and learn about it i know)

    PHP Code:
    BOOL InjectIntoProcess(TCHAR *szExeNameTCHAR *szDllName)
    {
        
    TCHAR szProcessName[MAX_PATH];
        
    TCHAR szDllNameAndPath[MAX_PATH];
        
    DWORD aProcesses[1024], cbcProcesses;
        
    HANDLE hProcess NULL;
        
    HMODULE hMod NULL;
        
    UINT i 0;

        
    // Get the full path to the DLL for later use
        
    GetCurrentDirectory(MAX_PATHszDllNameAndPath);
        
    wcscat(szDllNameAndPath_T("\\"));
        
    wcscat(szDllNameAndPathszDllName);

        
    // Get the list of process identifiers
        
    if(!EnumProcesses(aProcessessizeof(aProcesses), &cb))
            return 
    FALSE;

        
    // Calculate how many process identifiers were returned
        
    cProcesses cb sizeof(DWORD);

        
    // Get the name and process identifier for each process
        
    for(0cProcessesi++)
        {
            
    hProcess OpenProcess(PROCESS_ALL_ACCESSFALSEaProcesses[i]);

            if(
    hProcess)
            {
                if(
    EnumProcessModules(hProcess, &hModsizeof(hMod), &cb))
                {
                    
    GetModuleBaseNameW(hProcesshModszProcessNamesizeof(szProcessName)/sizeof(TCHAR));
                }
                
                if(
    wcscmp(wcslwr(szProcessName), szExeName) == 0)
                {
                    
    // We found the process, inject our DLL
                    
    if(DetourContinueProcessWithDllW(hProcessszDllNameAndPath))
                    {
                        
    CloseHandle(hProcess);
                        return 
    TRUE;
                    }
                }
            }

            
    CloseHandle(hProcess);
        }

        return 
    FALSE;

    So many ideas, so little wallpaper..

  10. The Following User Says Thank You to Sinner For This Useful Post:

    v3n0m4 (05-17-2010)

  11. #9
    Join Date
    Dec 2006
    Posts
    41
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    43
    there are some bugs in this project, i'll release a fixed version after i back home

  12. #10
    Join Date
    Jun 2006
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    that bugs you have found?

    PD: Please disable Enter Key ( App close when key enter has been used )

  13. #11
    Join Date
    Aug 2006
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Made a loader using your InjectLibrary and when injecting i receive this error from hl.exe:

    SteamStartup() failed with error 1: Unkown internal error occured - ?

    Im running on Windows Vista - Ultamit 64-bit edition. I'll keep playing around with it, but if you know the exact problem, then please explain how to fix it.

  14. #12
    Join Date
    Apr 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    thats have a bug in systray... change this: WM_LBUTTONDOWN
    for this: WM_LBUTTONUP

    please add systray menu (exit, about)

    bye

  15. #13
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    You got this to work with other games?

    I need some help by using this @ Silkroad Online:
    http://forum.gamedeception.net/showthread.php?t=10557

  16. #14
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    jojojo este si q anda XD

  17. #15
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Laser Injector v1.0 source code

    Hehe can somebody help me. Its been a while since i worked on my source code but now when i wanted to play again it appears that it doesnt get injected, now it could be my dll too. The question is does this injector still work with hl.exe now in 2009? or can someone provide me with a different yet simple working & proof hl.exe inject.
    greetz

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [COD4] Enable Laser
    By Gunner54 in forum Call of Duty 4
    Replies: 26
    Last Post: 02-20-2010, 01:21 PM
  2. Laser Injector v1.0 updated( source code )
    By liuzewei in forum Public Releases
    Replies: 24
    Last Post: 12-24-2008, 08:46 AM
  3. simple injector with source
    By grn_ni in forum Public Releases
    Replies: 2
    Last Post: 11-04-2008, 03:34 AM
  4. counter-strike source launcher source code for C++
    By darkie4 in forum Tutorial Requests
    Replies: 5
    Last Post: 05-08-2007, 10:13 PM
  5. dll injector source
    By Daru in forum Beginner
    Replies: 3
    Last Post: 06-23-2004, 07:20 PM

Tags for this Thread

Posting Permissions

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