Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit d76dfc4

Browse files
author
Sharkbyteprojects
committed
Projektdateien hinzufügen.
1 parent 8a066a9 commit d76dfc4

File tree

13 files changed

+646
-0
lines changed

13 files changed

+646
-0
lines changed

inject/inject.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+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{2f382d78-46dd-4a27-b41c-2db31600ad01}</ProjectGuid>
25+
<RootNamespace>inject</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>DynamicLibrary</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>DynamicLibrary</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>DynamicLibrary</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>DynamicLibrary</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
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|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<ClCompile>
75+
<WarningLevel>Level3</WarningLevel>
76+
<SDLCheck>true</SDLCheck>
77+
<PreprocessorDefinitions>WIN32;_DEBUG;INJECT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
<ConformanceMode>true</ConformanceMode>
79+
<LanguageStandard>stdcpp17</LanguageStandard>
80+
</ClCompile>
81+
<Link>
82+
<SubSystem>Windows</SubSystem>
83+
<GenerateDebugInformation>true</GenerateDebugInformation>
84+
<EnableUAC>false</EnableUAC>
85+
</Link>
86+
</ItemDefinitionGroup>
87+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
88+
<ClCompile>
89+
<WarningLevel>Level3</WarningLevel>
90+
<FunctionLevelLinking>true</FunctionLevelLinking>
91+
<IntrinsicFunctions>true</IntrinsicFunctions>
92+
<SDLCheck>true</SDLCheck>
93+
<PreprocessorDefinitions>WIN32;NDEBUG;INJECT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
94+
<ConformanceMode>true</ConformanceMode>
95+
<LanguageStandard>stdcpp17</LanguageStandard>
96+
</ClCompile>
97+
<Link>
98+
<SubSystem>Windows</SubSystem>
99+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
100+
<OptimizeReferences>true</OptimizeReferences>
101+
<GenerateDebugInformation>false</GenerateDebugInformation>
102+
<EnableUAC>false</EnableUAC>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106+
<ClCompile>
107+
<WarningLevel>Level3</WarningLevel>
108+
<SDLCheck>true</SDLCheck>
109+
<PreprocessorDefinitions>_DEBUG;INJECT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<ConformanceMode>true</ConformanceMode>
111+
<LanguageStandard>stdcpp17</LanguageStandard>
112+
</ClCompile>
113+
<Link>
114+
<SubSystem>Windows</SubSystem>
115+
<GenerateDebugInformation>true</GenerateDebugInformation>
116+
<EnableUAC>false</EnableUAC>
117+
</Link>
118+
</ItemDefinitionGroup>
119+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
120+
<ClCompile>
121+
<WarningLevel>Level3</WarningLevel>
122+
<FunctionLevelLinking>true</FunctionLevelLinking>
123+
<IntrinsicFunctions>true</IntrinsicFunctions>
124+
<SDLCheck>true</SDLCheck>
125+
<PreprocessorDefinitions>NDEBUG;INJECT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
126+
<ConformanceMode>true</ConformanceMode>
127+
<LanguageStandard>stdcpp17</LanguageStandard>
128+
</ClCompile>
129+
<Link>
130+
<SubSystem>Windows</SubSystem>
131+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
132+
<OptimizeReferences>true</OptimizeReferences>
133+
<GenerateDebugInformation>false</GenerateDebugInformation>
134+
<EnableUAC>false</EnableUAC>
135+
</Link>
136+
</ItemDefinitionGroup>
137+
<ItemGroup>
138+
<ClCompile Include="mtx.cpp" />
139+
<ClCompile Include="needle.cpp" />
140+
</ItemGroup>
141+
<ItemGroup>
142+
<ClInclude Include="mtx.hxx" />
143+
</ItemGroup>
144+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
145+
<ImportGroup Label="ExtensionTargets">
146+
</ImportGroup>
147+
</Project>

inject/inject.vcxproj.filters

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Quelldateien">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Headerdateien">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Ressourcendateien">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="needle.cpp">
19+
<Filter>Quelldateien</Filter>
20+
</ClCompile>
21+
<ClCompile Include="mtx.cpp">
22+
<Filter>Quelldateien</Filter>
23+
</ClCompile>
24+
</ItemGroup>
25+
<ItemGroup>
26+
<ClInclude Include="mtx.hxx">
27+
<Filter>Headerdateien</Filter>
28+
</ClInclude>
29+
</ItemGroup>
30+
</Project>

inject/mtx.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include "mtx.hxx"
2+
#include <Windows.h>
3+
4+
bool mtxRn::startMtx(const wchar_t* name)
5+
{
6+
hMutexOneInstance = (::CreateMutexW(NULL, TRUE, name));
7+
bool bAlreadyRunning((::GetLastError() == ERROR_ALREADY_EXISTS));
8+
if (hMutexOneInstance == NULL || bAlreadyRunning)
9+
{
10+
if (hMutexOneInstance)
11+
{
12+
::ReleaseMutex(hMutexOneInstance);
13+
::CloseHandle(hMutexOneInstance);
14+
}
15+
return 0;
16+
}
17+
return 1;
18+
}
19+
20+
void mtxRn::release()
21+
{
22+
if (hMutexOneInstance)
23+
{
24+
::ReleaseMutex(hMutexOneInstance);
25+
::CloseHandle(hMutexOneInstance);
26+
}
27+
}
28+
29+
mtxRn::~mtxRn()
30+
{
31+
release();
32+
}

inject/mtx.hxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
3+
class mtxRn {
4+
private:
5+
void* hMutexOneInstance;
6+
public:
7+
bool startMtx(const wchar_t* name);
8+
void release();
9+
~mtxRn();
10+
};

inject/needle.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include <Windows.h>
2+
#include "mtx.hxx"
3+
#include <filesystem>
4+
5+
DWORD WINAPI mthread(LPVOID p) {
6+
wchar_t fname[MAX_PATH]{ 0 };
7+
GetModuleFileNameW(NULL, fname, MAX_PATH);
8+
std::filesystem::path x = fname;
9+
x = x.filename();
10+
while (1) {
11+
12+
if (GetAsyncKeyState(VK_F6) & 0x80000) {
13+
mtxRn crashOk;
14+
if (crashOk.startMtx((L"InjectedTo" + x.wstring()).c_str())) {
15+
if (MessageBoxW(NULL, L"🐋 Do you want to crash this?", fname, MB_YESNO | MB_DEFBUTTON2 | MB_ICONHAND | MB_TOPMOST) == IDYES) {
16+
volatile int* pInt = 0x00000000;
17+
*pInt = 0x02;
18+
}
19+
crashOk.release();
20+
}
21+
}
22+
if (GetAsyncKeyState(VK_F8) & 0x80000) {
23+
break;
24+
}
25+
Sleep(100);
26+
}
27+
return 0;
28+
}
29+
30+
BOOL WINAPI DllMain(
31+
HINSTANCE hinstDLL, // handle to DLL module
32+
DWORD fdwReason, // reason for calling function
33+
LPVOID lpvReserved) // reserved
34+
{
35+
// Perform actions based on the reason for calling.
36+
switch (fdwReason)
37+
{
38+
case DLL_PROCESS_ATTACH:
39+
// Initialize once for each new process.
40+
// Return FALSE to fail DLL load.
41+
CreateThread(NULL, NULL, mthread, hinstDLL, NULL, NULL);
42+
break;
43+
44+
case DLL_THREAD_ATTACH:
45+
// Do thread-specific initialization.
46+
break;
47+
48+
case DLL_THREAD_DETACH:
49+
// Do thread-specific cleanup.
50+
break;
51+
52+
case DLL_PROCESS_DETACH:
53+
54+
if (lpvReserved != nullptr)
55+
{
56+
break; // do not do cleanup if process termination scenario
57+
}
58+
59+
// Perform any necessary cleanup.
60+
break;
61+
}
62+
return TRUE; // Successful DLL_PROCESS_ATTACH.
63+
}

processMaster.sln

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33205.214
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "processMaster", "processMaster\processMaster.vcxproj", "{3149FA6F-26A7-480D-882A-4F8990918C2F}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inject", "inject\inject.vcxproj", "{2F382D78-46DD-4A27-B41C-2DB31600AD01}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|x64 = Debug|x64
13+
Debug|x86 = Debug|x86
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Debug|x64.ActiveCfg = Debug|x64
19+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Debug|x64.Build.0 = Debug|x64
20+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Debug|x86.ActiveCfg = Debug|Win32
21+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Debug|x86.Build.0 = Debug|Win32
22+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Release|x64.ActiveCfg = Release|x64
23+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Release|x64.Build.0 = Release|x64
24+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Release|x86.ActiveCfg = Release|Win32
25+
{3149FA6F-26A7-480D-882A-4F8990918C2F}.Release|x86.Build.0 = Release|Win32
26+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Debug|x64.ActiveCfg = Debug|x64
27+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Debug|x64.Build.0 = Debug|x64
28+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Debug|x86.ActiveCfg = Debug|Win32
29+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Debug|x86.Build.0 = Debug|Win32
30+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Release|x64.ActiveCfg = Release|x64
31+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Release|x64.Build.0 = Release|x64
32+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Release|x86.ActiveCfg = Release|Win32
33+
{2F382D78-46DD-4A27-B41C-2DB31600AD01}.Release|x86.Build.0 = Release|Win32
34+
EndGlobalSection
35+
GlobalSection(SolutionProperties) = preSolution
36+
HideSolutionNode = FALSE
37+
EndGlobalSection
38+
GlobalSection(ExtensibilityGlobals) = postSolution
39+
SolutionGuid = {802EEFE9-5FB0-4EB4-A34F-A53BF3F810F7}
40+
EndGlobalSection
41+
EndGlobal

0 commit comments

Comments
 (0)