Jump to content
Tuts 4 You

1 Screenshot

I coded a keygenme, simple tricks.

I hope you enjoy your time trying to solve this!

#include "pch.h"
#include "framework.h"
#include "MFCApplication2.h"
#include "MFCApplication2Dlg.h"
#include "afxdialogex.h"
#include "C:\Users\sean\Documents\R.C.E Tools\Executable Protectors\Oreans Themida Protectors\Themida 2.4.6\ThemidaSDK\Include\C\ThemidaSDK.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif

#include <mmsystem.h>

#pragma comment (lib, "Winmm.lib")


class CAboutDlg : public CDialogEx
{
public:
	CAboutDlg();

#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_ABOUTBOX };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);  

// 구현입니다.
protected:
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
{
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()

  
CMFCApplication2Dlg::CMFCApplication2Dlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_MFCAPPLICATION2_DIALOG, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMFCApplication2Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CMFCApplication2Dlg, CDialogEx)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()

	ON_EN_CHANGE(IDC_NAME, &CMFCApplication2Dlg::OnEnChangeNAME)
	ON_BN_CLICKED(IDOK, &CMFCApplication2Dlg::OnBnClickedOk)
	ON_BN_CLICKED(IDCLOSE, &CMFCApplication2Dlg::OnBnClickedClose)
END_MESSAGE_MAP()


BOOL CMFCApplication2Dlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();


	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != nullptr)
	{
		BOOL bNameValid;
		CString strAboutMenu;
		bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
		ASSERT(bNameValid);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}

	}

	
	SetIcon(m_hIcon, TRUE);			
	SetIcon(m_hIcon, FALSE);		



	return TRUE;  
}

void CMFCApplication2Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialogEx::OnSysCommand(nID, lParam);
	}
}


void CMFCApplication2Dlg::OnPaint()
{
	if (IsIconic())
	{
		CPaintDC dc(this); 

		SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);

		// 클라이언트 사각형에서 아이콘을 가운데에 맞춥니다.
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// 아이콘을 그립니다.
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialogEx::OnPaint();
	}
}

HCURSOR CMFCApplication2Dlg::OnQueryDragIcon()
{
	return static_cast<HCURSOR>(m_hIcon);
}



void CMFCApplication2Dlg::OnEnChangeNAME()
{

	CString NAME;
	long NAME_LEN;
	GetDlgItemText(IDC_NAME, NAME);
	NAME_LEN = wcslen(NAME.GetString());
	if (NAME_LEN > 0)
	{
		GetDlgItem(IDOK)->EnableWindow(1);
		GetDlgItem(IDC_CODE)->EnableWindow(1);
	}
	else
	{
		GetDlgItem(IDOK)->EnableWindow(0);
		GetDlgItem(IDC_CODE)->EnableWindow(0);
	}
}


int CMFCApplication2Dlg::GetNumInRange(int iStart, int iRange)
{
	return rand() % iRange + iStart;
}
CString CMFCApplication2Dlg::GenCode(CString NAME,int RandomNumber)
{
	unsigned int i = 0;
	size_t name_len = 0;

	CString CODE;
	CString OutPut;

	name_len = wcslen(NAME);
	while (i < name_len)
	{
		
		CODE.Format(_T("%8x"), NAME[i] * NAME[i]* NAME[i] * NAME[i]* NAME[i]*RandomNumber);
		OutPut += CODE;
		i++;
	}
		return OutPut.MakeReverse().MakeUpper();
}

void CMFCApplication2Dlg::OnBnClickedOk()
{

	CString NAME;
	LPWSTR WideCHAR_NAME;
	CString InputCODE;
	CString GennedCode;
	int RandomNumber = 0;

	GetDlgItemText(IDC_NAME, NAME);
	WideCHAR_NAME = (LPWSTR)NAME.GetString();
	GetDlgItemText(IDC_CODE, InputCODE);
	for (RandomNumber == 120; RandomNumber <= 145 ;RandomNumber++)
	{
		GennedCode = GenCode((CString)WideCHAR_NAME, RandomNumber);

		if (GennedCode == InputCODE)
		{
			MessageBox(L"Good!\nCan you Please Write a keygen tutorial for us?", 0);
			break;
		}
	}
		if (GennedCode != InputCODE)
			MessageBox(GennedCode, L"Bad!\n", 0);
}


void CMFCApplication2Dlg::OnBnClickedClose()
{

	this->CloseWindow();
}

  • Like 1

User Feedback

Recommended Comments

There are no comments to display.

×
×
  • Create New...