본문 바로가기

reversing/리버싱

작업관리자 응용프로그램 목록 열거

#define WIN32_LEAN_AND_MEAN

#include <windows.h>

#include <stdio.h>


BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)

{

TCHAR windowName[MAX_PATH] = {0,};

TCHAR className[MAX_PATH] = {0,};


if(!GetWindowText(hwnd, windowName, sizeof(windowName)) && 

GetLastError() != ERROR_SUCCESS)

return FALSE;



if(!GetClassName(hwnd, className, sizeof(className)) && 

GetLastError() != ERROR_SUCCESS)

return FALSE;


DWORD exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);

BOOL isVisible = IsWindowVisible(hwnd);

BOOL isToolWindows = (exStyle & WS_EX_TOOLWINDOW);

BOOL isAppWindow = (exStyle & WS_EX_APPWINDOW);

BOOL isOwned = GetWindow(hwnd, GW_OWNER) ? TRUE : FALSE;


if(isVisible &&(isAppWindow || (!isToolWindows && !isOwned)))

{

printf( "Window name = %s\n",windowName);

}


return TRUE;

}


int main(int argc, char* argv[])

{

EnumWindows(EnumWindowsProc, 0);

return 0;

}







'reversing > 리버싱' 카테고리의 다른 글

wget .wgetrc 적용 및 robots.txt 대하여.  (0) 2012.12.07
OllyDbg 다운로드 및 설정  (2) 2011.12.11
abex CrackMe 5  (0) 2010.08.16
abex CreackMe 4 어렵네;;  (0) 2010.08.15
abex CrackMe3  (0) 2010.08.14