antispy.cpp
来自「此为本书的配套光盘.本书不但由浅入深地讲解了软件保护技术」· C++ 代码 · 共 54 行
CPP
54 行
/********************************************************************
Copyright (c) Beijing Feitian Technologies
http://www.FTSafe.com
File : AntiSpy.cpp
Created: 2003/11/05
Author: yihai
Purpose: ?
Revision: ?
*********************************************************************/
// AntiSpy.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <conio.h>
int main(int argc, char* argv[])
{
HWND hDesktop = GetDesktopWindow();
HWND hWnd = GetWindow(hDesktop,GW_CHILD);
bool bFound=false;
while(hWnd)
{
LONG lVal = GetWindowLong(hWnd,GWL_USERDATA);
if(lVal == 0x12FEEB76)
{
bFound = true;
printf("SPY++ detected.\n");
char szBuf[MAX_PATH];
GetWindowText(hWnd,szBuf,MAX_PATH);
printf(" %s (hWnd=0x%X)\n",szBuf,hWnd);
//Crash SPYXX here if you want.
/* DWORD dwProcessId;
GetWindowThreadProcessId(hWnd,&dwProcessId);
DebugActiveProcess(dwProcessId); */
getch();
}
hWnd = GetWindow(hWnd,GW_HWNDNEXT);
}
if(!bFound)
printf("no SPY++\n");
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?