• <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>
            春暖花開
            雪化了,花開了,春天來了
            posts - 149,comments - 125,trackbacks - 0

            摘自: http://yulinlu.blog.163.com/blog/static/588156982008113111911557/
            PerformCallBack4

            強制令別的進程調(diào)用某個API,如果這個API是LoadLibrary的話,就相當(dāng)于線程注入了,由coredll.dll提供

            PerformCallBack4函數(shù)的定義:

            [DllImport("coredll.dll")]
            public static extern uint PerformCallBack4(ref CallBackInfo CallBackInfo,
            IntPtr ni_pVoid1,IntPtr ni_pVoid2,IntPtr ni_pVoid3);

            其中函數(shù)的參數(shù)CallBackInfo結(jié)構(gòu)定義:
            public struct CallBackInfo
            {
            public IntPtr hProc; //遠程的目標進程
            public IntPtr pfn; //指向遠程目標進程的函數(shù)地址的指針
            public IntPtr pvArg0; //函數(shù)的需要的第一個參數(shù)
            }

            而PerformCallback4的 ni_pVoid1、ni_pVoid2、ni_pVoid3為傳遞到遠程目標進程執(zhí)行函數(shù)的其它三個參數(shù)。

            例子:
            /*-------------------------------------------------------------------
               FUNCTION: CallCoredllInProc
               PURPOSE:  CallCoredllInProc uses undocumented method
                PerformCallBack4 to call exported methods from coredll.dll in
                the specified process.
               PARAMETERS:
                HANDLE  p_hProcess - handle to the process, where the call should
                    be made
                LPCTSTR p_pszMethodName - name of method exported from coredll,
                    such as VirtualAlloc, VirtualFree, etc.
                DWORD p_dwParam1, p_dwParam2, p_dwParam3, p_dwParam4 - arguments
                DWORD * p_pdwResult - pointer to the return value
               RETURNS:
                TRUE on success, FALSE on failure
            -------------------------------------------------------------------*/
            BOOL CallCoredllInProc
            (
                HANDLE  p_hProcess,
                LPCTSTR p_pszMethodName,
                DWORD   p_dwParam1, DWORD p_dwParam2,
                DWORD   p_dwParam3, DWORD p_dwParam4,
                DWORD * p_pdwResult)
            {
                HINSTANCE l_hCoreDll = NULL;
                BOOL l_bReturn = FALSE;
                __try
                {
                    //Use undocumented method PerformCallBack4
                    //to call method in NK.EXE.
                    CALLBACKINFO CallbackInfo;
                    CallbackInfo.m_hDestinationProcessHandle = p_hProcess;
                    l_hCoreDll = LoadLibrary(_T("COREDLL"));
                    CallbackInfo.m_pFunction =
                        (FARPROC)GetProcAddress(l_hCoreDll, p_pszMethodName);
                    if(!CallbackInfo.m_pFunction)
                    {
                        /*HTRACE(TG_Error,
                            _T("GetProcAddress(%x, %s) failed. Err %d"),
                            l_hCoreDll, p_pszMethodName, GetLastError());
                        */
                    }
                    else
                    {
                        CallbackInfo.m_pFirstArgument = (LPVOID)p_dwParam1;
                        DWORD l_dwResult = PerformCallBack4
                            (&CallbackInfo, p_dwParam2, p_dwParam3, p_dwParam4);
                        if(p_pdwResult)
                        {
                            *p_pdwResult = l_dwResult;
                        }
                        l_bReturn = TRUE;
                    }
                }
                __except(1)
                {
                    /*
                    HTRACE(TG_Error, _T("Exception in CallCoredllInProc(%s)"),
                        p_pszMethodName);
                    */
                    l_bReturn = FALSE;
                }
                if(l_hCoreDll)
                {
                    FreeLibrary(l_hCoreDll);
                }
                return l_bReturn;
            }//BOOL CallCoredllInProc


            CreateAPISet
            CE6.0以前是個未公開API,不過6.0以后就公開了
            This function creates an API set from the list of functions passed as a parameter.

            Syntax

            HANDLE CreateAPISet(
              char acName[4],
              USHORT cFunctions,
              const PFNVOID *ppfnMethods,
              const ULONGLONG *pu64Sig
            );
            Parameters
            acName
            [in] Name of the API set.

            cFunctions
            [in] Number of functions for this API set.

            ppfnMethods
            [in] Array of functions for the API set.

            pu64Sig
            [in] Array of signatures for the functions.


            Return Value
            A handle to the API set.

            Remarks
            Before any process can become a handle server, the process must create and register a handle-based API set with this function and RegisterAPISet.

            Requirements
            Header pkfuncs.h
            Library coredll.lib
            Windows Embedded CE Windows Embedded CE 6.0 and later
            CE6.0以前在coredll.dll里面有這個函數(shù)


            RegisterAPISet
            CE6.0以前是個未公開API,不過6.0以后就公開了
            This function registers an API set.

            Syntax
            BOOL RegisterAPISet(
              HANDLE hASet,
              DWORD dwSetID
            );

            Parameters
            hASet
            [in] Handle to API set created by the CreateAPISet function.

            dwSetID
            [in] Type of API set. You must perform a bitwise OR operation on this parameter with REGISTER_APISET_TYPE to create a handle-based API set.

            Return Value
            TRUE indicates success. FALSE indicates failure. Call GetLastError to get extended error information.

            Remarks
            Before any process can become a handle server, the process must create and register a handle-based API set with CreateAPISet and RegisterAPISet.

            Requirements
            Header pkfuncs.h
            Library coredll.lib
            Windows Embedded CE Windows Embedded CE 6.0 and later
            CE6.0以前在coredll.dll里面有這個函數(shù)

             

            QueryAPISetID
            根據(jù)名字查詢該API的ID,由coredll.dll提供
            Syntax
            int QueryAPISetID(
              char *pName
            );

            Parameters
            pName
            [in] API的名字

            Return Value
            API的ID

             

            GetAPIAddress
            獲取特定API的特定Method的地址,由coredll.dll提供
            FARPROC GetAPIAddress(
              int setId,
              int iMethod
            );

            Parameters
            setId
            [in] API的ID

            iMethod
            [in] Method的ID

            Return Value
            該Method的地址

             

            GetProcessIndexFromID
            根據(jù)進程的ID計算出進程的序號(這個序號就是進程處于第幾個slot),由coredll.dll提供
            Syntax
            DWORD GetProcessIndexFromID(
              HANDLE hProc
            );

            Parameters
            hProc
            [in] 進程的句柄,這里為什么不是進程的ID而是進程的句柄呢?非常簡單,因為在CE中進程的句柄就是進程的ID!

            Return Value
            進程的序號

            posted on 2009-07-16 16:37 Sandy 閱讀(613) 評論(0)  編輯 收藏 引用 所屬分類: Windows Mobile
            久久无码人妻一区二区三区| aaa级精品久久久国产片| 久久精品国产清自在天天线| 狠狠色伊人久久精品综合网 | 中文成人无码精品久久久不卡| 亚洲精品tv久久久久久久久久| 亚洲中文字幕久久精品无码喷水| 国内精品伊人久久久久av一坑 | 国内精品久久久久影院一蜜桃| 欧美久久精品一级c片片| 日本亚洲色大成网站WWW久久| 欧美大香线蕉线伊人久久| 一本大道久久a久久精品综合| 久久久无码精品亚洲日韩京东传媒| 久久久久99精品成人片欧美| 久久精品这里只有精99品| 久久精品国产亚洲av麻豆色欲| 久久一区二区三区免费| 久久久精品国产免大香伊| 国产一区二区三区久久精品| 久久久久久亚洲精品影院| 国产三级精品久久| 久久精品人人做人人爽97| 欧美大战日韩91综合一区婷婷久久青草| 久久精品国产亚洲AV电影| 久久婷婷午色综合夜啪| 欧美久久久久久精选9999| 久久线看观看精品香蕉国产| 久久综合给合久久狠狠狠97色69| 久久人人爽人人爽人人片AV麻豆| 国产精品天天影视久久综合网| 色婷婷综合久久久久中文一区二区| 亚洲精品国精品久久99热| 久久久精品国产亚洲成人满18免费网站| 伊人久久大香线蕉成人| 99久久精品免费看国产一区二区三区| 久久久噜噜噜久久熟女AA片| 久久久久99精品成人片欧美 | 国内精品久久人妻互换| 国产91色综合久久免费分享| 国内精品久久国产大陆|