-
-
[旧帖] [求助]:eek: 这个DLL工程无效 0.00雪花
-
发表于: 2010-12-18 21:04 794
-
自己做的个DLL叫“CF自动卡BUG”,C++的,我加载了无效,怎么滴,各位大虾看看,那个keybd_event无效额
#include <windows.h>
HWND hWnd;
HHOOK g;
void c();
void CALLBACK p(HWND hWnd,UINT nMsg,UINT nTimerid,DWORD dwTime)
{
switch(nMsg)
{
case WM_TIMER:c();break;
}
}
void c2()
{
keybd_event(0x11,0,0,0);
keybd_event(0x20,0,0,0);
Sleep(700);
keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
Sleep(700);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(800);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x11,0,0,0);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
void c1()
{
keybd_event(0x11,0,0,0);
keybd_event(0x20,0,0,0);
Sleep(700);
keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
Sleep(700);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(800);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x11,0,0,0);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
LRESULT CALLBACK b(int code,WPARAM wParam,LPARAM lParam)
{
switch(wParam)
{
case VK_F1:c1();break;
case VK_F2:c2();break;
}
return CallNextHookEx(g,code,wParam,lParam);
}
BOOL WINAPI DllMain(
HANDLE hinstDLL,
DWORD dwReason,
LPVOID lpvReserved
)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
SetTimer(NULL,0,800,TIMERPROC(p));
DWORD k=GetWindowThreadProcessId(hWnd,NULL);
g=SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)b,GetModuleHandle("CF自动卡BUG.dll"),k);
break;
}
}
return 1;
}
void c()
{
hWnd=FindWindow(NULL,"CrossFire");
if(hWnd)
{
KillTimer(hWnd,0);
}
}
#include <windows.h>
HWND hWnd;
HHOOK g;
void c();
void CALLBACK p(HWND hWnd,UINT nMsg,UINT nTimerid,DWORD dwTime)
{
switch(nMsg)
{
case WM_TIMER:c();break;
}
}
void c2()
{
keybd_event(0x11,0,0,0);
keybd_event(0x20,0,0,0);
Sleep(700);
keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
Sleep(700);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(800);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x11,0,0,0);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
void c1()
{
keybd_event(0x11,0,0,0);
keybd_event(0x20,0,0,0);
Sleep(700);
keybd_event(0x20,0,KEYEVENTF_KEYUP,0);
Sleep(700);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(300);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x53,0,0,0);
Sleep(300);
keybd_event(0x53,0,KEYEVENTF_KEYUP,0);
Sleep(300);
keybd_event(0x57,0,0,0);
Sleep(800);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x11,0,0,0);
keybd_event(0x11,0,KEYEVENTF_KEYUP,0);
keybd_event(0x57,0,KEYEVENTF_KEYUP,0);
}
LRESULT CALLBACK b(int code,WPARAM wParam,LPARAM lParam)
{
switch(wParam)
{
case VK_F1:c1();break;
case VK_F2:c2();break;
}
return CallNextHookEx(g,code,wParam,lParam);
}
BOOL WINAPI DllMain(
HANDLE hinstDLL,
DWORD dwReason,
LPVOID lpvReserved
)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
SetTimer(NULL,0,800,TIMERPROC(p));
DWORD k=GetWindowThreadProcessId(hWnd,NULL);
g=SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)b,GetModuleHandle("CF自动卡BUG.dll"),k);
break;
}
}
return 1;
}
void c()
{
hWnd=FindWindow(NULL,"CrossFire");
if(hWnd)
{
KillTimer(hWnd,0);
}
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
- [求助]驱动HOOKring0 编译失败 1163
- [求助]驱动编译错误 931
- [求助]OD大虾帮助下!!急!! 639
- [求助]:eek: 这个DLL工程无效 795
- [求助]求高手 886
看原图
赞赏
雪币:
留言: