Skip to content

Commit

Permalink
ref Bush2021/chrome_plus for Chromium 125.x
Browse files Browse the repository at this point in the history
  • Loading branch information
czyt committed May 7, 2024
1 parent 8959ae1 commit 8a61e81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/green.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ NET_API_STATUS WINAPI MyNetUserGetInfo(
}

#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON (0x00000001ui64 << 44)
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON (0x00000001ui64 << 28)

typedef BOOL(WINAPI *pUpdateProcThreadAttribute)(
LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
Expand All @@ -167,8 +168,10 @@ BOOL WINAPI MyUpdateProcThreadAttribute(
{
if (Attribute == PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY && cbSize >= sizeof(DWORD64))
{
// https://source.chromium.org/chromium/chromium/src/+/main:sandbox/win/src/process_mitigations.cc;l=362;drc=4c2fec5f6699ffeefd93137d2bf8c03504c6664c
PDWORD64 policy_value_1 = &((PDWORD64)lpValue)[0];
*policy_value_1 &= ~PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON;
*policy_value_1 &= ~PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON;
}
return RawUpdateProcThreadAttribute(lpAttributeList, dwFlags, Attribute, lpValue, cbSize, lpPreviousValue, lpReturnSize);
}
Expand Down Expand Up @@ -280,7 +283,7 @@ void MakeGreen()

LPVOID ppUpdateProcThreadAttribute = nullptr;
MH_STATUS status = MH_CreateHookApiEx(L"kernel32", "UpdateProcThreadAttribute",
&MyUpdateProcThreadAttribute, (LPVOID *)&RawUpdateProcThreadAttribute, &ppUpdateProcThreadAttribute);
&MyUpdateProcThreadAttribute, (LPVOID *)&RawUpdateProcThreadAttribute, &ppUpdateProcThreadAttribute);
if (status == MH_OK)
{
MH_EnableHook(ppUpdateProcThreadAttribute);
Expand Down

0 comments on commit 8a61e81

Please sign in to comment.