Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
// KeyString.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "KeyString.h"
#include "KeyStringDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CKeyStringApp
BEGIN_MESSAGE_MAP(CKeyStringApp, CWinApp)
//{{AFX_MSG_MAP(CKeyStringApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CKeyStringApp construction
CKeyStringApp::CKeyStringApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CKeyStringApp object
CKeyStringApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CKeyStringApp initialization
BOOL CKeyStringApp::InitInstance()
{
// Standard initialization
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CKeyStringDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// 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,149 @@
# Microsoft Developer Studio Project File - Name="KeyString" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=KeyString - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "KeyString.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "KeyString.mak" CFG="KeyString - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "KeyString - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "KeyString - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/cpa/Appli/ProtectTools/KeyString", DCPAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "KeyString - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x40c /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "KeyString - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "KeyString - Win32 Release"
# Name "KeyString - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\KeyString.cpp
# End Source File
# Begin Source File
SOURCE=.\KeyString.rc
# End Source File
# Begin Source File
SOURCE=.\KeyStringDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\KeyString.h
# End Source File
# Begin Source File
SOURCE=.\KeyStringDlg.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\fileopen.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon1.ico
# End Source File
# Begin Source File
SOURCE=.\res\KeyString.ico
# End Source File
# Begin Source File
SOURCE=.\res\KeyString.rc2
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,47 @@
// KeyString.h : main header file for the KEYSTRING application
//
#if !defined(AFX_KEYSTRING_H__76A4AFC3_1649_11D2_8890_00609771532D__INCLUDED_)
#define AFX_KEYSTRING_H__76A4AFC3_1649_11D2_8890_00609771532D__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
/////////////////////////////////////////////////////////////////////////////
// CKeyStringApp:
// See KeyString.cpp for the implementation of this class
//
class CKeyStringApp : public CWinApp
{
public:
CKeyStringApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CKeyStringApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CKeyStringApp)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_KEYSTRING_H__76A4AFC3_1649_11D2_8890_00609771532D__INCLUDED_)

View File

@@ -0,0 +1,228 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About KeyString"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "KeyString Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 1998",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
END
IDD_KEYSTRING_DIALOG DIALOGEX 0, 0, 185, 117
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "KeyString Extractor"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&Search",IDB_SEARCH,128,96,50,14
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
96,116,14
EDITTEXT IDE_STRING,7,16,171,14,ES_AUTOHSCROLL
EDITTEXT IDC_FILE,7,43,148,14,ES_AUTOHSCROLL
PUSHBUTTON "Button1",IDB_FILESELECT,160,43,18,14,BS_ICON
LTEXT "Key Sequence",IDC_STATIC,7,7,48,8
LTEXT "Key File",IDC_STATIC,7,34,26,8
EDITTEXT IDC_LOGFILE,7,70,148,14,ES_AUTOHSCROLL
PUSHBUTTON "Button1",IDB_LOGFILESELECT,160,70,18,14,BS_ICON
LTEXT "Log File",IDC_STATIC,7,61,26,8
CONTROL "View .log file",IDC_VIEW,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,100,55,10
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// 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 "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "KeyString MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "KeyString\0"
VALUE "LegalCopyright", "Copyright (C) 1998\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "KeyString.EXE\0"
VALUE "ProductName", "KeyString Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 210
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_KEYSTRING_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 178
TOPMARGIN, 7
BOTTOMMARGIN, 110
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About KeyString..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
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_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\KeyString.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\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 DISCARDABLE "res\\KeyString.ico"
IDI_FILESAVE ICON DISCARDABLE "res\\FileSave.ico"
IDI_FILEOPEN ICON DISCARDABLE "res\\fileopen.ico"
#endif // French (France) 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_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "res\KeyString.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,303 @@
// KeyStringDlg.cpp : implementation file
//
#include "stdafx.h"
#include "KeyString.h"
#include "KeyStringDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// 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()
/////////////////////////////////////////////////////////////////////////////
// CKeyStringDlg dialog
CKeyStringDlg::CKeyStringDlg(CWnd* pParent /*=NULL*/)
: CDialog(CKeyStringDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CKeyStringDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_hFileIcon = AfxGetApp()->LoadIcon(IDI_FILEOPEN );
m_hSaveIcon = AfxGetApp()->LoadIcon(IDI_FILESAVE );
}
void CKeyStringDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CKeyStringDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CKeyStringDlg, CDialog)
//{{AFX_MSG_MAP(CKeyStringDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDB_SEARCH, OnSearch)
ON_BN_CLICKED(IDB_FILESELECT, OnFileselect)
ON_EN_UPDATE(IDC_FILE, OnUpdateFile)
ON_BN_CLICKED(IDB_LOGFILESELECT, OnLogfileselect)
ON_EN_UPDATE(IDC_LOGFILE, OnUpdateLogfile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CKeyStringDlg message handlers
BOOL CKeyStringDlg::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);
}
}
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
((CButton *)GetDlgItem( IDB_FILESELECT ) )->SetIcon( m_hFileIcon );
((CButton *)GetDlgItem( IDB_LOGFILESELECT ) )->SetIcon( m_hSaveIcon );
((CWnd *)GetDlgItem( IDC_PROGRESS ) )->ShowWindow( SW_HIDE );
((CWnd *)GetDlgItem( IDC_VIEW ) )->ShowWindow( SW_SHOW );
((CButton *)GetDlgItem( IDC_VIEW ) )->SetCheck( TRUE );
return TRUE; // return TRUE unless you set the focus to a control
}
void CKeyStringDlg::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 CKeyStringDlg::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();
}
}
HCURSOR CKeyStringDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CKeyStringDlg::OnFileselect()
{
CFileDialog oFileDlg( TRUE );
oFileDlg.DoModal();
m_szFileName = oFileDlg.GetPathName();
GetDlgItem( IDC_FILE )->SetWindowText( m_szFileName );
}
void InsertTabs( FILE * pFile, int Nb )
{
int i;
for( i=0 ; i<Nb ; i++ )
fprintf( pFile, " " );
}
void CKeyStringDlg::OnSearch()
{
FILE * pDataFile;
FILE * pLogFile;
char szSequence[ 256 ];
long d_lPositions[ 256 ];
char iSeqLength, iSeqPos;
long iPos, iCpt;
CProgressCtrl * pProgress;
//--- Opening files ---
if( pDataFile = fopen( m_szFileName, "rb" ) )
{
if( pLogFile = fopen( m_szLogFileName, "w" ) )
{
((CWnd *) GetDlgItem( IDC_PROGRESS ) )->ShowWindow( SW_SHOW );
((CWnd *) GetDlgItem( IDC_VIEW ) )->ShowWindow( SW_HIDE );
fprintf( pLogFile, "--------------------------------------------\n" );
fprintf( pLogFile, " Key Positions \n" );
fprintf( pLogFile, "--------------------------------------------\n" );
fprintf( pLogFile, "[File ]> %s\n", m_szFileName );
fprintf( pLogFile, "[Key String ]> " );
((CEdit *) GetDlgItem( IDE_STRING ))->GetWindowText( szSequence, 255);
pProgress = ((CProgressCtrl *) GetDlgItem( IDC_PROGRESS ));
iSeqLength = strlen( szSequence );
iPos = 0;
iSeqPos = 0;
pProgress->SetRange( 0, iSeqLength );
fseek( pDataFile, -1, SEEK_END );
iPos = ftell( pDataFile );
while( (iSeqPos < iSeqLength) && (iPos > 0) )
{
if( fgetc( pDataFile ) == szSequence[ iSeqPos ] )
{
fprintf( pLogFile, "%c", szSequence[ iSeqPos ] );
d_lPositions[ iSeqPos ] = iPos;
iSeqPos ++;
pProgress->SetPos( iSeqPos );
}
fseek( pDataFile, -2, SEEK_CUR );
iPos = ftell( pDataFile );
}
fprintf( pLogFile, "\n--------------------------------------------\n" );
fprintf( pLogFile, "\n" );
//--- Creating IA-Like file ---
fprintf( pLogFile, "TestProtection := faux\n" );
for( iCpt = 0 ; iCpt < iSeqLength ; iCpt++ )
{
fprintf( pLogFile, "si ( PRO_LitValeurPositionCle( %i ) = %i )\n", d_lPositions[ iCpt ], szSequence[ iCpt ] );
InsertTabs( pLogFile, iCpt );
fprintf( pLogFile, "alors\t" );
}
fprintf( pLogFile, "TestProtection := vrai\n" );
for( iCpt = iSeqLength ; iCpt > 0 ; iCpt-- )
{
InsertTabs( pLogFile, iCpt-1 );
fprintf( pLogFile, "finsi\n" );
}
if( iSeqPos < iSeqLength )
MessageBox( "Unable to find the full KeyString in file.", "Error", MB_OK | MB_ICONSTOP );
else
MessageBox( "The full KeyString has been found.", "Operation Successful", MB_OK | MB_ICONEXCLAMATION );
fclose( pLogFile );
fclose( pDataFile );
pProgress->SetPos( 0 );
((CWnd *) GetDlgItem( IDC_PROGRESS ) )->ShowWindow( SW_HIDE );
((CWnd *) GetDlgItem( IDC_VIEW ) )->ShowWindow( SW_SHOW );
if( ((CButton *)GetDlgItem( IDC_VIEW ) )->GetCheck() )
ShellExecute( NULL, NULL, "Notepad.exe", m_szLogFileName, NULL, SW_SHOW );
}
}
}
void CKeyStringDlg::OnUpdateFile()
{
((CEdit *)GetDlgItem(IDC_FILE))->GetWindowText( m_szFileName );
}
void CKeyStringDlg::OnLogfileselect()
{
CFileDialog oFileDlg( FALSE, "*.log", "KeyString.log", OFN_OVERWRITEPROMPT, "Log Files (*.log) |*.log| All Files (*.*) |*.*||", NULL );
oFileDlg.DoModal();
m_szLogFileName = oFileDlg.GetPathName();
GetDlgItem( IDC_LOGFILE )->SetWindowText( m_szLogFileName );
}
void CKeyStringDlg::OnUpdateLogfile()
{
((CEdit *)GetDlgItem(IDC_LOGFILE))->GetWindowText( m_szLogFileName );
}

View File

@@ -0,0 +1,58 @@
// KeyStringDlg.h : header file
//
#if !defined(AFX_KEYSTRINGDLG_H__76A4AFC5_1649_11D2_8890_00609771532D__INCLUDED_)
#define AFX_KEYSTRINGDLG_H__76A4AFC5_1649_11D2_8890_00609771532D__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CKeyStringDlg dialog
class CKeyStringDlg : public CDialog
{
// Construction
public:
CKeyStringDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CKeyStringDlg)
enum { IDD = IDD_KEYSTRING_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CKeyStringDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
HICON m_hFileIcon;
HICON m_hSaveIcon;
CString m_szFileName;
CString m_szLogFileName;
// Generated message map functions
//{{AFX_MSG(CKeyStringDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSearch();
afx_msg void OnFileselect();
afx_msg void OnUpdateFile();
afx_msg void OnLogfileselect();
afx_msg void OnUpdateLogfile();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_KEYSTRINGDLG_H__76A4AFC5_1649_11D2_8890_00609771532D__INCLUDED_)

View File

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

View File

@@ -0,0 +1,25 @@
// 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__76A4AFC7_1649_11D2_8890_00609771532D__INCLUDED_)
#define AFX_STDAFX_H__76A4AFC7_1649_11D2_8890_00609771532D__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
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__76A4AFC7_1649_11D2_8890_00609771532D__INCLUDED_)

View File

@@ -0,0 +1,5 @@
SCC = This is a Source Code Control file
[KeyString.dsp]
SCC_Aux_Path = "\\srvprojets-ma\Rayman4_DS\Versions\Rayman4DS\Tools"
SCC_Project_Name = "$/CPA/Appli/ProtectTools/KeyString", YBBAAAAA

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,13 @@
//
// KEYSTRING.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...
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,30 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by KeyString.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_KEYSTRING_DIALOG 102
#define IDR_MAINFRAME 128
#define IDI_FILESAVE 130
#define IDI_FILEOPEN 131
#define IDC_PROGRESS 1000
#define IDB_SEARCH 1001
#define IDE_STRING 1002
#define IDC_FILE 1003
#define IDB_FILESELECT 1004
#define IDC_LOGFILE 1005
#define IDB_LOGFILESELECT 1006
#define IDC_VIEW 1007
// 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 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif