Restructure repository to include all source folders

Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 20:17:20 +09:00
parent 5d3cd64a25
commit dd97ddec92
11602 changed files with 1446576 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
// AuthHan.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "AuthHan.h"
#include "AuthHanDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAuthHanApp
BEGIN_MESSAGE_MAP(CAuthHanApp, CWinApp)
//{{AFX_MSG_MAP(CAuthHanApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CAuthHanApp construction
CAuthHanApp::CAuthHanApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CAuthHanApp object
CAuthHanApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CAuthHanApp initialization
BOOL CAuthHanApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CAuthHanDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

View File

@@ -0,0 +1,49 @@
// AuthHan.h : main header file for the AUTHHAN application
//
#if !defined(AFX_AUTHHAN_H__9A2BCE45_C0A5_418B_B7DC_02F9002937D2__INCLUDED_)
#define AFX_AUTHHAN_H__9A2BCE45_C0A5_418B_B7DC_02F9002937D2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CAuthHanApp:
// See AuthHan.cpp for the implementation of this class
//
class CAuthHanApp : public CWinApp
{
public:
CAuthHanApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAuthHanApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CAuthHanApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AUTHHAN_H__9A2BCE45_C0A5_418B_B7DC_02F9002937D2__INCLUDED_)

View File

@@ -0,0 +1,239 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// 한국어 resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
#ifdef _WIN32
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
#pragma code_page(949)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 18, 1\r\n"
"#pragma code_page(949)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\AuthHan.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.kor\\afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON "res\\AuthHan.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "AuthHan 정보"
FONT 9, "굴림"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "AuthHan 버전 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2002",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "확인",IDOK,178,7,50,14,WS_GROUP
END
IDD_AUTHHAN_DIALOG DIALOGEX 0, 0, 289, 206
STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "AuthHan"
FONT 10, "굴림", 0, 0, 0x1
BEGIN
EDITTEXT IDC_ACCOUNT,47,35,85,12,ES_AUTOHSCROLL | NOT WS_BORDER,
WS_EX_STATICEDGE
EDITTEXT IDC_PASSWORD,47,47,85,12,ES_PASSWORD | ES_AUTOHSCROLL |
NOT WS_BORDER,WS_EX_STATICEDGE
EDITTEXT IDC_UID_IN,195,42,85,12,ES_AUTOHSCROLL | NOT WS_BORDER,
WS_EX_STATICEDGE
EDITTEXT IDC_ACCOUNT_IN,195,55,85,12,ES_AUTOHSCROLL | NOT
WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "찾기",IDC_FIND,224,73,56,26,BS_FLAT
PUSHBUTTON "UID리스트를 계정으로 변환",IDC_FIND_UID_LIST,196,113,89,
15,BS_FLAT
PUSHBUTTON "계정 리스트를 UID로 변환",IDC_FIND_ACCOUNT_LIST,196,134,
89,15,BS_FLAT
PUSHBUTTON "연결",IDC_CONNECT,4,4,79,14,BS_FLAT
LTEXT "",IDC_LOG,4,159,282,43,0,WS_EX_STATICEDGE
GROUPBOX "인증",IDC_STATIC,4,23,133,82,BS_FLAT
CTEXT "Account",IDC_STATIC,8,35,39,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Password",IDC_STATIC,8,47,39,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
PUSHBUTTON "인증",IDC_AUTH,8,67,66,29,BS_FLAT
CTEXT "",IDC_ID,145,73,75,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
PUSHBUTTON "업데이트",IDC_UPDATE,78,67,54,14,BS_FLAT
GROUPBOX "검색",IDC_STATIC,140,23,145,82,BS_FLAT
CTEXT "UID",IDC_STATIC,145,42,49,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "",IDC_ACCOUNT_OUT,145,86,75,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
CTEXT "Account",IDC_STATIC,145,55,49,12,SS_CENTERIMAGE,
WS_EX_STATICEDGE
PUSHBUTTON "메일 동의",IDC_REG,78,83,54,14,BS_FLAT
CONTROL "배틀로한(ActionRyl) 인증체크",IDC_BATTLERYL_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,8,104,10
EDITTEXT IDC_MD5_PASSWORD,48,118,85,14,ES_PASSWORD |
ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
EDITTEXT IDC_MD5_HASHVAL,48,135,85,14,ES_AUTOHSCROLL |
ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
GROUPBOX "MD5",IDC_STATIC,8,110,155,43
LTEXT "Password",IDC_STATIC,13,121,33,8
LTEXT "MD5 Hash",IDC_STATIC,13,137,33,8
PUSHBUTTON "변환",IDC_MD5_CONVERT,137,119,22,30
END
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "041204B0"
BEGIN
VALUE "FileDescription", "AuthHan MFC 응용 프로그램"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "AuthHan"
VALUE "LegalCopyright", "Copyright (C) 2002"
VALUE "OriginalFilename", "AuthHan.EXE"
VALUE "ProductName", "AuthHan 응용 프로그램"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x412, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_AUTHHAN_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 285
TOPMARGIN, 4
BOTTOMMARGIN, 202
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_ABOUTBOX "AuthHan 정보(&A)..."
END
#endif // 한국어 resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
#ifdef _WIN32
LANGUAGE 18, 1
#pragma code_page(949)
#endif //_WIN32
#include "res\AuthHan.rc2" // non-Microsoft Visual C++ edited resources
#include "l.kor\afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="ks_c_5601-1987"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="AuthHan"
ProjectGUID="{89A2020E-B414-4DEB-A86D-3FE96E28267A}"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../;./;../../RylServerProject;../../RylServerProject/RylServerLibrary;../../RylServerProject/BaseLibrary"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
ExpandAttributedSource="FALSE"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/AuthHan.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1042"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../;./;../../RylServerProject;../../RylServerProject/RylServerLibrary;../../RylServerProject/BaseLibrary"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/AuthHan.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1042"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\AuthHan.cpp">
</File>
<File
RelativePath=".\AuthHanDlg.cpp">
</File>
<File
RelativePath=".\md5c.c">
</File>
<File
RelativePath=".\StdAfx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="stdafx.h"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="stdafx.h"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\AuthHan.h">
</File>
<File
RelativePath=".\AuthHanDlg.h">
</File>
<File
RelativePath=".\global.h">
</File>
<File
RelativePath=".\md5.h">
</File>
<File
RelativePath=".\Resource.h">
</File>
<File
RelativePath=".\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath=".\res\AuthHan.ico">
</File>
<File
RelativePath=".\AuthHan.rc">
</File>
<File
RelativePath=".\res\AuthHan.rc2">
</File>
</Filter>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="AuthHan.rc"/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,555 @@
// AuthHanDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AuthHan.h"
#include "AuthHanDlg.h"
extern "C"
{
#include <stdio.h>
#include "global.h"
#include "md5.h"
}
#include <DB/DBComponent.h>
#include <DB/AuthDBComponent.h>
#include ".\authhandlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
static void MD5Print (unsigned char digest[16], char *output)
{
unsigned int i;
for (i = 0; i < 16; i++)
{
sprintf (output + i * 2, "%02x", digest[i]);
}
}
static void MD5String (char *string, char *output)
{
MD5_CTX context;
unsigned char digest[16];
unsigned int len = strlen (string);
MD5Init (&context);
MD5Update (&context, reinterpret_cast<unsigned char*>(string), len);
MD5Final (digest, &context);
MD5Print (digest, output);
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAuthHanDlg dialog
CAuthHanDlg::CAuthHanDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAuthHanDlg::IDD, pParent)
, m_AccountIn(_T(""))
, m_bBattleRylAuth(FALSE)
, m_szMD5Password(_T(""))
, m_szMD5HashValue(_T(""))
{
//{{AFX_DATA_INIT(CAuthHanDlg)
m_Log = _T("");
m_Account = _T("");
m_Password = _T("");
m_ID = _T("");
m_UID_IN = _T("");
m_Account_Out = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CAuthHanDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAuthHanDlg)
DDX_Text(pDX, IDC_LOG, m_Log);
DDX_Text(pDX, IDC_ACCOUNT, m_Account);
DDX_Text(pDX, IDC_PASSWORD, m_Password);
DDX_Text(pDX, IDC_ID, m_ID);
DDX_Text(pDX, IDC_UID_IN, m_UID_IN);
DDX_Text(pDX, IDC_ACCOUNT_OUT, m_Account_Out);
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_ACCOUNT_IN, m_AccountIn);
DDX_Check(pDX, IDC_BATTLERYL_CHECK, m_bBattleRylAuth);
DDX_Text(pDX, IDC_MD5_PASSWORD, m_szMD5Password);
DDX_Text(pDX, IDC_MD5_HASHVAL, m_szMD5HashValue);
}
BEGIN_MESSAGE_MAP(CAuthHanDlg, CDialog)
//{{AFX_MSG_MAP(CAuthHanDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_CONNECT, OnConnect)
ON_BN_CLICKED(IDC_AUTH, OnAuth)
ON_BN_CLICKED(IDC_UPDATE, OnUpdate)
ON_BN_CLICKED(IDC_FIND, OnFind)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_REG, OnBnClickedReg)
ON_BN_CLICKED(IDC_FIND_UID_LIST, OnBnClickedFindUidList)
ON_BN_CLICKED(IDC_FIND_ACCOUNT_LIST, OnBnClickedFindAccountList)
ON_BN_CLICKED(IDC_MD5_CONVERT, OnBnClickedMd5Convert)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAuthHanDlg message handlers
BOOL CAuthHanDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CAuthHanDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CAuthHanDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
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;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CAuthHanDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CAuthHanDlg::OnConnect()
{
// TODO: Add your control notification handler code here
if(CDBSingleObject::GetInstance().Connect(CDBSingleObject::Class_AuthDB))
{
m_Log = "Connected";
}
else
{
m_Log = "Connected failed";
}
UpdateData(FALSE);
}
typedef struct _ACCOUNT
{
char Account[16];
char Password[16];
}ACCOUNT, *LPACCOUNT;
void CAuthHanDlg::OnAuth()
{
UpdateData();
AuthUserHangame();
}
void CAuthHanDlg::AuthUserHangame(void)
{
UpdateData();
HAN_UID hanUID;
char szPassword[33];
memset(szPassword, 0, sizeof(char) * 33);
MD5String(m_Password.GetBuffer(0), szPassword);
bool bResult = !m_bBattleRylAuth ?
DBComponent::AuthDB::LoginAuthHan(CDBSingleObject::GetInstance(),
m_Account.GetBuffer(0), szPassword, hanUID) :
DBComponent::AuthDB::LoginBattleAuthHan(CDBSingleObject::GetInstance(),
m_Account.GetBuffer(0), szPassword, hanUID);
if(bResult)
{
unsigned long UserID = hanUID.hUID;
if(UserID > 100)
{
m_ID.Format("%d", UserID);
m_Log.Format("H:0x%08x L:0x%08x", hanUID.hUID, hanUID.lUID);
}
else
{
switch(UserID)
{
case 1: m_Log = "password mismatch"; break;
case 2: m_Log = "한게임 사용자가 아니거나 비정상적인 사용자"; break;
case 3: m_Log = "동의한 사용자가 아님"; break;
case 4: m_Log = "연령 미달"; break;
case 5: m_Log = "3회 이상 로그인 실패"; break;
case 6: m_Log = "동의한 사용자이지만 게임을 할 수 없는 상태"; break;
default:
m_Log.Format("기타 에러 : %u : H:0x%08x L:0x%08x", UserID, hanUID.hUID, hanUID.lUID);
break;
}
}
}
else
{
m_Log = CDBSingleObject::GetInstance().GetErrorString();
}
UpdateData(FALSE);
}
void CAuthHanDlg::OnUpdate()
{
UpdateData();
UpdateData(FALSE);
}
void CAuthHanDlg::OnFind()
{
UpdateData();
DWORD UserID = 0;
char UID[16] = "";
char Account[16] = "";
if(0 != m_AccountIn.GetLength())
{
bool bResult = !m_bBattleRylAuth ?
DBComponent::AuthDB::GetUIDByAccount(CDBSingleObject::GetInstance(), m_AccountIn.GetBuffer(0), UID)
: DBComponent::AuthDB::GetBattleUIDByAccount(CDBSingleObject::GetInstance(), m_AccountIn.GetBuffer(0), UID);
if(bResult)
{
m_ID = UID;
m_Account_Out = "";
}
else
{
m_Log = CDBSingleObject::GetInstance().GetErrorString();
}
}
else if(0 != m_UID_IN.GetLength())
{
bool bResult = !m_bBattleRylAuth ?
DBComponent::AuthDB::GetAccountByUID(CDBSingleObject::GetInstance(), atoi(m_UID_IN.GetBuffer(0)), Account)
: DBComponent::AuthDB::GetBattleAccountByUID(CDBSingleObject::GetInstance(), atoi(m_UID_IN.GetBuffer(0)), Account);
if(bResult)
{
m_ID = "";
m_Account_Out = Account;
}
else
{
m_Log = CDBSingleObject::GetInstance().GetErrorString();
}
}
UpdateData(FALSE);
}
void CAuthHanDlg::OnBnClickedReg()
{
UpdateData();
bool bResult = !m_bBattleRylAuth ?
DBComponent::AuthDB::RegRylGameHan(CDBSingleObject::GetInstance(), m_Account.GetBuffer(0), "Y")
: DBComponent::AuthDB::RegBattleRylGameHan(CDBSingleObject::GetInstance(), m_Account.GetBuffer(0), "Y");
m_Log = bResult ? "Query Ok..." : CDBSingleObject::GetInstance().GetErrorString();
UpdateData(FALSE);
}
void CAuthHanDlg::OnBnClickedFindUidList()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
// 1. 읽을 파일을 연다
// 2. 쓸 파일이름을 받아서 연다.
// 3. GetAccountByUID 를 사용하여 하나씩 읽어 온다
// 4. 리스트에 읽어온 결과를 기록한다
// 5. 파일을 닫는다.
UpdateData();
OPENFILENAME openfile;
OPENFILENAME savefile;
char szOpenFileName[MAX_PATH * MAX_PATH] = "";
char szSaveFileName[MAX_PATH] = "";
memset(&openfile, 0, sizeof(OPENFILENAME));
memset(&savefile, 0, sizeof(OPENFILENAME));
openfile.lStructSize = sizeof(OPENFILENAME);
openfile.hwndOwner = m_hWnd;
openfile.lpstrFilter = "All Files(*.*)\0*.*\0";
openfile.lpstrFile = szOpenFileName;
openfile.nMaxFile = MAX_PATH * MAX_PATH;
openfile.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER;
savefile.lStructSize = sizeof(OPENFILENAME);
savefile.hwndOwner = m_hWnd;
savefile.lpstrFilter = "All Files(*.*)\0*.*\0";
savefile.lpstrFile = szSaveFileName;
savefile.nMaxFile = MAX_PATH;
savefile.Flags = OFN_LONGNAMES | OFN_EXPLORER;
bool bResult = false;
if(GetOpenFileName(&openfile))
{
if(GetSaveFileName(&savefile))
{
FILE* readfile = fopen(szOpenFileName, "rt");
if(NULL != readfile)
{
FILE* writefile = fopen(szSaveFileName, "wt");
if(NULL != writefile)
{
const int MAX_BUFFER = 4000;
char szUID[MAX_BUFFER];
char Account[16] = "";
while(fgets(szUID, MAX_BUFFER, readfile))
{
char* stopstring = NULL;
unsigned long dwUID = strtoul(szUID, &stopstring, 10);
if(0 < dwUID)
{
bool bResult = !m_bBattleRylAuth ? DBComponent::AuthDB::GetAccountByUID(CDBSingleObject::GetInstance(), dwUID, Account)
: DBComponent::AuthDB::GetBattleAccountByUID(CDBSingleObject::GetInstance(), dwUID, Account);
if(bResult)
{
fprintf(writefile, "%10d\t%s\n", dwUID, Account);
}
else
{
fprintf(writefile, "%10d\t%s\n", dwUID, CDBSingleObject::GetInstance().GetErrorString());
}
}
Sleep(50);
}
bResult = true;
fclose(writefile);
}
fclose(readfile);
}
}
}
MessageBox(bResult ? "변환이 완료되었습니다." : "변환을 실패하였습니다");
}
void CAuthHanDlg::OnBnClickedFindAccountList()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
UpdateData();
OPENFILENAME openfile;
OPENFILENAME savefile;
char szOpenFileName[MAX_PATH * MAX_PATH] = "";
char szSaveFileName[MAX_PATH] = "";
memset(&openfile, 0, sizeof(OPENFILENAME));
memset(&savefile, 0, sizeof(OPENFILENAME));
openfile.lStructSize = sizeof(OPENFILENAME);
openfile.hwndOwner = m_hWnd;
openfile.lpstrFilter = "All Files(*.*)\0*.*\0";
openfile.lpstrFile = szOpenFileName;
openfile.nMaxFile = MAX_PATH * MAX_PATH;
openfile.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER;
savefile.lStructSize = sizeof(OPENFILENAME);
savefile.hwndOwner = m_hWnd;
savefile.lpstrFilter = "All Files(*.*)\0*.*\0";
savefile.lpstrFile = szSaveFileName;
savefile.nMaxFile = MAX_PATH;
savefile.Flags = OFN_LONGNAMES | OFN_EXPLORER;
bool bResult = false;
if(GetOpenFileName(&openfile))
{
if(GetSaveFileName(&savefile))
{
FILE* readfile = fopen(szOpenFileName, "rt");
if(NULL != readfile)
{
FILE* writefile = fopen(szSaveFileName, "wt");
if(NULL != writefile)
{
const int MAX_BUFFER = 4000;
char szAccount[MAX_BUFFER];
char szUID[16] = "";
while(fgets(szUID, MAX_BUFFER, readfile))
{
char* stopstring = NULL;
bool bResult = !m_bBattleRylAuth ? DBComponent::AuthDB::GetUIDByAccount(CDBSingleObject::GetInstance(), szAccount, szUID)
: DBComponent::AuthDB::GetBattleUIDByAccount(CDBSingleObject::GetInstance(), szAccount, szUID);
if(bResult)
{
fprintf(writefile, "%s\t%s\n", szUID, szAccount);
}
else
{
fprintf(writefile, "%s\t%s\n", szUID, CDBSingleObject::GetInstance().GetErrorString());
}
Sleep(50);
}
bResult = true;
fclose(writefile);
}
fclose(readfile);
}
}
}
MessageBox(bResult ? "변환이 완료되었습니다." : "변환을 실패하였습니다");
}
void CAuthHanDlg::OnBnClickedMd5Convert()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
UpdateData();
char szPassword[33];
memset(szPassword, 0, sizeof(char) * 33);
MD5String(m_szMD5Password.GetBuffer(0), szPassword);
m_szMD5HashValue = szPassword;
UpdateData(FALSE);
}

View File

@@ -0,0 +1,78 @@
// AuthHanDlg.h : header file
//
#if !defined(AFX_AUTHHANDLG_H__D956BA36_044B_41F8_8C63_71ACF469DA91__INCLUDED_)
#define AFX_AUTHHANDLG_H__D956BA36_044B_41F8_8C63_71ACF469DA91__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <RylServerLibrary/DB/DBComponent.h>
/////////////////////////////////////////////////////////////////////////////
// CAuthHanDlg dialog
class CAuthHanDlg : public CDialog
{
// Construction
public:
CAuthHanDlg(CWnd* pParent = NULL); // standard constructor
void AuthUserHangame(void);
// Dialog Data
//{{AFX_DATA(CAuthHanDlg)
enum { IDD = IDD_AUTHHAN_DIALOG };
CString m_Log;
CString m_Account;
CString m_Password;
CString m_ID;
CString m_T1;
CString m_T2;
CString m_UID_IN;
CString m_Account_Out;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAuthHanDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
public:
// Generated message map functions
//{{AFX_MSG(CAuthHanDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnConnect();
afx_msg void OnAuth();
afx_msg void OnUpdate();
afx_msg void OnFind();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg void OnBnClickedReg();
afx_msg void OnBnClickedFindUidList();
afx_msg void OnBnClickedFindAccountList();
private:
CString m_AccountIn;
BOOL m_bBattleRylAuth;
CString m_szMD5Password;
CString m_szMD5HashValue;
afx_msg void OnBnClickedMd5Convert();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AUTHHANDLG_H__D956BA36_044B_41F8_8C63_71ACF469DA91__INCLUDED_)

View File

@@ -0,0 +1,42 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by AuthHan.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_AUTHHAN_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_CONNECT 1000
#define IDC_LOG 1001
#define IDC_ACCOUNT 1002
#define IDC_PASSWORD 1003
#define IDC_AUTH 1004
#define IDC_ID 1005
#define IDC_UPDATE 1006
#define IDC_BUTTON 1007
#define IDC_UID_IN 1008
#define IDC_FIND 1009
#define IDC_ACCOUNT_OUT 1010
#define IDC_ACCOUNT_IN 1011
#define IDC_FIND_UID_LIST 1012
#define IDC_REG 1013
#define IDC_FIND3 1014
#define IDC_FIND_ACCOUNT_LIST 1014
#define IDC_CHECK1 1015
#define IDC_BATTLERYL_CHECK 1015
#define IDC_MD5_PASSWORD 1016
#define IDC_MD5_HASHVAL 1017
#define IDC_BUTTON1 1018
#define IDC_MD5_CONVERT 1018
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1019
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// AuthHan.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,27 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__0EAFCB48_9CA8_4B9A_BF6D_C9048E6747F7__INCLUDED_)
#define AFX_STDAFX_H__0EAFCB48_9CA8_4B9A_BF6D_C9048E6747F7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__0EAFCB48_9CA8_4B9A_BF6D_C9048E6747F7__INCLUDED_)

View File

@@ -0,0 +1,30 @@
/* GLOBAL.H - RSAREF types and constants
*/
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 0 if it has not already
been defined with C compiler flags.
*/
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
returns an empty list.
*/
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif

View File

@@ -0,0 +1,36 @@
/* MD5.H - header file for MD5C.C
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
/* MD5 context. */
typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
void MD5Init (MD5_CTX *);
void MD5Update (MD5_CTX *, unsigned char *, unsigned int);
void MD5Final (unsigned char [16], MD5_CTX *);

View File

@@ -0,0 +1,337 @@
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include "global.h"
#include "md5.h"
/* Constants for MD5Transform routine.
*/
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
static void Encode PROTO_LIST
((unsigned char *, UINT4 *, unsigned int));
static void Decode PROTO_LIST
((UINT4 *, unsigned char *, unsigned int));
static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* F, G, H and I are basic MD5 functions.
*/
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define I(x, y, z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits.
*/
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
Rotation is separate from addition to prevent recomputation.
*/
#define FF(a, b, c, d, x, s, ac) { \
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define GG(a, b, c, d, x, s, ac) { \
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define HH(a, b, c, d, x, s, ac) { \
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define II(a, b, c, d, x, s, ac) { \
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
/* MD5 initialization. Begins an MD5 operation, writing a new context.
*/
void MD5Init (context)
MD5_CTX *context; /* context */
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
*/
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
context->state[3] = 0x10325476;
}
/* MD5 block update operation. Continues an MD5 message-digest
operation, processing another message block, and updating the
context.
*/
void MD5Update (context, input, inputLen)
MD5_CTX *context; /* context */
unsigned char *input; /* input block */
unsigned int inputLen; /* length of input block */
{
unsigned int i, index, partLen;
/* Compute number of bytes mod 64 */
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((UINT4)inputLen << 3))
< ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
/* Transform as many times as possible.
*/
if (inputLen >= partLen) {
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
/* Buffer remaining input */
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)&input[i],
inputLen-i);
}
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
void MD5Final (digest, context)
unsigned char digest[16]; /* message digest */
MD5_CTX *context; /* context */
{
unsigned char bits[8];
unsigned int index, padLen;
/* Save number of bits */
Encode (bits, context->count, 8);
/* Pad out to 56 mod 64.
*/
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
MD5Update (context, PADDING, padLen);
/* Append length (before padding) */
MD5Update (context, bits, 8);
/* Store state in digest */
Encode (digest, context->state, 16);
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)context, 0, sizeof (*context));
}
/* MD5 basic transformation. Transforms state based on block.
*/
static void MD5Transform (state, block)
UINT4 state[4];
unsigned char block[64];
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode (x, block, 64);
/* Round 1 */
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
/* Round 2 */
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
/* Round 3 */
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
/* Round 4 */
II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)x, 0, sizeof (x));
}
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
static void Encode (output, input, len)
unsigned char *output;
UINT4 *input;
unsigned int len;
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (unsigned char)(input[i] & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
static void Decode (output, input, len)
UINT4 *output;
unsigned char *input;
unsigned int len;
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
/* Note: Replace "for loop" with standard memcpy if possible.
*/
static void MD5_memcpy (output, input, len)
POINTER output;
POINTER input;
unsigned int len;
{
unsigned int i;
for (i = 0; i < len; i++)
output[i] = input[i];
}
/* Note: Replace "for loop" with standard memset if possible.
*/
static void MD5_memset (output, value, len)
POINTER output;
int value;
unsigned int len;
{
unsigned int i;
for (i = 0; i < len; i++)
((char *)output)[i] = (char)value;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,13 @@
//
// AUTHHAN.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////