mirror of
https://github.com/gmh5225/awesome-game-security
synced 2026-06-21 13:56:22 +00:00
archive: add 5 repo prompt(s) [skip ci]
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
Project Path: arc_Nevuly_WSL2-Linux-Kernel-Rolling_sznghxno
|
||||
|
||||
Source Tree:
|
||||
|
||||
```txt
|
||||
arc_Nevuly_WSL2-Linux-Kernel-Rolling_sznghxno
|
||||
└── README.md
|
||||
|
||||
```
|
||||
|
||||
`README.md`:
|
||||
|
||||
```md
|
||||
# Rolling Release Stable Kernel for WSL2
|
||||
|
||||
[](https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling/actions/workflows/trigger.yml)
|
||||
[](https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling/releases/latest)
|
||||
|
||||
Maintainer: Yang Jeong Hun (Nevuly)
|
||||
|
||||
## Introduction
|
||||
The [WSL2-Linux-Kernel-Rolling][wsl2-kernel-rolling] repo contains the latest stable kernel source code and
|
||||
configuration files for the [WSL2][about-wsl2].
|
||||
|
||||
This kernel is automatically built via [Github Actions][gh-actions] CI whenever a [newer stable kernel is released][kernel-stable].
|
||||
|
||||
## Install Instructions
|
||||
Please see this [wiki][wiki].
|
||||
|
||||
## Reporting Bugs
|
||||
If you discover an issue relating to WSL or the WSL2 kernel, please report it on
|
||||
the [Issues tab][issue].
|
||||
|
||||
## Feature Requests
|
||||
If you want to fix a bug or add new features, Please use the [Pull Request][pr].
|
||||
|
||||
## Build Instructions
|
||||
Instructions for building WSL2 kernel with an Arch Linux distribution are
|
||||
as follows:
|
||||
|
||||
1. Install the build dependencies (Arch Linux):
|
||||
`$ sudo pacman -S aarch64-linux-gnu-gcc bc bison curl flex gcc git pahole python unzip wget zip`
|
||||
|
||||
2. Build the kernel using the WSL2 kernel configuration (x86):
|
||||
`$ make KCONFIG_CONFIG=arch/x86/configs/config-wsl-x86`
|
||||
|
||||
3. Build the kernel using the WSL2 kernel configuration (arm64):
|
||||
`$ export ARCH=arm64 && export CROSS_COMPILE=aarch64-linux-gnu-`
|
||||
`$ make KCONFIG_CONFIG=arch/arm64/configs/config-wsl-arm64`
|
||||
|
||||
4. Save the module to a separate folder (Optional. Only for local build):
|
||||
`$ sudo make modules_install`
|
||||
|
||||
## Credits
|
||||
* The Linux community who created a awesome kernel.
|
||||
* Microsoft which produced WSL2 and dxgkrnl patches.
|
||||
|
||||
[wsl2-kernel-rolling]: https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling
|
||||
[about-wsl2]: https://docs.microsoft.com/en-us/windows/wsl/about#what-is-wsl-2
|
||||
[gh-actions]: https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling/actions
|
||||
[kernel-stable]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
|
||||
[wiki]: https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling/wiki/Install-Instructions
|
||||
[issue]: https://github.com/Nevuly/WSL2-Rolling-Kernel-Issue/issues
|
||||
[pr]: https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling/pulls
|
||||
|
||||
```
|
||||
@@ -0,0 +1,310 @@
|
||||
Project Path: arc_gmh5225_QueryShadowStack_37gf1aju
|
||||
|
||||
Source Tree:
|
||||
|
||||
```txt
|
||||
arc_gmh5225_QueryShadowStack_37gf1aju
|
||||
├── QueryShadowStack.sln
|
||||
├── QueryShadowStack.vcxproj
|
||||
├── README.md
|
||||
└── main.cpp
|
||||
|
||||
```
|
||||
|
||||
`QueryShadowStack.sln`:
|
||||
|
||||
```sln
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31613.86
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QueryShadowStack", "QueryShadowStack.vcxproj", "{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Debug|x64.Build.0 = Debug|x64
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Debug|x86.Build.0 = Debug|Win32
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Release|x64.ActiveCfg = Release|x64
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Release|x64.Build.0 = Release|x64
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Release|x86.ActiveCfg = Release|Win32
|
||||
{8BF6C2E0-2C63-463B-92BF-FF8A382A8734}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {36EACA61-06A9-4DEA-ACD2-A511B5D86CF7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
```
|
||||
|
||||
`QueryShadowStack.vcxproj`:
|
||||
|
||||
```vcxproj
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{8bf6c2e0-2c63-463b-92bf-ff8a382a8734}</ProjectGuid>
|
||||
<RootNamespace>QueryShadowStack</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
`README.md`:
|
||||
|
||||
```md
|
||||
# QueryShadowStack
|
||||
Query ShadowStack
|
||||
|
||||
https://stackoverflow.com/questions/56905811/what-does-the-endbr64-instruction-actually-do
|
||||
|
||||
https://www.spinics.net/lists/kvm/msg208593.html
|
||||
|
||||
https://stackoverflow.com/questions/62436160/is-it-possible-to-temporarily-suppress-intel-cet-for-a-single-ret-instruction-o
|
||||
|
||||
https://github.com/gwsystems/wasmception-clang/blob/e47f248a73cff7bea95f356eacaf60aa3a48c0f9/test/CodeGen/cetintrin.c
|
||||
|
||||
|
||||
```
|
||||
mov eax, 7
|
||||
mov ecx, 0
|
||||
cpuid
|
||||
test ebx, ebx
|
||||
jz not_supported
|
||||
|
||||
```
|
||||
|
||||
```C++
|
||||
#include <windows.h>
|
||||
|
||||
BOOL is_cet_supported() {
|
||||
OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 };
|
||||
DWORDLONG mask = 0;
|
||||
VER_SET_CONDITION(mask, VER_MAJORVERSION, VER_GREATER_EQUAL);
|
||||
VER_SET_CONDITION(mask, VER_MINORVERSION, VER_GREATER_EQUAL);
|
||||
VER_SET_CONDITION(mask, VER_BUILDNUMBER, VER_GREATER_EQUAL);
|
||||
VER_SET_CONDITION(mask, VER_PLATFORMID, VER_EQUAL);
|
||||
osvi.dwMajorVersion = 10;
|
||||
osvi.dwMinorVersion = 0;
|
||||
osvi.dwBuildNumber = 17763;
|
||||
osvi.dwPlatformId = VER_PLATFORM_WIN32_NT;
|
||||
return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER | VER_PLATFORMID, mask);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
`main.cpp`:
|
||||
|
||||
```cpp
|
||||
#include <Windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
using pfnNtQueryInformationProcess = NTSTATUS(NTAPI *)(
|
||||
HANDLE ProcessHandle, /*PROCESSINFOCLASS*/ ULONG ProcessInformationClass,
|
||||
PVOID ProcessInformation, ULONG ProcessInformationLength,
|
||||
PULONG ReturnLength);
|
||||
|
||||
int QueryProcessUserShadowStack(HANDLE hProcess) {
|
||||
int ret = 0;
|
||||
|
||||
do {
|
||||
auto ntdll = GetModuleHandleA("ntdll.dll");
|
||||
if (!ntdll) {
|
||||
printf("ntdll null\n");
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
auto pNtQueryInformationProcess =
|
||||
(pfnNtQueryInformationProcess)GetProcAddress(
|
||||
ntdll, "NtQueryInformationProcess");
|
||||
if (!pNtQueryInformationProcess) {
|
||||
printf("NtQueryInformationProcess null\n");
|
||||
ret = -2;
|
||||
break;
|
||||
}
|
||||
|
||||
PROCESS_MITIGATION_USER_SHADOW_STACK_POLICY pmussp = {0};
|
||||
ULONG uReturnLength = 0;
|
||||
auto ns =
|
||||
pNtQueryInformationProcess(hProcess, ProcessUserShadowStackPolicy,
|
||||
&pmussp, sizeof(pmussp), &uReturnLength);
|
||||
if (ns < 0) {
|
||||
printf("not support\n");
|
||||
ret = -3;
|
||||
break;
|
||||
}
|
||||
|
||||
if (pmussp.EnableUserShadowStack) {
|
||||
printf("EnableUserShadowStack\n");
|
||||
ret = 1;
|
||||
} else {
|
||||
printf("not EnableUserShadowStack\n");
|
||||
ret = 2;
|
||||
}
|
||||
|
||||
} while (0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int ret = QueryProcessUserShadowStack(GetCurrentProcess());
|
||||
printf("ret=%d\n", ret);
|
||||
system("pause");
|
||||
return 0;
|
||||
}
|
||||
|
||||
```
|
||||
+268940
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user