• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            旅途

            如果想飛得高,就該把地平線忘掉

            一份進(jìn)程注入的代碼

            // Injection.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
            //

            #include "stdafx.h"
            #include "Injection.h"
            #ifdef _DEBUG
            #define new DEBUG_NEW
            #endif

            // 唯一的應(yīng)用程序?qū)ο?

            CWinApp theApp;

            using namespace std;

            typedef struct _RemotePara{//參數(shù)結(jié)構(gòu)
            char pMessageBox[12];
            DWORD dwMessageBox;
            }RemotePara;
            //遠(yuǎn)程線程
            DWORD __stdcall ThreadProc (RemotePara *lpPara){
            typedef int (__stdcall *MMessageBoxA)(HWND,LPCTSTR,LPCTSTR,DWORD);//定義MessageBox函數(shù)
            MMessageBoxA myMessageBoxA;
            myMessageBoxA =(MMessageBoxA) lpPara->dwMessageBox ;//得到函數(shù)入口地址
            myMessageBoxA(NULL,lpPara->pMessageBox ,lpPara->pMessageBox,0);//call
            return 0;
            }
            void EnableDebugPriv();//提升應(yīng)用級(jí)調(diào)試權(quán)限

            int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
            {
            const DWORD THREADSIZE=1024*4;
            DWORD byte_write;
            EnableDebugPriv();//提升權(quán)限
            HANDLE hWnd = ::OpenProcess (PROCESS_ALL_ACCESS,FALSE,760);
            if(!hWnd)return 0;
            void *pRemoteThread =::VirtualAllocEx(hWnd,0,THREADSIZE,MEM_COMMIT| MEM_RESERVE,PAGE_EXECUTE_READWRITE);
            if(!pRemoteThread)return 0;
            if(!::WriteProcessMemory(hWnd,pRemoteThread,&ThreadProc,THREADSIZE,0))
            return 0;

            //再付值
            RemotePara myRemotePara;
            ::ZeroMemory(&myRemotePara,sizeof(RemotePara));
            HINSTANCE hUser32 = ::LoadLibrary ("user32.dll");
            myRemotePara.dwMessageBox =(DWORD) ::GetProcAddress (hUser32 , "MessageBoxA");
            strcat(myRemotePara.pMessageBox,"hello\0");
            //寫進(jìn)目標(biāo)進(jìn)程
            RemotePara *pRemotePara =(RemotePara *) ::VirtualAllocEx (hWnd ,0,sizeof(RemotePara),MEM_COMMIT,PAGE_READWRITE);//注意申請(qǐng)空間時(shí)的頁面屬性
            if(!pRemotePara)return 0;
            if(!::WriteProcessMemory (hWnd ,pRemotePara,&myRemotePara,sizeof myRemotePara,0))return 0;

            //啟動(dòng)線程
            HANDLE hThread = ::CreateRemoteThread (hWnd ,0,0,(DWORD (__stdcall *)(void *))pRemoteThread ,pRemotePara,0,&byte_write);
            if(!hThread){
            return 0;
            }
            return 0;
            }

            void EnableDebugPriv( void )
            {
            HANDLE hToken;
            LUID sedebugnamevalue;
            TOKEN_PRIVILEGES tkp;

            if ( ! OpenProcessToken( GetCurrentProcess(),
            TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
            return;
            if ( ! LookupPrivilegevalue( NULL, SE_DEBUG_NAME, &sedebugnamevalue ) ){
            CloseHandle( hToken );
            return;
            }
            tkp.PrivilegeCount = 1;
            tkp.Privileges[0].Luid = sedebugnamevalue;
            tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
            if ( ! AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ) )
            CloseHandle( hToken );
            }

            posted on 2007-07-21 17:45 旅途 閱讀(329) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 深入windows

            久久亚洲国产成人精品性色 | 久久精品国产精品国产精品污| 狠狠色丁香久久婷婷综合| 性高朝久久久久久久久久| 中文字幕乱码久久午夜| 久久99精品久久久久久久不卡| 99久久精品国产一区二区| 亚洲人成电影网站久久| 国产成人久久精品激情 | 久久国产成人精品麻豆| 国产午夜精品久久久久九九| 久久久久久国产精品美女 | 久久久久香蕉视频| 久久精品国产亚洲AV电影| 久久亚洲国产精品五月天婷| 久久久精品2019免费观看| 日韩欧美亚洲综合久久影院Ds | 天天久久狠狠色综合| 久久久国产打桩机| 久久精品视频91| 国产精品一区二区久久精品| 综合久久国产九一剧情麻豆 | 亚洲精品乱码久久久久久按摩 | 青青草原精品99久久精品66| 青青久久精品国产免费看| 国产成人精品久久免费动漫| 国内精品综合久久久40p| 亚洲&#228;v永久无码精品天堂久久| 久久精品亚洲日本波多野结衣| 久久久久人妻一区二区三区| 狠狠色丁香婷婷久久综合五月| 久久伊人中文无码| 久久九九免费高清视频| 91久久精品电影| 情人伊人久久综合亚洲| 久久精品国产久精国产| 亚洲成人精品久久| 国产免费久久精品99久久| 国产精品久久久久…| 精品久久久久久综合日本| 久久国产精品99久久久久久老狼|