Skip to content

Commit 1a0c9a8

Browse files
committed
Removed unnecessary hook and method in debug Console
1 parent cdd29b0 commit 1a0c9a8

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

src/Phobos.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,6 @@ void Phobos::ExeRun()
149149
#endif
150150
}
151151

152-
void Phobos::ExeTerminate()
153-
{
154-
Console::Release();
155-
}
156-
157152
// =============================
158153
// hooks
159154

@@ -173,22 +168,6 @@ DEFINE_HOOK(0x7CD810, ExeRun, 0x9)
173168
return 0;
174169
}
175170

176-
void NAKED _ExeTerminate()
177-
{
178-
// Call WinMain
179-
SET_REG32(EAX, 0x6BB9A0);
180-
CALL(EAX);
181-
PUSH_REG(EAX);
182-
183-
Phobos::ExeTerminate();
184-
185-
// Jump back
186-
POP_REG(EAX);
187-
SET_REG32(EBX, 0x7CD8EF);
188-
__asm {jmp ebx};
189-
}
190-
DEFINE_JUMP(LJMP, 0x7CD8EA, GET_OFFSET(_ExeTerminate));
191-
192171
DEFINE_HOOK(0x52F639, _YR_CmdLineParse, 0x5)
193172
{
194173
GET(char**, ppArgs, ESI);

src/Phobos.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Phobos
1919
static void CloseConfig(CCINIClass*&);
2020

2121
static void ExeRun();
22-
static void ExeTerminate();
2322

2423
//variables
2524
static HANDLE hInstance;

src/Utilities/Console.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ HANDLE Console::ConsoleHandle;
2828

2929
bool Console::Create()
3030
{
31+
if (NULL != ConsoleHandle)
32+
FreeConsole();
33+
3134
if (FALSE == AllocConsole())
3235
return false;
3336

@@ -47,12 +50,6 @@ bool Console::Create()
4750
return true;
4851
}
4952

50-
void Console::Release()
51-
{
52-
if (NULL != ConsoleHandle)
53-
FreeConsole();
54-
}
55-
5653
void Console::SetForeColor(ConsoleColor color)
5754
{
5855
if (NULL == ConsoleHandle)

src/Utilities/Console.h

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class Console
4949
static HANDLE ConsoleHandle;
5050

5151
static bool Create();
52-
static void Release();
5352

5453
template<size_t Length>
5554
constexpr static void Write(const char (&str)[Length])

0 commit comments

Comments
 (0)