Skip to content

Commit 6b2842f

Browse files
committed
fixed stuff
1 parent 5b5391d commit 6b2842f

7 files changed

Lines changed: 22 additions & 5 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.vs/
2+
GH Injector Library/Release/
3+
GH Injector SM/GH Injector SM/x64/
4+
GH Injector SM/GH Injector SM/x86/
5+
Release/

GH Injector Library/Error.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,10 @@ data.Line = __LINE__; \
295295
memcpy(data.szFileName, __FILENAMEW__, ((size_t)lstrlenW(__FILENAMEW__)) * 2); \
296296
memcpy(data.szFunctionName, __FUNCTIONW__, ((size_t)lstrlenW(__FUNCTIONW__)) * 2);
297297

298-
#define LOG printf
298+
//#define DEBUG_INFO
299+
300+
#ifdef DEBUG_INFO
301+
#define LOG printf
302+
#else
303+
#define LOG
304+
#endif

GH Injector Library/GH Injector Library.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<VCProjectVersion>15.0</VCProjectVersion>
2323
<ProjectGuid>{AC732425-E265-40FF-842F-C59CECE9A96C}</ProjectGuid>
2424
<RootNamespace>GHInjectorLibrary</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
2626
</PropertyGroup>
2727
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -116,7 +116,7 @@
116116
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
117117
<CallingConvention>FastCall</CallingConvention>
118118
<TreatWarningAsError>false</TreatWarningAsError>
119-
<LanguageStandard>stdcpplatest</LanguageStandard>
119+
<LanguageStandard>stdcpp17</LanguageStandard>
120120
<BufferSecurityCheck>false</BufferSecurityCheck>
121121
<ControlFlowGuard>false</ControlFlowGuard>
122122
<SupportJustMyCode>false</SupportJustMyCode>

GH Injector Library/Injection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ DWORD __stdcall InjectA(INJECTIONDATAA * pData)
8383
data.Mode = pData->Mode;
8484
data.Method = pData->Method;
8585
data.Flags = pData->Flags;
86+
data.Timeout = pData->Timeout;
8687
data.hHandleValue = pData->hHandleValue;
8788
data.GenerateErrorLog = pData->GenerateErrorLog;
8889

GH Injector Library/NtCreateThreadEx WOW64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ DWORD SR_NtCreateThreadEx_WOW64(HANDLE hTargetProc, f_Routine_WOW64 pRoutine, DW
140140
DWORD dwWaitRet = WaitForSingleObject(hThread, Timeout);
141141
if (dwWaitRet != WAIT_OBJECT_0)
142142
{
143-
INIT_ERROR_DATA(error_data, GetLastError());
143+
INIT_ERROR_DATA(error_data, dwWaitRet);
144144

145145
TerminateThread(hThread, 0);
146146
CloseHandle(hThread);

GH Injector Library/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ BOOL WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, void * pReserved)
88

99
if (dwReason == DLL_PROCESS_ATTACH)
1010
{
11+
12+
#ifdef DEBUG_INFO
13+
AllocConsole();
14+
1115
FILE * pFile = nullptr;
1216
freopen_s(&pFile, "CONOUT$", "w", stdout);
17+
#endif
1318

1419
LOG("GH Injector V%ls attached at %p\n", GH_INJ_VERSIONW, hDll);
1520

GH Injector SM/GH Injector SM/GH Injector SM.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<VCProjectVersion>15.0</VCProjectVersion>
2323
<ProjectGuid>{6F0A0AA5-4B61-4323-B9A5-B3EF0088DC1B}</ProjectGuid>
2424
<RootNamespace>GHInjectorSM</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
2626
</PropertyGroup>
2727
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

0 commit comments

Comments
 (0)