-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
446 changed files
with
169,985 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.28407.52 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EngineX", "EngineX-Pro\EngineX-Pro.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Win32 = Debug|Win32 | ||
Debug|x64 = Debug|x64 | ||
PGInstrument|Win32 = PGInstrument|Win32 | ||
PGInstrument|x64 = PGInstrument|x64 | ||
PGUpdate|Win32 = PGUpdate|Win32 | ||
PGUpdate|x64 = PGUpdate|x64 | ||
Release|Win32 = Release|Win32 | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.ActiveCfg = Debug|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.Build.0 = Debug|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGInstrument|Win32.ActiveCfg = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGInstrument|Win32.Build.0 = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGInstrument|x64.ActiveCfg = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGUpdate|Win32.ActiveCfg = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGUpdate|Win32.Build.0 = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.PGUpdate|x64.ActiveCfg = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.Build.0 = Release|Win32 | ||
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {1A96352C-88D9-4968-9A09-2837F39CCBC0} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#include "polyhook2/Exceptions/AVehHook.hpp" | ||
|
||
PLH::RefCounter PLH::AVehHook::m_refCount; | ||
void* PLH::AVehHook::m_hHandler; | ||
std::unordered_set<PLH::AVehHookImpEntry> PLH::AVehHook::m_impls; | ||
PLH::eException PLH::AVehHook::m_onException; | ||
PLH::eException PLH::AVehHook::m_onUnhandledException; | ||
|
||
// https://reverseengineering.stackexchange.com/questions/14992/what-are-the-vectored-continue-handlers | ||
PLH::AVehHook::AVehHook() { | ||
if (m_refCount.m_count == 0) { | ||
m_hHandler = AddVectoredExceptionHandler(1, &AVehHook::Handler); | ||
if (m_hHandler == NULL) { | ||
Log::log("Failed to add VEH", ErrorLevel::SEV); | ||
} | ||
} | ||
|
||
m_refCount.m_count++; | ||
} | ||
|
||
PLH::AVehHook::~AVehHook() { | ||
assert(m_refCount.m_count >= 1); | ||
|
||
m_refCount.m_count--; | ||
if (m_refCount.m_count == 0) { | ||
assert(m_hHandler != nullptr); | ||
ULONG status = RemoveVectoredExceptionHandler(m_hHandler); | ||
m_hHandler = nullptr; | ||
if (status == 0) { | ||
Log::log("Failed to remove VEH", ErrorLevel::SEV); | ||
} | ||
} | ||
} | ||
|
||
PLH::eException& PLH::AVehHook::EventException() { | ||
return m_onException; | ||
} | ||
|
||
PLH::eException& PLH::AVehHook::EventUnhandledException() { | ||
return m_onUnhandledException; | ||
} | ||
|
||
LONG CALLBACK PLH::AVehHook::Handler(EXCEPTION_POINTERS* ExceptionInfo) { | ||
DWORD ExceptionCode = ExceptionInfo->ExceptionRecord->ExceptionCode; | ||
uint64_t ip = ExceptionInfo->ContextRecord->XIP; | ||
|
||
// invoke callback (let users filter) | ||
DWORD code = EXCEPTION_CONTINUE_SEARCH; | ||
if (m_onException && m_onException.Invoke(ExceptionInfo, &code)) | ||
return code; | ||
|
||
switch (ExceptionCode) { | ||
case 0xE06D7363: // oooh aaahh a magic value | ||
std::cout << "C++ exception thrown" << std::endl; | ||
break; | ||
// these could all reasonably be hooked by someone | ||
case EXCEPTION_GUARD_PAGE: | ||
case EXCEPTION_ACCESS_VIOLATION: | ||
case EXCEPTION_BREAKPOINT: | ||
case EXCEPTION_SINGLE_STEP: | ||
// lookup which instance to forward exception to | ||
for (const auto& hk : m_impls) { | ||
switch (hk.type) { | ||
case AVehHookImpType::SINGLE: | ||
if (hk.startAddress == ip) { | ||
return hk.impl->OnException(ExceptionInfo); | ||
} | ||
break; | ||
case AVehHookImpType::RANGE: | ||
if (ip >= hk.startAddress && ip < hk.endAddress) { | ||
return hk.impl->OnException(ExceptionInfo); | ||
} | ||
break; | ||
} | ||
} | ||
break; | ||
default: | ||
// let users extend manually | ||
if (m_onUnhandledException && m_onUnhandledException.Invoke(ExceptionInfo, &code)) | ||
return code; | ||
} | ||
return EXCEPTION_CONTINUE_SEARCH; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
class AutoTalk :public IAbstractModuleBase/*, public Singleton<AutoTalk>*/ | ||
{ | ||
private: | ||
public: | ||
void OnStart() | ||
{ | ||
|
||
} | ||
|
||
void OnStop() | ||
{ | ||
} | ||
|
||
void OnUpdate() | ||
{ | ||
|
||
} | ||
|
||
void OnRender() | ||
{ | ||
} | ||
|
||
void OnTab1() | ||
{ | ||
|
||
} | ||
|
||
void OnTabs() | ||
{ | ||
MainForm::AddTab(30, "AutoTalk"); | ||
} | ||
|
||
void OnMenu() | ||
{ | ||
switch (MainForm::CurTabOpen) | ||
{ | ||
case 30: | ||
OnTab1(); | ||
break; | ||
} | ||
} | ||
}; | ||
|
Oops, something went wrong.
9df4b58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u re fuckn crazy dude, How ıs ıt Possıble man. Please fix that shit <3 (TR SERVER)