튤립 반집성 역방향과 외장(66)
1620 단어 튤립
앞의 몇 과목에서 자체적으로 작성한 원키 지뢰 제거 프로그램과 결합:
void CSingleClickDlg::OnBnClickedButton1()
{
// TODO:
HWND h = ::FindWindowA(" ",NULL);
if(h==0)
{
::MessageBox(0,L" ",0,MB_OK);
return;
}
WORD yx[2];
int high;//
int wide;//
DWORD pid;
GetWindowThreadProcessId(h,&pid);
////////
TOKEN_PRIVILEGES tkp;
HANDLE hToken;
OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,&hToken);
LookupPrivilegeValue(NULL, SE_DEBUG_NAME,&tkp.Privileges[0].Luid); //
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); //
////////
HANDLE hp=OpenProcess(PROCESS_ALL_ACCESS ,false,pid);
if(hp==NULL)
{
::MessageBox(0,L" ",0,MB_OK);
return;
}
ReadProcessMemory(hp,(LPCVOID)0x1005338 , &high,4,&pid);
ReadProcessMemory(hp,(LPCVOID)0x1005334 , &wide,4,&pid);
unsigned int temp;
unsigned int temp1;
int x;
int *addr=(int*)0x1005361;
for(int i=0;i256)
{
temp1 = temp1>>8;
}
x++;
if(temp1==0x10)
{
break;//
}
if(temp1!=143)
{
::SendMessage(h,WM_LBUTTONDOWN,1,*(int*)yx);
::SendMessage(h,WM_LBUTTONUP,0,*(int*)yx);
}
yx[0]=yx[0]+16;
}
}
addr=addr+8;// 4
}
}