Skip to content

Instantly share code, notes, and snippets.

void GetCentennialNotepadAppExecutionAliasPath(PWSTR path, int cch)
{
PWSTR pszPath = 0;
SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, 0, &pszPath);
StringCchCatW(path, cch, pszPath);
StringCchCatW(path, cch, L"\\Microsoft\\WindowsApps\\Microsoft.WindowsNotepad_8wekyb3d8bbwe\\notepad.exe");
if (pszPath) CoTaskMemFree(pszPath);
}
#include "stdafx.h"
NTSTATUS CreatePipePair(_Out_ PHANDLE phServerPipe,
_Out_ PHANDLE phClientPipe,
_In_ ULONG ClientOptions = FILE_SYNCHRONOUS_IO_NONALERT,
_In_ ULONG ServerOptions = 0)
{
HANDLE hFile;
IO_STATUS_BLOCK iosb;
PsSetCreateProcessNotifyRoutineEx=0
PsSetLoadImageNotifyRoutine=0
00001 17:38:07 + 13ac(sc.exe) 00007FFEEDED0000{1a000} u \Device\HarddiskVolume9\Windows\System32\kernel.appcore.dll
(::)C:\WINDOWS\SYSTEM32\kernel.appcore.dll
00002 17:38:07 + 13ac(sc.exe) 00007FFEEFB20000{a9000} u \Device\HarddiskVolume9\Windows\System32\msvcrt.dll
(::)C:\WINDOWS\System32\msvcrt.dll
1 13ac exit [1]13ac(sc.exe) ================
00003 17:38:07 b58(cmd.exe) 00007FFEEDED0000{1a000} u \Device\HarddiskVolume9\Windows\System32\kernel.appcore.dll
(::)C:\WINDOWS\SYSTEM32\kernel.appcore.dll
EXTERN_C_START
NTSYSAPI
NTSTATUS
NTAPI
RtlPrepareForProcessCloning();
NTSYSAPI
NTSTATUS
NTAPI
#include <ntnls.h>
NTSTATUS MakeProcessUTF8(PVOID hmod, PVOID BaseAddress, SIZE_T ViewSize)
{
UINT AnsiCodePage = GetACP();
PIMAGE_NT_HEADERS pinth;
NTSTATUS status = RtlImageNtHeaderEx(0, BaseAddress, ViewSize, &pinth);
if (0 > status)
{
#define RTL_USER_PROC_UTF8_PROCESS 0x08000000
NTSTATUS SetPtocessUtf8(HANDLE hProcess)
{
PROCESS_BASIC_INFORMATION pbi;
_RTL_USER_PROCESS_PARAMETERS* ProcessParameters;
ULONG Flags;
NTSTATUS status;
0 <= (status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), 0)) &&
struct IDriverInstallStatusNotify
{
virtual HRESULT STDMETHODCALLTYPE Notify(ULONG s)
{
__debugbreak();
DbgPrint("Notify(%x)\n", s);
return S_OK;
}
};
1>------ Build started: Project: prepare, Configuration: Release x64 ------
1>stdafx.cpp
1>Note: including file: C:\Users\Harry\Documents\GitHub\SC_DEMO\prepare\stdafx.h
1>Note: including file: C:\Users\Harry\Documents\GitHub\SC_DEMO\pnth\pch.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\crt\stdlib.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\crt\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\specstrings.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\sal.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\concurrencysal.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\specstrings_strict.h
enum class PREFERRED_APP_MODE {
Default,
AllowDark,
ForceDark,
ForceLight,
Max
};
EXTERN_C_START
RtlGuardIsValidStackPointer
FFFFF802CD3BD900 test rdx,rdx
FFFFF802CD3BD903 je FFFFF802CD3BD95F v
FFFFF802CD3BD905 mov rax,qword ptr [rdx+1478h] // <-- LowLimit from GetCurrentThreadStackLimits
FFFFF802CD3BD90C mov qword ptr [rsp+20h],rax
FFFFF802CD3BD911 mov rax,qword ptr [rdx+8] // <-- NT_TIB::StackBase
FFFFF802CD3BD915 mov qword ptr [rsp+10h],rax
FFFFF802CD3BD91A mov rax,qword ptr [rdx+10h] // <-- NT_TIB::StackLimit
FFFFF802CD3BD91E mov qword ptr [rsp+18h],rax
FFFFF802CD3BD923 mov rdx,rax