首页
社区
课程
招聘
[旧帖] 在VC++的IDE里,在这个函数上(按F9)下断点,为什么断不下来? 0.00雪花
发表于: 2010-9-28 10:28 4298

[旧帖] 在VC++的IDE里,在这个函数上(按F9)下断点,为什么断不下来? 0.00雪花

2010-9-28 10:28
4298
下载了一个,APIHOOK的DLL,想学习一下,
但是发现,在VC++的IDE里,在这个函数上(按F9)下断点,为什么断不下来?
LPCTSTR WINAPI DLLGetPubString()是可以断下来,然后,单步步入的。

另外,为什么,要分别JMP到myImmGetCompositionStringA,和myImmGetCompositionStringA?因为,在MSDN中,只有ImmGetCompositionString一个函数。

ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)应该是个回调函数吧,具体,的用法有没有高手用过,能否讲解一下。
先谢谢了。
LONG WINAPI myImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
{
        LONG myReturn=0;
        LONG tempLen=0;
        int StrBufLen=0;
        if (dwIndex==GCS_RESULTSTR && g_HOOKflag)
        {
                memset(g_IMEString,0,256);
                tempLen=255;
                g_myHOOK1.HookStatus(false);
                ImmGetCompositionStringA(hIMC,GCS_RESULTSTR,g_IMEString,tempLen);
                g_myHOOK1.HookStatus(true);
                g_IMEString[tempLen]=0;
                if (lstrcmp(g_IMEString,g_StringBuf1)!=0)
                {
                        memset(g_StringBuf1,0,256);
                        lstrcpy(g_StringBuf1,g_IMEString);
                        SendMessage(g_hMainhWnd,WM_HXWDLLWX_QQBTX,0,0);
                        memset(g_StringBuf2,0,256);
                        lstrcpy(g_StringBuf2,g_IMEString);
                }
                if (lpBuf==NULL || dwBufLen==0)
                {
                        myReturn=lstrlen(g_StringBuf2);
                }
                else
                {
                        StrBufLen=lstrlen(g_StringBuf2);
                        memset(lpBuf,0,dwBufLen);
                        if (dwBufLen>=StrBufLen)
                        {
                                dwBufLen=StrBufLen;
                                myReturn=StrBufLen;
                        }
                        else
                        {
                                myReturn=0;
                        }
                        memcpy(lpBuf,g_StringBuf2,dwBufLen);
                }
        }
        else
        {
                g_myHOOK1.HookStatus(false);
                myReturn=ImmGetCompositionStringA(hIMC,dwIndex,lpBuf,dwBufLen);
                g_myHOOK1.HookStatus(true);
        }
        return myReturn;
}

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 3496
活跃值: (749)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
还有,那个转换的WCharToMByte((wchar_t *)g_StringBuf1,g_IMEString,256),在myImmGetCompositionStringW有,而在myImmGetCompositionStringA就不用了?

LONG WINAPI myImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
{
        LONG myReturn=0;
        LONG tempLen=0;
        int StrBufLen=0;
        if (dwIndex==GCS_RESULTSTR && g_HOOKflag)
        {
                memset(g_IMEString,0,256);
                tempLen=254;
                g_myHOOK2.HookStatus(false);
                ImmGetCompositionStringW(hIMC,GCS_RESULTSTR,g_IMEString,tempLen);
                g_myHOOK2.HookStatus(true);
                g_IMEString[254]=0;
                g_IMEString[255]=0;
                if (lstrcmpW((wchar_t *)g_IMEString,(wchar_t *)g_StringBuf1)!=0)
                {
                        memset(g_StringBuf1,0,256);
                        lstrcpyW((wchar_t *)g_StringBuf1,(wchar_t *)g_IMEString);
                        WCharToMByte((wchar_t *)g_StringBuf1,g_IMEString,256);
                        SendMessage(g_hMainhWnd,WM_HXWDLLWX_QQBTX,0,0);
                        memset(g_StringBuf2,0,256);
                        MByteToWChar(g_IMEString,(wchar_t *)g_StringBuf2,128);
                }
                if (lpBuf==NULL || dwBufLen==0)
                {
                        myReturn=lstrlenW((wchar_t *)g_StringBuf2)*2;
                }
                else
                {
                        StrBufLen=lstrlenW((wchar_t *)g_StringBuf2)*2;
                        memset(lpBuf,0,dwBufLen);
                        if (dwBufLen>=StrBufLen)
                        {
                                dwBufLen=StrBufLen;
                                myReturn=StrBufLen;
                        }
                        else
                        {
                                myReturn=0;
                        }
                        memcpy(lpBuf,g_StringBuf2,dwBufLen);
                }
        }
        else
        {
                g_myHOOK2.HookStatus(false);
                myReturn=ImmGetCompositionStringW(hIMC,dwIndex,lpBuf,dwBufLen);
                g_myHOOK2.HookStatus(true);
        }
        return myReturn;
}
2010-9-28 10:36
0
雪    币: 998
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
W版本的之所以要WCharToMByte,是因为要照顾g_IMEString,这个是个Multibytes的字符串,而其余的都是unicode字符串。A版本的大家都用Multibytes通信,所以不需要转换。
2010-9-29 00:15
0
雪    币: 3496
活跃值: (749)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
谢谢,明白了一点。但是,为什么在IDE没办法下断点拦截住myImmGetCompositionStringW啊
2010-9-30 20:01
0
游客
登录 | 注册 方可回帖
返回
//