Skip to content

Commit 6daa92a

Browse files
author
dude719
committed
Update to version 1.2.0.0
1 parent 04fac31 commit 6daa92a

14 files changed

+279
-259
lines changed

ReClass/CMainFrame.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ BOOL CMainFrame::OnCmdMsg( UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO
445445
if ((nID >= WM_CLASSMENU) && (nID < (WM_CLASSMENU + WM_MAXITEMS)))
446446
{
447447
pChildClassFrame = STATIC_DOWNCAST( CClassFrame,
448-
CreateNewChild( RUNTIME_CLASS( CClassFrame ),
449-
IDR_ReClass2016TYPE, g_ReClassApp.m_hMDIMenu, g_ReClassApp.m_hMDIAccel ) );
448+
CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, g_ReClassApp.m_hMdiMenu, g_ReClassApp.m_hMdiAccel ) );
450449

451450
pClass = g_ReClassApp.m_Classes[nID - WM_CLASSMENU];
452451

ReClass/DialogAbout.cpp

+32-32
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@
44
// For Utils::GetVersionInfo
55
#pragma comment(lib, "version.lib")
66

7-
CDialogAbout::CDialogAbout() : CDialogEx(CDialogAbout::IDD)
8-
{
7+
CDialogAbout::CDialogAbout( ) : CDialogEx( CDialogAbout::IDD )
8+
{
99
}
1010

11-
BEGIN_MESSAGE_MAP(CDialogAbout, CDialogEx)
12-
END_MESSAGE_MAP()
11+
BEGIN_MESSAGE_MAP( CDialogAbout, CDialogEx )
12+
END_MESSAGE_MAP( )
1313

14-
void CDialogAbout::DoDataExchange(CDataExchange * pDX)
14+
void CDialogAbout::DoDataExchange( CDataExchange * pDX )
1515
{
16-
CDialogEx::DoDataExchange(pDX);
16+
CDialogEx::DoDataExchange( pDX );
1717
}
1818

19-
BOOL CDialogAbout::OnInitDialog()
19+
BOOL CDialogAbout::OnInitDialog( )
2020
{
21-
CDialogEx::OnInitDialog();
22-
23-
CString cstring_temp;
24-
cstring_temp.Format(_T("Build Date: %s - %s"), _T(__DATE__), _T(__TIME__));
25-
SetDlgItemText(IDC_ABOUT_BUILD_DATE, cstring_temp);
26-
CString strReclassVersion = Utils::GetVersionInfo(_T("FileVersion"));
27-
cstring_temp.Format(_T("Version: %s"), strReclassVersion);
28-
SetDlgItemText(IDC_ABOUT_BUILD_VERSION, cstring_temp);
29-
CString authors;
30-
authors.LoadString( IDS_AUTHOR_STRING );
31-
SetDlgItemText( IDC_ABOUT_AUTHORS, authors );
32-
33-
CString strLegalCopyright = Utils::GetVersionInfo(_T("LegalCopyright"));
34-
cstring_temp.Format(_T(
35-
"The MIT License (MIT)\r\n\r\n"
36-
"%s %s\r\n\r\n"
37-
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\n"
38-
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\n"
39-
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
40-
), strLegalCopyright, authors);
41-
SetDlgItemText(IDC_ABOUT_LICENSE, cstring_temp);
42-
43-
SetFocus( );
44-
45-
return TRUE;
21+
CDialogEx::OnInitDialog( );
22+
23+
CString strTemp;
24+
strTemp.Format( _T( "Build Date: %s - %s" ), _T( __DATE__ ), _T( __TIME__ ) );
25+
SetDlgItemText( IDC_ABOUT_BUILD_DATE, strTemp );
26+
CString strReclassVersion = Utils::GetVersionInfo( _T( "FileVersion" ) );
27+
strTemp.Format( _T( "Version: %s" ), strReclassVersion.GetString( ) );
28+
SetDlgItemText( IDC_ABOUT_BUILD_VERSION, strTemp );
29+
CString authors;
30+
authors.LoadString( IDS_AUTHOR_STRING );
31+
SetDlgItemText( IDC_ABOUT_AUTHORS, authors );
32+
33+
CString strLegalCopyright = Utils::GetVersionInfo( _T( "LegalCopyright" ) );
34+
strTemp.Format( _T(
35+
"The MIT License (MIT)\r\n\r\n"
36+
"%s %s\r\n\r\n"
37+
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n\r\n"
38+
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\n"
39+
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n"
40+
), strLegalCopyright, authors );
41+
SetDlgItemText( IDC_ABOUT_LICENSE, strTemp );
42+
43+
SetFocus( );
44+
45+
return TRUE;
4646
}

ReClass/DialogClasses.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ void CDialogClasses::OnOK( )
110110
else
111111
{
112112
CClassFrame* pNewChildClassFrame = STATIC_DOWNCAST( CClassFrame,
113-
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ),
114-
IDR_ReClass2016TYPE, g_ReClassApp.m_hMDIMenu, g_ReClassApp.m_hMDIAccel ) );
113+
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, g_ReClassApp.m_hMdiMenu, g_ReClassApp.m_hMdiAccel ) );
115114
pNewChildClassFrame->SetClass( g_ReClassApp.m_Classes[nItem] );
116115
pNewChildClassFrame->SetTitle( g_ReClassApp.m_Classes[nItem]->GetName( ) );
117116
pNewChildClassFrame->SetWindowText( g_ReClassApp.m_Classes[nItem]->GetName( ) );

ReClass/DialogModules.cpp

+10-12
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ inline int CDialogModules::FindModuleByName( const TCHAR* szName )
136136
return -1;
137137
}
138138

139-
__inline CNodeClass* CDialogModules::GetClassByName( const TCHAR* szClassName )
139+
inline CNodeClass* CDialogModules::GetClassByName( const TCHAR* szClassName )
140140
{
141141
auto iter = std::find_if( g_ReClassApp.m_Classes.begin( ), g_ReClassApp.m_Classes.end( ),
142-
[szClassName] ( const CNodeClass* value ) -> bool { return (value->GetName( ).CompareNoCase( szClassName ) == 0); } );
142+
[szClassName] ( const CNodeClass* pNode ) -> bool { return (pNode->GetName( ).CompareNoCase( szClassName ) == 0); } );
143143
return (iter != g_ReClassApp.m_Classes.end( )) ? *iter : NULL;
144144
}
145145

@@ -178,8 +178,7 @@ void CDialogModules::SetSelected( )
178178
else
179179
{
180180
CClassFrame* pNewChildClassFrame = STATIC_DOWNCAST( CClassFrame,
181-
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ),
182-
IDR_ReClass2016TYPE, g_ReClassApp.m_hMDIMenu, g_ReClassApp.m_hMDIAccel ) );
181+
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, g_ReClassApp.m_hMdiMenu, g_ReClassApp.m_hMdiAccel ) );
183182

184183
pNewChildClassFrame->SetClass( pNewClass );
185184
pNewChildClassFrame->SetTitle( pNewClass->GetName( ) );
@@ -194,14 +193,13 @@ void CDialogModules::SetSelected( )
194193
{
195194
CMainFrame* pMainFrame = static_cast<CMainFrame*>(AfxGetApp( )->m_pMainWnd);
196195
CClassFrame* pChildClassFrame = STATIC_DOWNCAST( CClassFrame,
197-
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ),
198-
IDR_ReClass2016TYPE, g_ReClassApp.m_hMDIMenu, g_ReClassApp.m_hMDIAccel ));
196+
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, g_ReClassApp.m_hMdiMenu, g_ReClassApp.m_hMdiAccel ));
199197

200198
pNewClass = new CNodeClass;
201199
pNewClass->SetName( ClassName );
202200

203201
TCHAR strStart[64];
204-
_stprintf( strStart, _T( "%IX" ), mod.Start );
202+
_stprintf_s( strStart, 64, _T( "%IX" ), mod.Start );
205203
pNewClass->SetOffsetString( strStart );
206204
pNewClass->SetOffset( mod.Start );
207205
pNewClass->m_pChildClassFrame = pChildClassFrame;
@@ -230,12 +228,12 @@ void CDialogModules::SetSelected( )
230228

231229
int CALLBACK CDialogModules::CompareFunction( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort )
232230
{
233-
COMPARESTRUCT* compare = (COMPARESTRUCT*)lParamSort;
234-
if (compare)
231+
LPCOMPARESTRUCT Compare = (LPCOMPARESTRUCT)lParamSort;
232+
if (Compare)
235233
{
236-
CListCtrl* pListCtrl = (CListCtrl*)compare->pListCtrl;
237-
int column = compare->iColumn;
238-
bool ascending = compare->bAscending;
234+
CListCtrl* pListCtrl = (CListCtrl*)Compare->pListCtrl;
235+
int column = Compare->iColumn;
236+
bool ascending = Compare->bAscending;
239237

240238
int item1 = ascending ? static_cast<int>(lParam1) : static_cast<int>(lParam2);
241239
int item2 = ascending ? static_cast<int>(lParam2) : static_cast<int>(lParam1);

ReClass/DialogModules.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ class CDialogModules : public CDialogEx
3737
int FindModuleByName( const TCHAR* szName );
3838
CNodeClass* GetClassByName( const TCHAR* szClassName );
3939

40-
typedef struct COMPARESTRUCT
41-
{
40+
typedef struct _COMPARESTRUCT {
4241
CListCtrl* pListCtrl;
4342
int iColumn;
4443
bool bAscending;
45-
} *LPCOMPARESTRUCT;
44+
} COMPARESTRUCT, *LPCOMPARESTRUCT;
4645

4746
static int CALLBACK CompareFunction( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort );
4847

ReClass/PluginAPI.cpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ LoadPlugins(
6969

7070
PluginSettingDlgFunction = (DLGPROC)GetProcAddress( PluginBase, "PluginSettingsDlg" );
7171

72-
Plugin = new RECLASS_PLUGIN;
72+
Plugin = (PRECLASS_PLUGIN)_aligned_malloc( sizeof( RECLASS_PLUGIN ), 16 );
7373
wcscpy_s( Plugin->FileName, FileData.cFileName );
7474
Plugin->LoadedBase = PluginBase;
7575
Plugin->InitFunction = PluginInitFunction;
@@ -78,17 +78,13 @@ LoadPlugins(
7878

7979
if (PluginInitFunction( &Plugin->Info ))
8080
{
81-
#ifdef UNICODE
82-
Plugin->State = g_ReClassApp.GetProfileInt( L"PluginState", Plugin->Info.Name, 1 ) == 1;
83-
#else
84-
Plugin->State = g_ReClassApp.GetProfileInt( "PluginState", CW2A( Plugin->Info.Name ), 1 ) == 1;
85-
#endif
81+
Plugin->State = g_ReClassApp.GetProfileIntW( L"PluginState", Plugin->Info.Name, 1 ) == 1;
8682

8783
if (Plugin->Info.DialogId == -1)
88-
Plugin->SettingDlgFunction = nullptr;
84+
Plugin->SettingDlgFunction = NULL;
8985

9086
PrintOut( _T( "Loaded plugin %s (%ls version %ls) - %ls" ), FileData.cFileName, Plugin->Info.Name, Plugin->Info.Version, Plugin->Info.About );
91-
if (Plugin->StateChangeFunction != nullptr)
87+
if (Plugin->StateChangeFunction)
9288
Plugin->StateChangeFunction( Plugin->State );
9389

9490
g_LoadedPlugins.push_back( Plugin );
@@ -110,7 +106,7 @@ UnloadPlugins(
110106
for (PRECLASS_PLUGIN Plugin : g_LoadedPlugins)
111107
{
112108
FreeLibrary( Plugin->LoadedBase );
113-
delete Plugin;
109+
_aligned_free( Plugin );
114110
}
115111
g_LoadedPlugins.clear( );
116112
}

ReClass/ReClassEx.cpp

+50-26
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ BOOL CReClassExApp::InitInstance( )
191191
g_ViewFontName = _T( "Terminal" );
192192

193193
HINSTANCE hInst = AfxGetInstanceHandle( );
194-
m_hMDIMenu = ::LoadMenu( hInst, MAKEINTRESOURCE( IDR_ReClass2016TYPE ) );
195-
m_hMDIAccel = ::LoadAccelerators( hInst, MAKEINTRESOURCE( IDR_ReClass2016TYPE ) );
194+
195+
m_hMdiMenu = ::LoadMenu( hInst, MAKEINTRESOURCE( IDR_ReClassExTYPE ) );
196+
m_hMdiAccel = ::LoadAccelerators( hInst, MAKEINTRESOURCE( IDR_ReClassExTYPE ) );
196197

197198
#define PushIcon(id) g_Icons.emplace_back(::LoadIcon(hInst, MAKEINTRESOURCE(id)));
198199
PushIcon( IDI_ICON_OPEN );
@@ -220,26 +221,30 @@ BOOL CReClassExApp::InitInstance( )
220221
PushIcon( IDI_ICON_CAMERA );
221222
#undef PushIcon
222223

223-
CMainFrame* pFrame = new CMainFrame( );
224-
if (!pFrame || !pFrame->LoadFrame( IDR_MAINFRAME ))
224+
CMainFrame* pMainFrame = new CMainFrame( );
225+
if (!pMainFrame || !pMainFrame->LoadFrame( IDR_MAINFRAME ))
225226
return FALSE;
226227

227-
m_pMainWnd = pFrame;
228+
m_pMainWnd = pMainFrame;
228229

229-
pFrame->m_hMenuDefault = m_hMDIMenu;
230-
pFrame->m_hAccelTable = m_hMDIAccel;
230+
pMainFrame->m_hMenuDefault = m_hMdiMenu;
231+
pMainFrame->m_hAccelTable = m_hMdiAccel;
231232

232-
pFrame->ShowWindow( m_nCmdShow );
233-
pFrame->UpdateWindow( );
233+
pMainFrame->ShowWindow( m_nCmdShow );
234+
pMainFrame->UpdateWindow( );
234235

236+
//
235237
// Fix for 4k monitors
238+
//
236239
ResizeMemoryFont( g_FontWidth, g_FontHeight );
237240

238241
g_hProcess = NULL;
239242
g_ProcessID = NULL;
240243
g_AttachedProcessAddress = NULL;
241244

245+
//
242246
// Initialize the Scintilla editor
247+
//
243248
if (!Scintilla_RegisterClasses( m_hInstance ))
244249
{
245250
AfxMessageBox( _T( "Scintilla failed to initiailze" ) );
@@ -273,14 +278,26 @@ BOOL CReClassExApp::InitInstance( )
273278

274279
int CReClassExApp::ExitInstance( )
275280
{
281+
//
282+
// Unload any loaded plugins
283+
//
284+
UnloadPlugins( );
285+
276286
//
277287
// Free resources
278-
if (m_hMDIMenu != NULL)
279-
FreeResource( m_hMDIMenu );
280-
281-
if (m_hMDIAccel != NULL)
282-
FreeResource( m_hMDIAccel );
283-
288+
//
289+
if (m_hMdiMenu != NULL)
290+
{
291+
FreeResource( m_hMdiMenu );
292+
m_hMdiMenu = NULL;
293+
}
294+
295+
if (m_hMdiAccel != NULL)
296+
{
297+
FreeResource( m_hMdiAccel );
298+
m_hMdiAccel = NULL;
299+
}
300+
284301
if (m_pConsole)
285302
{
286303
delete m_pConsole;
@@ -297,10 +314,12 @@ int CReClassExApp::ExitInstance( )
297314

298315
//
299316
// Release Scintilla
317+
//
300318
Scintilla_ReleaseResources( );
301319

302320
//
303321
// Write settings to profile
322+
//
304323
WriteProfileString( _T( "Typedefs" ), _T( "Hex" ), g_tdHex );
305324
WriteProfileString( _T( "Typedefs" ), _T( "Int64" ), g_tdInt64 );
306325
WriteProfileString( _T( "Typedefs" ), _T( "Int32" ), g_tdInt32 );
@@ -352,11 +371,10 @@ int CReClassExApp::ExitInstance( )
352371

353372
WriteProfileInt( _T( "Class Generation" ), _T( "PrivatePadding" ), g_bPrivatePadding );
354373
WriteProfileInt( _T( "Class Generation" ), _T( "ClipboardCopy" ), g_bClipboardCopy );
355-
356-
//
357-
// Unload any loaded plugins
358-
UnloadPlugins( );
359-
374+
375+
//
376+
// Exit application instance.
377+
//
360378
return CWinAppEx::ExitInstance( );
361379
}
362380

@@ -436,10 +454,13 @@ void CReClassExApp::CalcAllOffsets( )
436454
void CReClassExApp::OnFileNew( )
437455
{
438456
CMainFrame* pMainFrame = STATIC_DOWNCAST( CMainFrame, m_pMainWnd );
439-
CClassFrame* pChildClassFrame = STATIC_DOWNCAST( CClassFrame, pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClass2016TYPE, m_hMDIMenu, m_hMDIAccel ) );
440-
CNodeClass* pClass = new CNodeClass;
441-
442-
pClass->m_pChildClassFrame = pChildClassFrame;
457+
458+
CClassFrame* pChildClassFrame = STATIC_DOWNCAST( CClassFrame,
459+
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, m_hMdiMenu, m_hMdiAccel ) );
460+
461+
CNodeClass* pClass = new CNodeClass;
462+
463+
pClass->m_pChildClassFrame = pChildClassFrame;
443464
pChildClassFrame->SetClass( pClass );
444465
g_ReClassApp.m_Classes.push_back( pClass );
445466

@@ -592,8 +613,11 @@ bool CReClassExApp::IsNodeValid( CNodeBase* pCheckNode )
592613
void CReClassExApp::OnButtonNewClass( )
593614
{
594615
CMainFrame* pMainFrame = STATIC_DOWNCAST( CMainFrame, m_pMainWnd );
595-
CClassFrame* pChildClassFrame = STATIC_DOWNCAST( CClassFrame, pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClass2016TYPE, m_hMDIMenu, m_hMDIAccel ) );
596-
CNodeClass* pNewClass = new CNodeClass;
616+
617+
CClassFrame* pChildClassFrame = STATIC_DOWNCAST( CClassFrame,
618+
pMainFrame->CreateNewChild( RUNTIME_CLASS( CClassFrame ), IDR_ReClassExTYPE, m_hMdiMenu, m_hMdiAccel ) );
619+
620+
CNodeClass* pNewClass = new CNodeClass;
597621

598622
pNewClass->SetChildClassFrame( pChildClassFrame );
599623
pNewClass->m_Idx = g_ReClassApp.m_Classes.size( );

ReClass/ReClassEx.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class CReClassExApp : public CWinAppEx
5252

5353
void SaveXML( TCHAR* FileName );
5454

55-
HMENU m_hMDIMenu;
56-
HACCEL m_hMDIAccel;
55+
HMENU m_hMdiMenu;
56+
HACCEL m_hMdiAccel;
5757

5858
UINT m_nAppLook;
5959
BOOL m_bHiColorIcons;

ReClass/ReClassEx.rc

20 Bytes
Binary file not shown.

ReClass/Resource.h

-4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)