Results 1 to 2 of 2
  1. #1
    Sabrina_Ferraz's Avatar
    Join Date
    Dec 2015
    Gender
    female
    Posts
    78
    Reputation
    10
    Thanks
    79

    Angry Win32 Console Application No injects automatic

    Olá amigos estou precisando de ajuda...
    em projeto como COD3RIN AUTO Dll Injector
    Estou fazendo meu projeto apartir de
    Win32 Console Application...

    O grande problema é que após compilado o injector não estar injectando minha DLL
    em BlackShot SEA, sou iniciante em projetos com o Win32 Console Application, obrigado desde já
    a quem puder me ajudar!!!
    Google Tranlate
    Hello friends I need help ...
    project as COD3RIN AUTO Dll Injector
    I'm doing my project starting from
    Win32 Console Application ...

    The big problem is that after the injector compiled not be injecting my DLL
    in BlackShot SEA , I am new to projects with the Win32 Console Application , thanks in advance
    who can help me !!!
    ///////

    Code:
    #include <iostream>
    #include <direct.h>
    #include <windows.h>
    #include <tlhelp32.h>
    using namespace std;

    char* GetCurrentDir ()
    {

    char* szRet = (char*) malloc(MAX_PATH);
    _getcwd(szRet, MAX_PATH);
    return szRet;
    }

    LPCTSTR SzToLPCTSTR (char* szString)
    {

    LPTSTR lpszRet;
    size_t size = strlen(szString) + 1;

    lpszRet = (LPTSTR) malloc(MAX_PATH);
    mbstowcs_s(NULL, lpszRet, size, szString, _TRUNCATE);

    return lpszRet;
    }

    void WaitForProcessToAppear (LPCTSTR lpcszProc, DWORD dwDelay)
    {

    HANDLE hSnap;
    PROCESSENTRY32 peProc;
    BOOL bAppeared = FALSE;

    while(!bAppeared)
    {

    if ((hSnap = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0)) != INVALID_HANDLE_VALUE)
    {
    peProc.dwSize = sizeof(PROCESSENTRY32);
    if (Process32First(hSnap, &peProc))
    while (Process32Next(hSnap, &peProc) && !bAppeared)
    if(!lstrcmp(lpcszProc, peProc.szExeFile))
    bAppeared = TRUE;
    }
    CloseHandle(hSnap);
    Sleep(dwDelay);
    }
    }

    DWORD GetProcessIdByName(LPCTSTR lpcszProc)
    {

    HANDLE hSnap;
    PROCESSENTRY32 peProc;
    DWORD dwRet = -1;

    if((hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) !=INVALID_HANDLE_VALUE)
    {

    peProc.dwSize = sizeof(PROCESSENTRY32);
    if(Process32First(hSnap, &peProc))
    while(Process32Next(hSnap, &peProc))
    if(!lstrcmp(lpcszProc, peProc.szExeFile))
    dwRet = peProc.th32ProcessID;

    }
    CloseHandle(hSnap);
    return dwRet;
    }

    BOOL InjectDll(DWORD dwPid, char* szDllPath)
    {

    DWORD dwMemSize;
    HANDLE hProc;
    LPVOID lpRemoteMem, lpLoadLibrary;
    BOOL bRet = FALSE;

    if((hProc = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_CREATE_THREAD, FALSE, dwPid)) != NULL)
    {
    dwMemSize = strlen(szDllPath) + 1;
    if((lpRemoteMem = VirtualAllocEx(hProc, NULL, dwMemSize, MEM_COMMIT, PAGE_READWRITE)) !=NULL)
    if(WriteProcessMemory(hProc, lpRemoteMem, (LPCVOID) szDllPath, dwMemSize, NULL))
    {
    lpLoadLibrary = GetProcAddress(GetModuleHandleA("Kernel32.dll"), "LoadLibraryA");
    if(CreateRemoteThread(hProc, NULL, 0, (LPTHREAD_START_ROUTINE) lpLoadLibrary, lpRemoteMem, 0, NULL) !=NULL)
    bRet = TRUE;
    }
    }
    CloseHandle(hProc);
    return bRet;
    }

    int main()
    {

    char szProc[MAX_PATH], szDll[MAX_PATH];
    char* szDllPath = (char*)malloc(MAX_PATH);
    LPTSTR lpszProc = NULL;

    for(;
    {

    cout << "Process: BlackShot.exe ";
    cin >> szProc;
    cout << "MPGHDLL.dll: ";
    cin >> szDll;
    szDllPath = GetCurrentDir();
    strcat_s(szDllPath, MAX_PATH, "");
    strcat_s(szDllPath, MAX_PATH, szDll);
    cout << "Aguardando processo..." << endl;
    WaitForProcessToAppear(SzToLPCTSTR(szProc), 100);
    if(InjectDll(GetProcessIdByName(SzToLPCTSTR(szProc )), szDllPath))
    cout << "Injetado com sucesso!" << endl;
    else
    cout << "Falou!" << endl;
    cout << "\n";
    }
    return 0;
    }

  2. #2
    Smoke's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    11,899
    Reputation
    2661
    Thanks
    4,610
    My Mood
    Amazed
    Been over a week since last update/bump, assuming solved.

    /Closed.


    CLICK TO BUY NOW!!


    Quote Originally Posted by Liz View Post
    This is my first vouch, ever. Rapidgator account worked perfectly. Would buy in the future.

Similar Threads

  1. [Release] PlayTheGame ~ The console application!
    By VvITylerIvV in forum C++/C Programming
    Replies: 9
    Last Post: 06-03-2011, 09:20 AM
  2. [TuT] You First C++ Console Application
    By sam22 in forum Programming Tutorials
    Replies: 6
    Last Post: 11-30-2010, 07:56 PM
  3. C++, Making a Console Application
    By -:TKK:-WaSsUp in forum C++/C Programming
    Replies: 7
    Last Post: 10-26-2010, 05:38 AM
  4. C++ console application
    By VvITylerIvV in forum C++/C Programming
    Replies: 39
    Last Post: 08-04-2010, 05:08 AM
  5. What's the point of Console applications?
    By 258456 in forum C++/C Programming
    Replies: 2
    Last Post: 06-05-2010, 03:22 PM