Add detour lib

This commit is contained in:
H3XploR
2026-05-21 23:59:33 +02:00
parent df678c5839
commit 11456ebd19
4 changed files with 49 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
#include "Header.h"
bool analyze_process_handle(HANDLE hProcess) {
}
+17 -8
View File
@@ -1,13 +1,19 @@
// GameAnalyzer.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit. // GameAnalyzer.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
// //
#include <iostream>
#include <algorithm> #include "Header.h"
#include <cctype>
#include <cstring> // If compiling as 64-bit
#include <sstream> #ifdef _M_X64
#include <string> #pragma comment (lib, "detoursx64.lib")
#include <windows.h> #endif // _M_X64
#include <psapi.h>
// If compiling as 32-bit
#ifdef _M_IX86
#pragma comment (lib, "detoursx86.lib")
#endif // _M_IX86
const bool affiche_process_handle = 1; const bool affiche_process_handle = 1;
const bool affiche_pid = 1; const bool affiche_pid = 1;
@@ -31,6 +37,8 @@ bool ContainsIgnoreCase(const std::string& text, const std::string& search)
return ToLower(text).find(ToLower(search)) != std::string::npos; return ToLower(text).find(ToLower(search)) != std::string::npos;
} }
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
if (argc > 2) { if (argc > 2) {
@@ -69,6 +77,7 @@ int main(int argc, char** argv)
if (affiche_process_handle || affiche_pid) if (affiche_process_handle || affiche_pid)
output << "--->"; output << "--->";
output << imageFileName << std::endl; output << imageFileName << std::endl;
bool ret_analyze_process_handle = analyze_process_handle(hProcess);
} }
CloseHandle(hProcess); CloseHandle(hProcess);
} }
+5 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
@@ -139,8 +139,12 @@
</Manifest> </Manifest>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="AnalyzeProcessHandle.cpp" />
<ClCompile Include="GameAnalyzer.cpp" /> <ClCompile Include="GameAnalyzer.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClInclude Include="Header.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <iostream>
#include <algorithm>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <windows.h>
#include <psapi.h>
#include <detours.h>
// If compiling as 64-bit
#ifdef _M_X64
#pragma comment (lib, "detoursx64.lib")
#endif // _M_X64
// If compiling as 32-bit
#ifdef _M_IX86
#pragma comment (lib, "detoursx86.lib")
#endif // _M_IX86
bool analyze_process_handle(HANDLE hProcess);