#include <iostream>
#include <Windows.h>
using namespace std;
void bruteForce(HWND hwndName, HWND hwndOutput)
{
wchar_t inputName[5] = L"xxxp";
wchar_t output[10];
cout << "Correct Names:" << endl;
for (int i = 0x61; i < 0x7B; i++)
for (int j = 0x61; j < 0x7B; j++)
for (int k = 0x61; k < 0x7B; k++)
{
inputName[0] = i;
inputName[1] = j;
inputName[2] = k;
SendMessage(hwndName, WM_SETTEXT, 0, (LPARAM)inputName);
SendMessage(hwndOutput, WM_GETTEXT, 10, (LPARAM)output);
if ((char)output[0] != 'W')
wcout << inputName << endl;
}
}
int main() {
cout << "##############################################"<< endl << endl;
cout << "[Reversing.kr] Position Bruteforcer" << endl;
cout << "##############################################" << endl << endl;
HWND hwnd;
wchar_t serial[12] = L"76876-77776";
if ((hwnd = FindWindow(NULL, L"Position")) != NULL)
{
HWND hwndName = FindWindowEx(hwnd, NULL, L"EDIT", NULL);
HWND hwndSerial = FindWindowEx(hwnd, hwndName, L"EDIT", NULL);
HWND hwndOutput = FindWindowEx(hwnd, NULL, L"STATIC", NULL);
SendMessage(hwndSerial, WM_SETTEXT, 0, (LPARAM)serial);
cout << "Bruteforcing for serial# "; wcout << serial << endl;
bruteForce(hwndName, hwndOutput);
}
else
cout << "Position 캡션 감지 실패. 프로그램을 종료합니다" << endl;
system("PAUSE");
return 0;
} |