能力值:
( LV2,RANK:10 )
|
-
-
2 楼
#include "windows.h"
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
DWORD dwThreadId = GetWindowThreadProcessId(hWnd,NULL);
HANDLE hThread = OpenThread(THREAD_ALL_ACCESS,FALSE,dwThreadId);
TerminateThread(hThread,0);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
用结束任务方式
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
ENDTASK EndTask;
EndTask = (ENDTASK)GetProcAddress(LoadLibrary("user32.dll"),"EndTask");
EndTask(hWnd,TRUE,TRUE);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
发送消息WM_CLOSE
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
PostMessage(hWnd,WM_CLOSE,0,0);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
模拟ALT+F4
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
SetActiveWindow(hWnd);
SetForegroundWindow(hWnd);
keybd_event(VK_MENU,MapVirtualKey(VK_MENU, 0), 0,0);
keybd_event(VK_F4,MapVirtualKey(VK_F4, 0), 0,0);
keybd_event(VK_F4,MapVirtualKey(VK_F4, 0), KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP,0);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
按回车键竟然也可以退出
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
SetActiveWindow(hWnd);
SetForegroundWindow(hWnd);
keybd_event(VK_RETURN,MapVirtualKey(VK_RETURN, 0), 0,0);
keybd_event(VK_RETURN,MapVirtualKey(VK_RETURN, 0), KEYEVENTF_KEYUP,0);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
发送消息,ESC
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
PostMessage(hWnd,WM_KEYDOWN, VK_ESCAPE, 0L);
Sleep(200);
PostMessage(hWnd,WM_KEYUP, VK_ESCAPE, 0L);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
9 楼
发送消息WM_SYSCOMMAND
#include "windows.h"
typedef BOOL (__stdcall *ENDTASK)(HWND hWnd,BOOL fShutDown,BOOL fForce);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
SendMessage(hWnd,WM_SYSCOMMAND,SC_CLOSE,0);
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
10 楼
用鼠标双击标题栏的左边
#include "windows.h" int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
RECT rect;
SetActiveWindow(hWnd);
SetForegroundWindow(hWnd);
GetWindowRect(hWnd,&rect);
SetCursorPos(rect.left+10,rect.top+10);
int i = 0;
Sleep(100);
while(i < 50)
{
if(GetForegroundWindow() == hWnd)
{
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(50);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
break;
}
Sleep(100);
++i;
}
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
11 楼
点关闭
#include "windows.h"
int APIENTRY _tWinMain(__in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in_opt LPSTR lpCmdLine, __in int nShowCmd )
{
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
RECT rect;
SetActiveWindow(hWnd);
SetForegroundWindow(hWnd);
GetWindowRect(hWnd,&rect);
SetCursorPos(rect.right-10,rect.top+10);
int i = 0;
Sleep(100);
while(i < 50)
{
if(GetForegroundWindow() == hWnd)
{
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
break;
}
Sleep(100);
++i;
}
}
return 0;
}
|
能力值:
( LV2,RANK:10 )
|
-
-
12 楼
设置钩子函数,同时向目标进程发消息以激活钩子,钩子代码内用exitprocess退出
exe:
HWND hWnd = ::FindWindow(NULL,"CrackMeApp");
if(hWnd != NULL)
{
DWORD dwThreadId = GetWindowThreadProcessId(hWnd,NULL);
InstHook(TRUE,dwThreadId);
while(WaitForSingleObject(hThread,100) == WAIT_TIMEOUT)
{
PostMessage(hWnd,WM_CHAR,13,0);
}
}
dll:
LRESULT CALLBACK MsgProc(int nCode,WPARAM wParam,LPARAM lParam)
{
if(!bExit)
{
bExit = true;
ExitProcess(0);
}
return CallNextHookEx(gHook,nCode,wParam,lParam);
}
extern "C" __declspec(dllexport) void __stdcall InstHook(BOOL bInst,DWORD dwThread)
{
if(bInst & gHook == NULL)
{
gThread = dwThread;
SetWindowsHookEx(WH_GETMESSAGE,MsgProc,hMod,dwThread);
}
}
|
能力值:
( LV2,RANK:10 )
|
-
-
13 楼
|
能力值:
( LV2,RANK:10 )
|
-
-
14 楼
注入-TerminateProcess,这个API没用过,应当也算是一个新的吧
LRESULT CALLBACK MsgProc(int nCode,WPARAM wParam,LPARAM lParam)
{
if(!bExit)
{
bExit = true;
TerminateProcess(GetCurrentProcess(),0);
}
return CallNextHookEx(gHook,nCode,wParam,lParam);
}
|
|
|