mirror of https://github.com/x64dbg/GleeBug
c++ stuff
This commit is contained in:
parent
208ff45a93
commit
187bdeff1d
|
|
@ -8,13 +8,19 @@ EndProject
|
|||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Debug|x64.Build.0 = Debug|x64
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Release|Win32.Build.0 = Release|Win32
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Release|x64.ActiveCfg = Release|x64
|
||||
{B65A3680-9B6B-44E6-A046-649F94DF9F56}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
#include "Debugger.Core.h"
|
||||
#include <windows.h>
|
||||
|
||||
namespace Debugger
|
||||
{
|
||||
static DebugState state;
|
||||
|
||||
bool Init(const wchar_t* szFilePath,
|
||||
const wchar_t* szCommandLine,
|
||||
const wchar_t* szCurrentDirectory,
|
||||
ProcessInfo* process)
|
||||
{
|
||||
STARTUPINFOW si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
PROCESS_INFORMATION pi;
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
const wchar_t* szFileNameCreateProcess;
|
||||
wchar_t* szCommandLineCreateProcess;
|
||||
if (szCommandLine == NULL || !wcslen(szCommandLine))
|
||||
{
|
||||
szCommandLineCreateProcess = 0;
|
||||
szFileNameCreateProcess = szFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t szCreateWithCmdLine[1024];
|
||||
swprintf_s(szCreateWithCmdLine, L"\"%s\" %s", szFilePath, szCommandLine);
|
||||
szCommandLineCreateProcess = szCreateWithCmdLine;
|
||||
szFileNameCreateProcess = 0;
|
||||
}
|
||||
|
||||
if (!CreateProcessW(szFileNameCreateProcess,
|
||||
szCommandLineCreateProcess,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
DEBUG_PROCESS | CREATE_NEW_CONSOLE,
|
||||
NULL,
|
||||
szCurrentDirectory,
|
||||
&si,
|
||||
&pi))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
state.Process.hProcess = pi.hProcess;
|
||||
state.Process.hThread = pi.hThread;
|
||||
state.Process.ProcessId = pi.dwProcessId;
|
||||
state.Process.MainThreadId = pi.dwThreadId;
|
||||
if (process)
|
||||
*process = state.Process;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Stop()
|
||||
{
|
||||
return !!TerminateProcess(state.Process.hProcess, 0);
|
||||
}
|
||||
|
||||
bool Detach()
|
||||
{
|
||||
return !!DebugActiveProcessStop(state.Process.ProcessId);
|
||||
}
|
||||
|
||||
DebugState* State()
|
||||
{
|
||||
return &state;
|
||||
}
|
||||
};
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef _DEBUGGER_CORE_H
|
||||
#define _DEBUGGER_CORE_H
|
||||
|
||||
#include "_global.h"
|
||||
#include "Debugger.State.h"
|
||||
|
||||
namespace Debugger
|
||||
{
|
||||
bool Init(const wchar_t* szFilePath,
|
||||
const wchar_t* szCommandLine,
|
||||
const wchar_t* szCurrentDirectory,
|
||||
ProcessInfo* process);
|
||||
bool Stop();
|
||||
bool Detach();
|
||||
DebugState* State();
|
||||
};
|
||||
|
||||
#endif //_DEBUGGER_CORE_H
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef _DEBUGGER_DATA_H
|
||||
#define _DEBUGGER_DATA_H
|
||||
|
||||
#include "_global.h"
|
||||
|
||||
namespace GleeBug
|
||||
{
|
||||
struct ProcessInfo
|
||||
{
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
DWORD ProcessId;
|
||||
DWORD MainThreadId;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //_DEBUGGER_DATA_H
|
||||
|
|
@ -1,99 +1,98 @@
|
|||
#include "Debugger.Loop.h"
|
||||
#include "Debugger.Core.h"
|
||||
#include "Debugger.h"
|
||||
|
||||
namespace Debugger
|
||||
namespace GleeBug
|
||||
{
|
||||
static void CreateProcessEvent(CREATE_PROCESS_DEBUG_INFO* CreateProcess, DebugState* state)
|
||||
void Debugger::createProcessEvent(CREATE_PROCESS_DEBUG_INFO* CreateProcess)
|
||||
{
|
||||
puts("> CreateProcessEvent");
|
||||
log("Debugger::createProcessEvent");
|
||||
}
|
||||
|
||||
static void ExitProcessEvent(EXIT_PROCESS_DEBUG_INFO* ExitProcess, DebugState* state)
|
||||
void Debugger::exitProcessEvent(EXIT_PROCESS_DEBUG_INFO* ExitProcess)
|
||||
{
|
||||
puts("> ExitProcessEvent");
|
||||
if (state->DebugEvent.dwProcessId == state->Process.ProcessId)
|
||||
log("Debugger::exitProcessEvent");
|
||||
if (_debugEvent.dwProcessId == _mainProcess.ProcessId)
|
||||
{
|
||||
state->BreakDebugger = true;
|
||||
_breakDebugger = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateThreadEvent(CREATE_THREAD_DEBUG_INFO* CreateThread, DebugState* state)
|
||||
void Debugger::createThreadEvent(CREATE_THREAD_DEBUG_INFO* CreateThread)
|
||||
{
|
||||
puts("> CreateThreadEvent");
|
||||
log("Debugger::createThreadEvent");
|
||||
}
|
||||
|
||||
static void ExitThreadEvent(EXIT_THREAD_DEBUG_INFO* ExitThread, DebugState* state)
|
||||
void Debugger::exitThreadEvent(EXIT_THREAD_DEBUG_INFO* ExitThread)
|
||||
{
|
||||
puts("> ExitThreadEvent");
|
||||
log("Debugger::exitThreadEvent");
|
||||
}
|
||||
|
||||
static void LoadDllEvent(LOAD_DLL_DEBUG_INFO* LoadDll, DebugState* state)
|
||||
void Debugger::loadDllEvent(LOAD_DLL_DEBUG_INFO* LoadDll)
|
||||
{
|
||||
puts("> LoadDllEvent");
|
||||
log("Debugger::loadDllEvent");
|
||||
}
|
||||
|
||||
static void UnloadDllEvent(UNLOAD_DLL_DEBUG_INFO* UnloadDll, DebugState* state)
|
||||
void Debugger::unloadDllEvent(UNLOAD_DLL_DEBUG_INFO* UnloadDll)
|
||||
{
|
||||
puts("> UnloadDllEvent");
|
||||
log("Debugger::unloadDllEvent");
|
||||
}
|
||||
|
||||
static void ExceptionEvent(EXCEPTION_DEBUG_INFO* Exception, DebugState* state)
|
||||
void Debugger::exceptionEvent(EXCEPTION_DEBUG_INFO* Exception)
|
||||
{
|
||||
puts("> ExceptionEvent");
|
||||
log("Debugger::exceptionEvent");
|
||||
}
|
||||
|
||||
static void DebugStringEvent(OUTPUT_DEBUG_STRING_INFO* DebugString, DebugState* state)
|
||||
void Debugger::debugStringEvent(OUTPUT_DEBUG_STRING_INFO* DebugString)
|
||||
{
|
||||
puts("> DebugStringEvent");
|
||||
log("Debugger::debugStringEvent");
|
||||
}
|
||||
|
||||
static void RipEvent(RIP_INFO* Rip, DebugState* state)
|
||||
void Debugger::ripEvent(RIP_INFO* Rip)
|
||||
{
|
||||
puts("> RipEvent");
|
||||
log("Debugger::ripEvent");
|
||||
}
|
||||
|
||||
void Loop()
|
||||
void Debugger::Start()
|
||||
{
|
||||
DebugState* state = State();
|
||||
state->ContinueStatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||
while (!state->BreakDebugger)
|
||||
_continueStatus = DBG_EXCEPTION_NOT_HANDLED;
|
||||
_breakDebugger = false;
|
||||
while (!_breakDebugger)
|
||||
{
|
||||
if (!WaitForDebugEvent(&state->DebugEvent, INFINITE))
|
||||
if (!WaitForDebugEvent(&_debugEvent, INFINITE))
|
||||
break;
|
||||
|
||||
switch (state->DebugEvent.dwDebugEventCode)
|
||||
switch (_debugEvent.dwDebugEventCode)
|
||||
{
|
||||
case CREATE_PROCESS_DEBUG_EVENT:
|
||||
CreateProcessEvent(&state->DebugEvent.u.CreateProcessInfo, state);
|
||||
createProcessEvent(&_debugEvent.u.CreateProcessInfo);
|
||||
break;
|
||||
case EXIT_PROCESS_DEBUG_EVENT:
|
||||
ExitProcessEvent(&state->DebugEvent.u.ExitProcess, state);
|
||||
exitProcessEvent(&_debugEvent.u.ExitProcess);
|
||||
break;
|
||||
case CREATE_THREAD_DEBUG_EVENT:
|
||||
CreateThreadEvent(&state->DebugEvent.u.CreateThread, state);
|
||||
createThreadEvent(&_debugEvent.u.CreateThread);
|
||||
break;
|
||||
case EXIT_THREAD_DEBUG_EVENT:
|
||||
ExitThreadEvent(&state->DebugEvent.u.ExitThread, state);
|
||||
exitThreadEvent(&_debugEvent.u.ExitThread);
|
||||
break;
|
||||
case LOAD_DLL_DEBUG_EVENT:
|
||||
LoadDllEvent(&state->DebugEvent.u.LoadDll, state);
|
||||
loadDllEvent(&_debugEvent.u.LoadDll);
|
||||
break;
|
||||
case UNLOAD_DLL_DEBUG_EVENT:
|
||||
UnloadDllEvent(&state->DebugEvent.u.UnloadDll, state);
|
||||
unloadDllEvent(&_debugEvent.u.UnloadDll);
|
||||
break;
|
||||
case EXCEPTION_DEBUG_EVENT:
|
||||
ExceptionEvent(&state->DebugEvent.u.Exception, state);
|
||||
exceptionEvent(&_debugEvent.u.Exception);
|
||||
break;
|
||||
case OUTPUT_DEBUG_STRING_EVENT:
|
||||
DebugStringEvent(&state->DebugEvent.u.DebugString, state);
|
||||
debugStringEvent(&_debugEvent.u.DebugString);
|
||||
break;
|
||||
case RIP_EVENT:
|
||||
RipEvent(&state->DebugEvent.u.RipInfo, state);
|
||||
ripEvent(&_debugEvent.u.RipInfo);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ContinueDebugEvent(state->DebugEvent.dwProcessId, state->DebugEvent.dwThreadId, state->ContinueStatus))
|
||||
if (!ContinueDebugEvent(_debugEvent.dwProcessId, _debugEvent.dwThreadId, _continueStatus))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef _DEBUGGER_LOOP_H
|
||||
#define _DEBUGGER_LOOP_H
|
||||
|
||||
#include "_global.h"
|
||||
|
||||
namespace Debugger
|
||||
{
|
||||
void Loop();
|
||||
};
|
||||
|
||||
#endif //_DEBUGGER_LOOP_H
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#include "Debugger.h"
|
||||
|
||||
namespace GleeBug
|
||||
{
|
||||
void Debugger::log(std::string msg)
|
||||
{
|
||||
puts(msg.c_str());
|
||||
}
|
||||
};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef _DEBUG_STATE_H
|
||||
#define _DEBUG_STATE_H
|
||||
|
||||
#include "_global.h"
|
||||
|
||||
namespace Debugger
|
||||
{
|
||||
struct ProcessInfo
|
||||
{
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
DWORD ProcessId;
|
||||
DWORD MainThreadId;
|
||||
};
|
||||
|
||||
struct DebugState
|
||||
{
|
||||
ProcessInfo Process;
|
||||
DEBUG_EVENT DebugEvent;
|
||||
DWORD ContinueStatus;
|
||||
bool BreakDebugger;
|
||||
};
|
||||
};
|
||||
|
||||
#endif //_DEBUG_STATE_H
|
||||
|
|
@ -2,5 +2,65 @@
|
|||
|
||||
namespace GleeBug
|
||||
{
|
||||
Debugger::Debugger()
|
||||
{
|
||||
}
|
||||
|
||||
bool Debugger::Init(const wchar_t* szFilePath,
|
||||
const wchar_t* szCommandLine,
|
||||
const wchar_t* szCurrentDirectory)
|
||||
{
|
||||
STARTUPINFOW si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
PROCESS_INFORMATION pi;
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
const wchar_t* szFileNameCreateProcess;
|
||||
wchar_t* szCommandLineCreateProcess;
|
||||
if (szCommandLine == NULL || !wcslen(szCommandLine))
|
||||
{
|
||||
szCommandLineCreateProcess = 0;
|
||||
szFileNameCreateProcess = szFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t szCreateWithCmdLine[1024];
|
||||
swprintf_s(szCreateWithCmdLine, L"\"%s\" %s", szFilePath, szCommandLine);
|
||||
szCommandLineCreateProcess = szCreateWithCmdLine;
|
||||
szFileNameCreateProcess = 0;
|
||||
}
|
||||
|
||||
if (!CreateProcessW(szFileNameCreateProcess,
|
||||
szCommandLineCreateProcess,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
DEBUG_PROCESS | CREATE_NEW_CONSOLE,
|
||||
NULL,
|
||||
szCurrentDirectory,
|
||||
&si,
|
||||
&pi))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_mainProcess.hProcess = pi.hProcess;
|
||||
_mainProcess.hThread = pi.hThread;
|
||||
_mainProcess.ProcessId = pi.dwProcessId;
|
||||
_mainProcess.MainThreadId = pi.dwThreadId;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::Stop()
|
||||
{
|
||||
return !!TerminateProcess(_mainProcess.hProcess, 0);
|
||||
}
|
||||
|
||||
bool Debugger::Detach()
|
||||
{
|
||||
return !!DebugActiveProcessStop(_mainProcess.ProcessId);
|
||||
}
|
||||
|
||||
const ProcessInfo & Debugger::GetMainProcess()
|
||||
{
|
||||
return _mainProcess;
|
||||
}
|
||||
};
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#define _DEBUGGER_H
|
||||
|
||||
#include "_global.h"
|
||||
#include "Debugger.Data.h"
|
||||
|
||||
namespace GleeBug
|
||||
{
|
||||
|
|
@ -44,8 +45,29 @@ namespace GleeBug
|
|||
*/
|
||||
void Start();
|
||||
|
||||
/**
|
||||
\brief Gets main process info.
|
||||
\return The main process info.
|
||||
*/
|
||||
const ProcessInfo & GetMainProcess();
|
||||
|
||||
protected:
|
||||
void createProcessEvent(CREATE_PROCESS_DEBUG_INFO* CreateProcess);
|
||||
void exitProcessEvent(EXIT_PROCESS_DEBUG_INFO* ExitProcess);
|
||||
void createThreadEvent(CREATE_THREAD_DEBUG_INFO* CreateThread);
|
||||
void exitThreadEvent(EXIT_THREAD_DEBUG_INFO* ExitThread);
|
||||
void loadDllEvent(LOAD_DLL_DEBUG_INFO* LoadDll);
|
||||
void unloadDllEvent(UNLOAD_DLL_DEBUG_INFO* UnloadDll);
|
||||
void exceptionEvent(EXCEPTION_DEBUG_INFO* Exception);
|
||||
void debugStringEvent(OUTPUT_DEBUG_STRING_INFO* DebugString);
|
||||
void ripEvent(RIP_INFO* Rip);
|
||||
void log(std::string msg);
|
||||
|
||||
private:
|
||||
//state variables
|
||||
ProcessInfo _mainProcess;
|
||||
DWORD _continueStatus;
|
||||
bool _breakDebugger;
|
||||
DEBUG_EVENT _debugEvent;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,18 @@
|
|||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B65A3680-9B6B-44E6-A046-649F94DF9F56}</ProjectGuid>
|
||||
|
|
@ -21,6 +29,12 @@
|
|||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
|
@ -28,17 +42,41 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\x32\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)bin\x64\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\x32\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)bin\x64\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
@ -49,6 +87,16 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
@ -63,18 +111,30 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Debugger.Core.cpp" />
|
||||
<ClCompile Include="Debugger.cpp" />
|
||||
<ClCompile Include="Debugger.Loop.cpp" />
|
||||
<ClCompile Include="Debugger.Misc.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="_global.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Debugger.Core.h" />
|
||||
<ClInclude Include="Debugger.Data.h" />
|
||||
<ClInclude Include="Debugger.h" />
|
||||
<ClInclude Include="Debugger.Loop.h" />
|
||||
<ClInclude Include="Debugger.State.h" />
|
||||
<ClInclude Include="_global.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
|||
|
|
@ -18,34 +18,28 @@
|
|||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Debugger.Core.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="_global.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Debugger.Loop.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Debugger.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Debugger.Loop.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Debugger.Misc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Debugger.Core.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Debugger.State.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Debugger.Loop.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Debugger.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Debugger.Data.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
#define _GLOBAL_H
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
|
||||
#endif //_GLOBAL_H
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
#include <cstdio>
|
||||
#include "Debugger.Core.h"
|
||||
#include "Debugger.Loop.h"
|
||||
#include "Debugger.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
wchar_t szFilePath[256] = L"c:\\CodeBlocks\\arma_cert_bin_info\\bin\\arma_cert_bin_info.exe";
|
||||
wchar_t szCommandLine[256] = L"";
|
||||
wchar_t szCurrentDir[256] = L"c:\\CodeBlocks\\arma_cert_bin_info\\bin";
|
||||
Debugger::ProcessInfo process;
|
||||
if (Debugger::Init(szFilePath, NULL, szCurrentDir, &process))
|
||||
GleeBug::Debugger dbg;
|
||||
if (dbg.Init(szFilePath, szCommandLine, szCurrentDir))
|
||||
{
|
||||
printf("Debugger::Init success! PID: %X\n", process.ProcessId);
|
||||
Debugger::Loop();
|
||||
printf("Debugger::Init success! PID: %X\n", dbg.GetMainProcess().ProcessId);
|
||||
dbg.Start();
|
||||
printf("Debugger::Start finished!");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue