Skip to content

Commit 165011e

Browse files
committed
add the macloader project
launch application from macloader using the standard detour API.
1 parent 2e6e118 commit 165011e

File tree

8 files changed

+1095
-390
lines changed

8 files changed

+1095
-390
lines changed

detours.h

Lines changed: 742 additions & 213 deletions
Large diffs are not rendered by default.

gdiexe.rc

Lines changed: 0 additions & 70 deletions
This file was deleted.

gdipp.sln

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ VisualStudioVersion = 17.4.33103.184
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MacType", "gdipp.vcxproj", "{15C33FD9-0811-4981-B08F-E0BAD74A3028}"
66
EndProject
7+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "macloader", "macloader.vcxproj", "{6D6AC860-BA16-4BE7-9169-21787F21CB6F}"
8+
EndProject
79
Global
810
GlobalSection(SolutionConfigurationPlatforms) = preSolution
911
Debug Infinality|Win32 = Debug Infinality|Win32
@@ -50,6 +52,34 @@ Global
5052
{15C33FD9-0811-4981-B08F-E0BAD74A3028}.Release+StaticHook|Win32.Build.0 = Release+StaticHook|Win32
5153
{15C33FD9-0811-4981-B08F-E0BAD74A3028}.Release+StaticHook|x64.ActiveCfg = Release+StaticHook|x64
5254
{15C33FD9-0811-4981-B08F-E0BAD74A3028}.Release+StaticHook|x64.Build.0 = Release+StaticHook|x64
55+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug Infinality|Win32.ActiveCfg = Debug|Win32
56+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug Infinality|Win32.Build.0 = Debug|Win32
57+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug Infinality|x64.ActiveCfg = Debug|x64
58+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug Infinality|x64.Build.0 = Debug|x64
59+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug|Win32.ActiveCfg = Debug|Win32
60+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug|Win32.Build.0 = Debug|Win32
61+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug|x64.ActiveCfg = Debug|x64
62+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Debug|x64.Build.0 = Debug|x64
63+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Detours|Win32.ActiveCfg = Release|Win32
64+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Detours|Win32.Build.0 = Release|Win32
65+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Detours|x64.ActiveCfg = Release|x64
66+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Detours|x64.Build.0 = Release|x64
67+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Trace|Win32.ActiveCfg = Release|Win32
68+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Trace|Win32.Build.0 = Release|Win32
69+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Trace|x64.ActiveCfg = Release|x64
70+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Rel+Trace|x64.Build.0 = Release|x64
71+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release Infinality|Win32.ActiveCfg = Release|Win32
72+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release Infinality|Win32.Build.0 = Release|Win32
73+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release Infinality|x64.ActiveCfg = Release|x64
74+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release Infinality|x64.Build.0 = Release|x64
75+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release|Win32.ActiveCfg = Release|Win32
76+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release|Win32.Build.0 = Release|Win32
77+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release|x64.ActiveCfg = Release|x64
78+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release|x64.Build.0 = Release|x64
79+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release+StaticHook|Win32.ActiveCfg = Release|Win32
80+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release+StaticHook|Win32.Build.0 = Release|Win32
81+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release+StaticHook|x64.ActiveCfg = Release|x64
82+
{6D6AC860-BA16-4BE7-9169-21787F21CB6F}.Release+StaticHook|x64.Build.0 = Release|x64
5383
EndGlobalSection
5484
GlobalSection(SolutionProperties) = preSolution
5585
HideSolutionNode = FALSE

gdipp.vcxproj

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
<Configuration>Debug</Configuration>
1818
<Platform>x64</Platform>
1919
</ProjectConfiguration>
20+
<ProjectConfiguration Include="EXE|Win32">
21+
<Configuration>EXE</Configuration>
22+
<Platform>Win32</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="EXE|x64">
25+
<Configuration>EXE</Configuration>
26+
<Platform>x64</Platform>
27+
</ProjectConfiguration>
2028
<ProjectConfiguration Include="Rel+Detours|Win32">
2129
<Configuration>Rel+Detours</Configuration>
2230
<Platform>Win32</Platform>
@@ -67,7 +75,7 @@
6775
</PropertyGroup>
6876
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
6977
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
70-
<ConfigurationType>DynamicLibrary</ConfigurationType>
78+
<ConfigurationType>Application</ConfigurationType>
7179
<CharacterSet>Unicode</CharacterSet>
7280
<WholeProgramOptimization>true</WholeProgramOptimization>
7381
<PlatformToolset>v143</PlatformToolset>
@@ -146,6 +154,12 @@
146154
<PlatformToolset>v143</PlatformToolset>
147155
<CharacterSet>Unicode</CharacterSet>
148156
</PropertyGroup>
157+
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='EXE|Win32'">
158+
<PlatformToolset>v143</PlatformToolset>
159+
</PropertyGroup>
160+
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='EXE|x64'">
161+
<PlatformToolset>v143</PlatformToolset>
162+
</PropertyGroup>
149163
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
150164
<ImportGroup Label="ExtensionSettings">
151165
</ImportGroup>
@@ -443,7 +457,7 @@
443457
<IntrinsicFunctions>true</IntrinsicFunctions>
444458
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
445459
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
446-
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GDIPP_EXPORTS;_GDIPP_DLL;EASYHOOK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
460+
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GDIPP_EXPORTS;_GDIPP_EXE;EASYHOOK;STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
447461
<ExceptionHandling>Sync</ExceptionHandling>
448462
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
449463
<BufferSecurityCheck>false</BufferSecurityCheck>

macloader.rc

5.7 KB
Binary file not shown.

macloader.vcxproj

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<ItemGroup>
22+
<ClCompile Include="run.cpp" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ResourceCompile Include="macloader.rc" />
26+
</ItemGroup>
27+
<PropertyGroup Label="Globals">
28+
<VCProjectVersion>17.0</VCProjectVersion>
29+
<Keyword>Win32Proj</Keyword>
30+
<ProjectGuid>{6d6ac860-ba16-4be7-9169-21787f21cb6f}</ProjectGuid>
31+
<RootNamespace>macloader</RootNamespace>
32+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
33+
</PropertyGroup>
34+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>true</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<CharacterSet>Unicode</CharacterSet>
40+
</PropertyGroup>
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
42+
<ConfigurationType>Application</ConfigurationType>
43+
<UseDebugLibraries>false</UseDebugLibraries>
44+
<PlatformToolset>v143</PlatformToolset>
45+
<WholeProgramOptimization>true</WholeProgramOptimization>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>true</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<CharacterSet>Unicode</CharacterSet>
53+
</PropertyGroup>
54+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
55+
<ConfigurationType>Application</ConfigurationType>
56+
<UseDebugLibraries>false</UseDebugLibraries>
57+
<PlatformToolset>v143</PlatformToolset>
58+
<WholeProgramOptimization>true</WholeProgramOptimization>
59+
<CharacterSet>Unicode</CharacterSet>
60+
</PropertyGroup>
61+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
62+
<ImportGroup Label="ExtensionSettings">
63+
</ImportGroup>
64+
<ImportGroup Label="Shared">
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
73+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74+
</ImportGroup>
75+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
76+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
77+
</ImportGroup>
78+
<PropertyGroup Label="UserMacros" />
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80+
<TargetName>$(ProjectName)64</TargetName>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<TargetName>$(ProjectName)64</TargetName>
84+
</PropertyGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level3</WarningLevel>
88+
<SDLCheck>true</SDLCheck>
89+
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;USE_DETOURS;_GDIPP_EXE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
<ConformanceMode>Default</ConformanceMode>
91+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
92+
</ClCompile>
93+
<Link>
94+
<SubSystem>Windows</SubSystem>
95+
<GenerateDebugInformation>true</GenerateDebugInformation>
96+
</Link>
97+
</ItemDefinitionGroup>
98+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
99+
<ClCompile>
100+
<WarningLevel>Level3</WarningLevel>
101+
<FunctionLevelLinking>true</FunctionLevelLinking>
102+
<IntrinsicFunctions>true</IntrinsicFunctions>
103+
<SDLCheck>true</SDLCheck>
104+
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;USE_DETOURS;_GDIPP_EXE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105+
<ConformanceMode>Default</ConformanceMode>
106+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
107+
</ClCompile>
108+
<Link>
109+
<SubSystem>Windows</SubSystem>
110+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
111+
<OptimizeReferences>true</OptimizeReferences>
112+
<GenerateDebugInformation>true</GenerateDebugInformation>
113+
</Link>
114+
</ItemDefinitionGroup>
115+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
116+
<ClCompile>
117+
<WarningLevel>Level3</WarningLevel>
118+
<SDLCheck>true</SDLCheck>
119+
<PreprocessorDefinitions>_DEBUG;_WINDOWS;USE_DETOURS;_GDIPP_EXE;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120+
<ConformanceMode>Default</ConformanceMode>
121+
</ClCompile>
122+
<Link>
123+
<SubSystem>Windows</SubSystem>
124+
<GenerateDebugInformation>true</GenerateDebugInformation>
125+
</Link>
126+
</ItemDefinitionGroup>
127+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
128+
<ClCompile>
129+
<WarningLevel>Level3</WarningLevel>
130+
<FunctionLevelLinking>true</FunctionLevelLinking>
131+
<IntrinsicFunctions>true</IntrinsicFunctions>
132+
<SDLCheck>true</SDLCheck>
133+
<PreprocessorDefinitions>NDEBUG;_WINDOWS;USE_DETOURS;_GDIPP_EXE;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134+
<ConformanceMode>Default</ConformanceMode>
135+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Windows</SubSystem>
139+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
140+
<OptimizeReferences>true</OptimizeReferences>
141+
<GenerateDebugInformation>true</GenerateDebugInformation>
142+
</Link>
143+
</ItemDefinitionGroup>
144+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
145+
<ImportGroup Label="ExtensionTargets">
146+
</ImportGroup>
147+
</Project>

resource.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,3 +1424,17 @@
14241424
#define _APS_NEXT_SYMED_VALUE 101
14251425
#endif
14261426
#endif
1427+
//{{NO_DEPENDENCIES}}
1428+
// Microsoft Visual C++ generated include file.
1429+
// Used by Resource.rc
1430+
1431+
// Next default values for new objects
1432+
//
1433+
#ifdef APSTUDIO_INVOKED
1434+
#ifndef APSTUDIO_READONLY_SYMBOLS
1435+
#define _APS_NEXT_RESOURCE_VALUE 101
1436+
#define _APS_NEXT_COMMAND_VALUE 40001
1437+
#define _APS_NEXT_CONTROL_VALUE 1001
1438+
#define _APS_NEXT_SYMED_VALUE 101
1439+
#endif
1440+
#endif

0 commit comments

Comments
 (0)