Documentation
¶
Index ¶
- Constants
- func CheckRemoteDebuggerPresent(hProcess wincall.Handle, pbDebuggerPresent *bool) (err error)
- func ControlService(hService wincall.Handle, dwControl uint32, ...) (err error)
- func ControlServiceEx(hService wincall.Handle, dwControl, dwInfoLevel uint32, ...) (err error)
- func CreateCmdProcess(StdInPipeRead, StdOutPipeWrite wincall.Handle) (wincall.Handle, error)
- func CreateProcess(appName *uint16, commandLine *uint16, cF uint32, sI *wincall.StartupInfo, ...) error
- func CreateProcessWithToken(token wincall.Token, dwLogonFlags uint32, appName *uint16, commandLine *uint16, ...) (err error)
- func CreateRemoteThread(hProcess wincall.Handle, lpThreadAttributes *wincall.SecurityAttributes, ...) (r1 uintptr, err error)
- func DeleteService(hService wincall.Handle) (err error)
- func DuplicateTokenEx(hExistingToken wincall.Token, dwDesireAccess uint32, ...) (err error)
- func EnableDebugPrivilege(hToken *wincall.Token) (err error)
- func EnablePrivileges(token *wincall.Token, privs []string) (err error)
- func FindProcName(name string, pe32 *wincall.ProcessEntry32) error
- func GlobalAlloc(uFlags uint32, dwSize *uint32) (r1 uintptr, err error)
- func GlobalFree(hMem uintptr) (r1 uintptr, err error)
- func GlobalLock(hMem uintptr) (r1 uintptr, err error)
- func GlobalMemoryStatusEx(lpBuffer *MemoryStatusEX) (err error)
- func GlobalUnlock(hMem uintptr) (err error)
- func ImpersonateLoggedOnUser(token wincall.Token) (err error)
- func IsDebuggerPresent() bool
- func LogonUser(lpszUsername, lpszDomain, lpszPassword string, ...) (err error)
- func NtQueryInformationProcess(hProcess wincall.Handle, information wincall.PROCESS_BASIC_INFORMATION, ...) (err error)
- func OpenCurrentProcessToken() (wincall.Token, error)
- func OpenSCManager(lpMachineName, lpDatabaseName *uint16, dwDesiredAccess uint32) (handle wincall.Handle, err error)
- func OpenService(hSCManager wincall.Handle, lpServiceName *uint16, dwDesiredAccess uint32) (handle wincall.Handle, err error)
- func OutputDebugString(lpOutputStr *uint16) (err error)
- func RegCreateKeyEx(hKey wincall.Handle, lpSubKey *uint16, Reserved DWORD, lpClass LPCWSTR, ...) (err error)
- func RegEnumValue(hKey wincall.Handle, dwIndex uint32, lpValueName *uint16, ...) (err error)
- func RegSetValueEx(hKey wincall.Handle, lpValueName LPCWSTR, Reserved, dwType DWORD, ...) (err error)
- func RemovePrivileges(token *wincall.Token, privs []string) (err error)
- func ReportErrorCloseHandle(err error, header string, handle wincall.Handle, ...)
- func RtlCopyMemory(dst, src uintptr, length uint32) (err error)
- func StringFromU16Slice(charName []uint16) string
- func UTF16PtrToString(p *uint16) string
- func VirtualAlloc(lpAddress, dwSize uintptr, flAllocationType, flProtect uint32) (value uintptr, err error)
- func VirtualAllocEx(hProcess wincall.Handle, lpAddress, dwSize uintptr, ...) (r1 uintptr, err error)
- func VirtualFreeEx(hProcess wincall.Handle, lpAddress, dwSize uintptr, dwFreeType uint32) (err error)
- type BitMapInfoHeader
- type Callback
- type DWORD
- type HANDLE
- type HKEY
- type KbdLLHook
- type LONG
- type LPARAM
- type LPBYTE
- type LPCTSTR
- type LPCWSTR
- type LPDWORD
- type LPTSTR
- type LPVOID
- type MSG
- type MemoryStatusEX
- type MsLLHook
- type PipeHandle
- type Point
- type ProcessInformationClass
- type SIZE_T
- type Slice
- type ThreadStartRoutine
- type ULONG
- type WINHTTP_NO_CLIENT_CERT_CONTEXT
- type WORD
- type WPARAM
- type WinHttpCurrUserIEProxyConfig
- type WindowClassEX
Constants ¶
View Source
const ( // NT Defined Privileges SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege" SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege" SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege" SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege" SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege" SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege" SE_TCB_NAME = "SeTcbPrivilege" SE_SECURITY_NAME = "SeSecurityPrivilege" SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege" SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege" SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege" SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege" SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege" SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege" SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege" SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege" SE_BACKUP_NAME = "SeBackupPrivilege" SE_RESTORE_NAME = "SeRestorePrivilege" SE_SHUTDOWN_NAME = "SeShutdownPrivilege" SE_DEBUG_NAME = "SeDebugPrivilege" SE_AUDIT_NAME = "SeAuditPrivilege" SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege" SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege" SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege" SE_UNDOCK_NAME = "SeUndockPrivilege" SE_SYNC_AGENT_NAME = "SeSyncAgentPrivilege" SE_ENABLE_DELEGATION_NAME = "SeEnableDelegationPrivilege" SE_MANAGE_VOLUME_NAME = "SeManageVolumePrivilege" SE_IMPERSONATE_NAME = "SeImpersonatePrivilege" SE_CREATE_GLOBAL_NAME = "SeCreateGlobalPrivilege" SE_TRUSTED_CREDMAN_ACCESS_NAME = "SeTrustedCredManAccessPrivilege" SE_RELABEL_NAME = "SeRelabelPrivilege" SE_INC_WORKING_SET_NAME = "SeIncreaseWorkingSetPrivilege" SE_TIME_ZONE_NAME = "SeTimeZonePrivilege" SE_CREATE_SYMBOLIC_LINK_NAME = "SeCreateSymbolicLinkPrivilege" SE_DELEGATE_SESSION_USER_IMPERSONATE_NAME = "SeDelegateSessionUserImpersonatePrivilege" )
View Source
const ( // Logon Support APIs LOGON32_PROVIDER_DEFAULT = uint32(iota) LOGON32_PROVIDER_WINNT35 LOGON32_LOGON_INTERACTIVE LOGON32_LOGON_NETWORK LOGON32_LOGON_BATCH LOGON32_LOGON_SERVICE LOGON32_LOGON_UNLOCK = iota + 1 // LogonFlags LOGON_WITH_PROFILE uint32 = 0x00000001 LOGON_NETCREDENTIALS_ONLY uint32 = 0x00000002 LOGON_ZERO_PASSWORD_BUFFER uint32 = 0x80000000 )
View Source
const ( WM_MOUSEMOVE = iota + 0x0200 WM_LBUTTONDOWN // 左键按下 WM_LBUTTONUP // 左键释放 WM_LBUTTONDBLCLK // 左键双击 WM_RBUTTONDOWN // 右键按下 WM_RBUTTONUP // 右键释放 WM_RBUTTONDBLCLK // 右键双击 WM_MBUTTONDOWN // 中键按下 WM_MBUTTONUP // 中键释放 WM_MBUTTONDBLCLK // 中键双击 // 剪贴板动作 WM_DESTROYCLIPBOARD = 0x0307 WM_DRAWCLIPBOARD = 0x0308 WM_CLIPBOARDUPDATE = 0x031D WH_KEYBOARD_LL = 13 WH_MOUSE_LL = 14 )
鼠标动作
View Source
const ( MB_OK = 0x00000000 MB_OKCANCEL = 0x00000001 MB_ABORTRETRYIGNORE = 0x00000002 MB_YESNOCANCEL = 0x00000003 MB_YESNO = 0x00000004 MB_RETRYCANCEL = 0x00000005 )
View Source
const ( REG_SZ = 1 ERROR_SUCEESS = 0 HKEY_CURRENT_USER = 0x80000001 KEY_SET_VALUE = 0x0002 KEY_WOW64_64KEY = 0x100 KEY_WOW32_32KEY = 0x200 )
Reg APIs define
View Source
const ( // Service Types //SERVICE_WIN32_OWN_PROCESS = 0x00000010 //SERVICE_WIN32_SHARE_PROCESS = 0x00000020 //SERVICE_WIN32 = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS SERVICE_USER_SERVICE = 0x00000040 // Service object specific access type //SERVICE_QUERY_CONFIG = 0x0001 //SERVICE_CHANGE_CONFIG = 0x0002 //SERVICE_QUERY_STATUS = 0x0004 //SERVICE_ENUMERATE_DEPENDENTS = 0x0008 //SERVICE_START = 0x0010 //SERVICE_STOP = 0x0020 //SERVICE_PAUSE_CONTINUE = 0x0040 //SERVICE_INTERROGATE = 0x0080 //SERVICE_USER_DEFINED_CONTROL = 0x0100 SERVICE_ALL_ACCESS = 0xF01FF // ALL of (Service object specific access type) | () // Controls SERVICE_CONTROL_TIMECHANGE = 0x00000010 )
Service Table
View Source
const ( // WinHttpOpen dwAccessType values (also for WINHTTP_PROXY_INFO::dwAccessType) WINHTTP_ACCESS_TYPE_DEFAULT_PROXY = 0 WINHTTP_ACCESS_TYPE_NO_PROXY = 1 WINHTTP_ACCESS_TYPE_NAMED_PROXY = 3 WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY = 4 // WinHttpOpenRequest prettifers for optional parameters WINHTTP_NO_REFERER = "" WINHTTP_DEFAULT_ACCEPT_TYPES = "" // Flags for dwAutoDetectFlags WINHTTP_AUTO_DETECT_TYPE_DHCP = 0x00000001 WINHTTP_AUTO_DETECT_TYPE_DNS_A = 0x00000002 )
View Source
const ( // Windows Error ERROR_SUCCESS syscall.Errno = 0 CF_TEXT = 1 CF_UNICODETEXT = 13 CW_USEDEFAULT = ^uintptr(uint32(0)) HC_ACTION = 0 WS_EX_APPWINDOW = 0x00040000 WS_POPUP = 0x80000000 )
U
Variables ¶
This section is empty.
Functions ¶
func ControlService ¶
func ControlService(hService wincall.Handle, dwControl uint32, pControlParam *wincall.SERVICE_STATUS) (err error)
Use wincall ControlService
func ControlServiceEx ¶
func CreateCmdProcess ¶
func CreateProcess ¶
func CreateProcess(appName *uint16, commandLine *uint16, cF uint32, sI *wincall.StartupInfo, pI *wincall.ProcessInformation) error
func CreateProcessWithToken ¶
func CreateRemoteThread ¶
func CreateRemoteThread(hProcess wincall.Handle, lpThreadAttributes *wincall.SecurityAttributes, dwStackSize, lpStartAddress uintptr, lpParameter uintptr, dwCreationFlags uint32, lpThreadId *uint32) (r1 uintptr, err error)
TODO: lpStartAddress LPTHREAD_START_ROUTINE
func DeleteService ¶
func DuplicateTokenEx ¶
func EnableDebugPrivilege ¶
func FindProcName ¶
func FindProcName(name string, pe32 *wincall.ProcessEntry32) error
func GlobalFree ¶
func GlobalLock ¶
func GlobalMemoryStatusEx ¶
func GlobalMemoryStatusEx(lpBuffer *MemoryStatusEX) (err error)
func GlobalUnlock ¶
func ImpersonateLoggedOnUser ¶
func IsDebuggerPresent ¶
func IsDebuggerPresent() bool
func NtQueryInformationProcess ¶
func NtQueryInformationProcess(hProcess wincall.Handle, information wincall.PROCESS_BASIC_INFORMATION, pbi wincall.ProcessInformation, returnLength uint32) (err error)
func OpenCurrentProcessToken ¶
func OpenSCManager ¶
func OpenService ¶
func OpenService(hSCManager wincall.Handle, lpServiceName *uint16, dwDesiredAccess uint32) (handle wincall.Handle, err error)
Use wincall OpenService
func OutputDebugString ¶
func RegCreateKeyEx ¶
func RegEnumValue ¶
func RegEnumValue(hKey wincall.Handle, dwIndex uint32, lpValueName *uint16, lpcchValueName, lpReserved, dwType *uint32, lpData LPBYTE, lpcbData *uint32) (err error)
RegOpenKeyEx = syscall.RegOpenKeyEx RegCloseKey = syscall.RegCloseKey TODO:
func RegSetValueEx ¶
func ReportErrorCloseHandle ¶
func RtlCopyMemory ¶
func StringFromU16Slice ¶
func UTF16PtrToString ¶
func VirtualAlloc ¶
func VirtualAlloc(lpAddress, dwSize uintptr, flAllocationType, flProtect uint32) (value uintptr, err error)
Use wincall VirtualAlloc
func VirtualAllocEx ¶
Types ¶
type BitMapInfoHeader ¶
type KbdLLHook ¶
type KbdLLHook struct {
VkCode uint32
ScanCode uint32
Flags uint32
Time uint32
DwExtraInfo uintptr
}
KbdLLHook KeyBoard Hook Struct
type MemoryStatusEX ¶
type PipeHandle ¶
PipeHandle Make an Input/Output Anonymous Pipe
func MakePipe ¶
func MakePipe() (p PipeHandle, err error)
func (*PipeHandle) Init ¶
func (p *PipeHandle) Init() (err error)
type ProcessInformationClass ¶
type ProcessInformationClass any
var (
ProcessBasicInformation ProcessInformationClass = wincall.ProcessBasicInformation
)
type ThreadStartRoutine ¶
type ThreadStartRoutine uintptr
type WINHTTP_NO_CLIENT_CERT_CONTEXT ¶
WinHttpOpen prettifiers for optional parameters
type WindowClassEX ¶
type WindowClassEX struct {
CbSize uint32
Style uint32
LpfnWndProc uintptr
CbClsExtra int32
CbWndExtra int32
HInstance uintptr
HIcon uintptr
HCursor uintptr
HbrBackground uintptr
LpszMenuName *uint16
LpszClassName *uint16
HIconSm uintptr
}
WindowClassEX Windows
func InitWindowClassEx ¶
func InitWindowClassEx(cb Callback, hInstance uintptr, lpClassName string) (ex *WindowClassEX)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.