Skip to content

Instantly share code, notes, and snippets.

@vToMy
vToMy / set_pipe_permission.py
Created May 18, 2024 23:02
Expand named pipe permission
from win32file import CreateFile, GENERIC_WRITE, OPEN_EXISTING, CloseHandle
from win32con import WRITE_DAC, GENERIC_ALL
from win32api import GetLastError, FormatMessage
from win32security import GetSecurityInfo, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, GRANT_ACCESS, NO_INHERITANCE, \
TRUSTEE_IS_GROUP, TRUSTEE_IS_NAME, SetSecurityInfo
def handle_error(msg: str):
last_error = GetLastError()
err = FormatMessage(last_error)[:-2]
package com.github.vtomy;
import javax.annotation.Nonnull;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
/**