2016-11-19 8 views
0
#include <Windows.h> 
#include <stdio.h> 

void CALLBACK Message() 
{ 
    SleepEx(1000,TRUE); 

    MessageBox(
     NULL, 
     "QueueUserAPC Injection", 
     "Thread", 
     NULL 
    ); 
} 

int main(void) 
{ 
    int i = 0; 
    STARTUPINFO si; 
    PROCESS_INFORMATION pi; 

    if(0) 
     Message(); 

    ZeroMemory(&si, sizeof(si)); 
    si.cb = sizeof(si); 
    ZeroMemory(&pi, sizeof(pi)); 

    // Start the child process. 
    if(!CreateProcess(NULL, // No module name (use command line) 
     "C:\\Documents and Settings\\Administrator\\바탕 화면\\NOTEPAD_bak_org.EXE",  // Command line 

     NULL,   // Process handle not inheritable 

     NULL,   // Thread handle not inheritable 

     FALSE,   // Set handle inheritance to FALSE 

     0x8000004,    // No creation flags 

     NULL,   // Use parent's environment block 

     NULL,   // Use parent's starting directory 

     &si,   // Pointer to STARTUPINFO structure 

     &pi)   // Pointer to PROCESS_INFORMATION structure 
    ) 



    { 
     printf("CreateProcess failed (%d).\n", GetLastError()); 
     return 0; 
    } 



    LPVOID original_p = VirtualAlloc(0,0x6000,0x3000,0x40); 



    ReadProcessMemory(GetCurrentProcess(),(LPCVOID)0x00400000,original_p,0x6000,0); 



    LPVOID target_p = VirtualAllocEx(pi.hProcess,0,0x6000,0x3000,PAGE_EXECUTE_READWRITE); 



    WriteProcessMemory(pi.hProcess,target_p,original_p,0x6000,0); 



    //VirtualFree(original_p,dwsize,0x8000); 



    DWORD Eip = (DWORD) target_p + 0x1000; 



    QueueUserAPC((PAPCFUNC) Eip, pi.hThread, 0); 



    SleepEx(1000,TRUE); 



    ResumeThread(pi.hThread); 





    getchar(); 

    return 0; 

} 

私は他のプロセス注入コード(メッセージボックスコール)を実行したいと思っています。 excuted ..なぜ.. ..?私のApcスレッドが終了しました。どうしてですか?(待ち行列のユーザコードコードの注入..)

私は確かに他のプロセス注入コードをチェック!!

お願いします。

答えて

0

もちろんこのコードは動作しません。自己コードの一部のみを別のプロセスにコピーします。しかし、輸入はどうですか?あなたはこれについて考えますか?再配置?何も処理されません

関連する問題