⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 md5keygen.cpp

📁 This algorithm was developed by Professor Ronald L. Rivest of MIT and can be found presented in seve
💻 CPP
字号:
// MD5KeyGen.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "MD5KeyGen.h"
#include "MD5KeyGenDlg.h"

#include <fstream.h>
#include "..\gTools\MD5\md5.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only CMD5KeyGenApp object
CMD5KeyGenApp theApp;


/////////////////////////////////////////////////////////////////////////////
// CMD5KeyGenApp

BEGIN_MESSAGE_MAP(CMD5KeyGenApp, CWinApp)
	//{{AFX_MSG_MAP(CMD5KeyGenApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMD5KeyGenApp construction

CMD5KeyGenApp::CMD5KeyGenApp()
{
	m_pLogFile  = NULL;
}

CMD5KeyGenApp::~CMD5KeyGenApp()
{
	if ( m_pLogFile && m_pLogFile->is_open() )
	{
		m_pLogFile->flush();
		m_pLogFile->close();
	}

	delete m_pLogFile;
	m_pLogFile = NULL;
}


void CMD5KeyGenApp::Report(char *fmt, ...)
{
	char buf[1024];
	int nLength;

	va_list args;

	memset(buf, 0, 1024);

	va_start (args, fmt);
	  nLength = _vsnprintf(buf, 1024, fmt, args);
	va_end (args);

	if ( buf[nLength-1] != '\n' && buf[nLength-1] != '\r' )
		buf[nLength] = '\n';

	OutputDebugString(buf);

	if ( m_pLogFile && m_pLogFile->is_open() )
	{
		char szTime[128], szDate[128];
		CString csMsg;

		_strtime(szTime);
		_strdate(szDate);

		csMsg.Format("[%s::%s] %s", szDate, szTime, buf);

		m_pLogFile->write(csMsg, csMsg.GetLength());
		m_pLogFile->flush();
	}

}						   

/////////////////////////////////////////////////////////////////////////////
// CMD5KeyGenApp initialization

BOOL CMD5KeyGenApp::InitInstance()
{

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	SetRegistryKey(_T("Autumn Systems"));

	CString csLogFile;

	if (  (csLogFile = GetProfileString("", "LogFile", NULL)) == "" )
	{
		csLogFile = "MD5KeyGen.log";
		WriteProfileString("", "LogFile", csLogFile);
	}

	m_pLogFile = new fstream(csLogFile, ios::out|ios::nocreate|ios::ate, filebuf::sh_read);

	CMD5KeyGenDlg dlg;

	m_pMainWnd = &dlg;

	dlg.DoModal();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -