Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Cobalt-Strike/sleepmask-vs
/ functions
Functions
87 in github.com/Cobalt-Strike/sleepmask-vs
⨍
Functions
87
◇
Types & classes
13
↓ 36 callers
Function
DumpApiEntry
* A helper function to display the contents of a SYSCALL_API_ENTRY structure. * * @param name A pointer to a char* containing (human readable) target
sleepmask-vs/library/debug.cpp:111
↓ 17 callers
Function
PrepareSyscall
* Sets the globals currentJmpAddr/SysNum to target sys call. * * Note: This is inspired by RecycledGate: * https://github.com/thefLink/RecycledGate/bl
sleepmask-vs/library/indirectsyscalls.cpp:116
↓ 14 callers
Function
_memset
* Move a specified byte into a memory location * * @param ptr A pointer to the destination buffer * @param byte The byte to copy into memory * @param
sleepmask-vs/library/stdlib.cpp:30
↓ 4 callers
Function
BeaconGateWrapper
* A wrapper around BeaconGate to handle masking/unmasking Beacon * * @param info A pointer to a BEACON_INFO structure * @param gateFunction A pointer
sleepmask-vs/library/gate.cpp:17
↓ 4 callers
Function
FindGadget
* Find a specific byte pattern (gadget) in a module's .text section. * * Note: We search the .text section to make sure the gadget is RX. * * @param m
sleepmask-vs/library/retaddrspoofing.cpp:20
↓ 3 callers
Function
CalculateFunctionStackSizeWrapper
* Wrapper for calculating the stack size for a given function. * * @param returnAddress The target return address to calculate the stack size for.
sleepmask-vs/library/stackspoofing.cpp:275
↓ 3 callers
Function
DumpRtlEntry
* A helper function to display the contents of a RTL_API structure. * * @param name A pointer to a char* containing (human readable) target function n
sleepmask-vs/library/debug.cpp:121
↓ 3 callers
Function
MaskBeacon
* Mask Beacon * * @param beaconInfo A pointer to the BEACON_INFO structure */
sleepmask-vs/library/masking.cpp:17
↓ 3 callers
Function
PrintBeaconGateInfo
* A helper function to display the contents of a FUNCTION_CALL structure. * * @param entry A pointer to a FUNCTION_CALL structure. */
sleepmask-vs/library/debug.cpp:98
↓ 3 callers
Function
PrintSleepMaskInfo
* A helper function to display the contents of the SLEEPMASK_INFO structure. * * @param info A pointer to a SLEEPMASK_INFO structure. */
sleepmask-vs/library/debug.cpp:26
↓ 3 callers
Function
TestSysCallApi
* Unit test runner which will ensure that all sys calls * are behaving as expected with whatever technique is * implemented in *-sleepmask.cpp. */
sleepmask-vs/unit-tests/syscallapi-unit-tests.cpp:51
↓ 3 callers
Function
UnMaskBeacon
* UnMask Beacon * * @param beaconInfo A pointer to the BEACON_INFO structure */
sleepmask-vs/library/masking.cpp:28
↓ 2 callers
Function
BeaconGate
* Execute BeaconGate. * * @param gateFunction A pointer to a FUNCTION_CALL structure */
sleepmask-vs/library/gate.cpp:36
↓ 2 callers
Function
DripProtectSection
sleepmask-vs/library/masking.cpp:71
↓ 2 callers
Function
NtAllocateVirtualMemoryWrapper
* VirtualAllocEx --> NtAllocateVirtualMemory * * arg[0] [in] HANDLE hProcess --> [0] [in] HANDLE ProcessHandle * arg[1] [in] LPVOID lpAddre
sleepmask-vs/library/syscallapi.cpp:81
↓ 2 callers
Function
NtCreateThreadExWrapper
* CreateRemoteThread --> NtCreateThreadEx * * --> [0] [out] PHANDLE ThreadHandle *
sleepmask-vs/library/syscallapi.cpp:255
↓ 2 callers
Function
NtProtectVirtualMemoryWrapper
* VirtualProtectEx --> NtProtectVirtualMemory * * arg[0] HANDLE hProcess --> HANDLE ProcessHandle * arg[1] LPVOID lpAdress --> PVO
sleepmask-vs/library/syscallapi.cpp:128
↓ 2 callers
Function
TestArgumentsArePassedCorrectlyWrapper
Test function wrapper to ensure that asm harnesses correctly pass up to 10 arguments.
sleepmask-vs/unit-tests/syscallapi-unit-tests.cpp:21
↓ 2 callers
Function
XORBeacon
* XOR Beacon's Sections/Heap Records * * @param beaconInfo A pointer to the BEACON_INFO structure * @param mask A Boolean value to indicate whether to
sleepmask-vs/library/masking.cpp:40
↓ 2 callers
Function
XORData
* XOR the provided buffer with the provided key * * @param buffer The buffer to XOR * @param size The size of the buffer * @param key The key to XOR t
sleepmask-vs/library/masking.cpp:195
↓ 2 callers
Function
_NtResumeThread
sleepmask-vs/library/indirectsyscalls.cpp:79
↓ 2 callers
Function
_memcmp
* A function to compare two memory blocks * * @param ptr1 A pointer to the destination buffer * @param ptr2 A pointer to the source buffer * @para
sleepmask-vs/library/stdlib.cpp:46
↓ 1 callers
Function
CalculateFunctionStackSize
* Calculates the stack size for a given function. * * @param pRuntimeFunction A pointer to a RUNTIME_FUNCTION structure. * @param imageBase A dword
sleepmask-vs/library/stackspoofing.cpp:195
↓ 1 callers
Function
DraugrGate
* Execute DraugrGate. * * @param draugrCall A pointer to a DRAUGR_FUNCTION_CALL structure. */
sleepmask-vs/library/stackspoofing.cpp:22
↓ 1 callers
Function
DraugrGateWrapper
* A wrapper around DraugrGate to handle masking/unmasking Beacon. * * @param info A pointer to a SLEEPMASK_INFO structure. * @param draugrCall A po
sleepmask-vs/library/stackspoofing.cpp:85
↓ 1 callers
Function
DraugrSpoofStub
* Asm stub for performing draugr call stack spoofing. * * @param (...) accepts variadic args. * @return A PVOID containing return value. */
sleepmask-vs/library/stackspoofing.cpp:403
↓ 1 callers
Function
FindGadget
* Find a gadget to use for call stack spoofing. * * Note: This function has been optimized from the original * to only find gadgets once. * * @pa
sleepmask-vs/library/stackspoofing.cpp:148
↓ 1 callers
Function
FindGadgets
* Find the specified gadgets and store them for future use. * * @param A pointer to a GADGETS structure. * * @return BOOL indicating success. */
sleepmask-vs/library/retaddrspoofing.cpp:66
↓ 1 callers
Function
FindRegionByPurpose
* Find a specific region within the ALLOCATED_MEMORY structure * * @param allocatedMemory A pointer to a ALLOCATED_MEMORY structure * @param purpose
sleepmask-vs/library/utils.cpp:19
↓ 1 callers
Function
GetTextSectionSize
* Retrieve size of text section. * * @param pModule A pointer to target module. * @param pdwVirtualAddress [out] A pointer to start of target modul
sleepmask-vs/library/stackspoofing.cpp:115
↓ 1 callers
Function
InitFrameInfo
* Initialise the fake stack frame. * * @param stackFrame A pointer to a SYNTHETIC_STACK_FRAME structure. * @return A BOOL indicating success. */
sleepmask-vs/library/stackspoofing.cpp:301
↓ 1 callers
Function
InitializeDraugr
* Configures Draugr for use in BeaconGate. * * @param A pointer* to a DRAUGR_FUNCTION_CALL structure. */
sleepmask-vs/draugr-sleepmask.cpp:44
↓ 1 callers
Function
InitializeSysCalls
* Configures system calls for use in BeaconGate. * * @param A pointer to a BEACON_SYSCALLS structure. */
sleepmask-vs/library/utils.cpp:33
↓ 1 callers
Function
IsWritable
* Check if memory protection is writable * @param dwProtection The current memory protection constant * @return A Boolean value to indicate it is writ
sleepmask-vs/library/masking.cpp:60
↓ 1 callers
Function
NtCloseWrapper
* CloseHandle --> NtClose * * arg[0] HANDLE hObject --> [0] [in] HANDLE Handle */
sleepmask-vs/library/syscallapi.cpp:364
↓ 1 callers
Function
NtCreateSectionWrapper
* CreateFileMappingA --> NtCreateSection * * --> [0] [out] PHANDLE Sectio
sleepmask-vs/library/syscallapi.cpp:391
↓ 1 callers
Function
NtDuplicateObjectWrapper
* DuplicateHandle --> NtDuplicateObject * * arg[0] [in] HANDLE hSourceProcessHandle --> [0] [in] HANDLE SourceProcessHandle * arg[1] [in]
sleepmask-vs/library/syscallapi.cpp:522
↓ 1 callers
Function
NtFreeVirtualMemoryWrapper
* VirtualFree --> NtFreeVirtualMemory * * --> HANDLE ProcessHandle * arg[0] LPVOID lpAddress --> PVOID *BaseAddress *
sleepmask-vs/library/syscallapi.cpp:162
↓ 1 callers
Function
NtGetContextThreadWrapper
* GetThreadContext --> NtGetContextThread * * arg[0] [in] HANDLE hThread --> [0] [in] HANDLE ThreadHandle * arg[1] [in, out] LPCONTE
sleepmask-vs/library/syscallapi.cpp:183
↓ 1 callers
Function
NtMapViewOfSectionWrapper
* MapViewOfFile --> NtMapViewOfSection * * arg[0] [in] HANDLE fileMappingObject --> [0] [in] HANDLE SectionHandle *
sleepmask-vs/library/syscallapi.cpp:442
↓ 1 callers
Function
NtOpenProcessWrapper
* OpenProcess --> NtOpenProcess * * --> [0] [out] PHANDLE ProcessHandle * arg[0] [in] DWORD dwDesiredAccess --
sleepmask-vs/library/syscallapi.cpp:303
↓ 1 callers
Function
NtOpenThreadWrapper
* OpenThread --> NtOpenThread * * --> [0] [out] PHANDLE ThreadHandle * arg[0] [in] DWORD dwDesiredAccess --> [1]
sleepmask-vs/library/syscallapi.cpp:335
↓ 1 callers
Function
NtQueryVirtualMemoryWrapper
* VirtualQuery --> NtQueryVirtualMemory * * --> [0] [in] HANDLE ProcessHandle * arg[0] [in] LPC
sleepmask-vs/library/syscallapi.cpp:496
↓ 1 callers
Function
NtReadProcessMemoryWrapper
* ReadProcessMemory--> NtReadVirtualMemory * * arg[0] [in] HANDLE hProcess --> [0] [in] HANDLE ProcessHandle * arg[1] [in] LP
sleepmask-vs/library/syscallapi.cpp:544
↓ 1 callers
Function
NtResumeThreadWrapper
* ResumeThread --> NtResumeThread * * arg[0] [in] HANDLE hThread --> [0] [in] HANDLE ThreadHandle * --> [1] [out] P
sleepmask-vs/library/syscallapi.cpp:219
↓ 1 callers
Function
NtSetContextThreadWrapper
* SetThreadContext --> NtSetContextThread * * arg[0] [in] HANDLE hThread --> [0] [in] HANDLE ThreadHandle * arg[1] [in] CONTEXT *lpContext
sleepmask-vs/library/syscallapi.cpp:201
↓ 1 callers
Function
NtUnmapViewOfSectionWrapper
* UnmapViewOfFile --> NtUnmapViewOfSection * * --> [in] HANDLE ProcessHandle * arg[0] [in] LPCVOID lpBase Add
sleepmask-vs/library/syscallapi.cpp:472
↓ 1 callers
Function
NtWriteProcessMemoryWrapper
* WriteProcessMemory --> NtWriteProcessMemory * * arg[0] [in] HANDLE hProcess --> [0] [in] HANDLE ProcessHandle * arg[1] [
sleepmask-vs/library/syscallapi.cpp:565
↓ 1 callers
Function
PrintSyscallInfo
* A helper function to display the contents of a BEACON_SYSCALLS structure. * * @param entry A pointer to a BEACON_SYSCALLS structure. */
sleepmask-vs/library/debug.cpp:130
↓ 1 callers
Function
SetupFunctionCall
* Set the required gadget before ret address spoofing. * * Note: Here we ensure that a call to a function in WinINet will * return to WinINet.dll and
sleepmask-vs/library/retaddrspoofing.cpp:124
↓ 1 callers
Function
SysCallDispatcher
* The sys call interface layer between Beacon -> BeaconGate. * Routes higher level API (e.g. VirtualAlloc) to its Nt equivalent (e.g. NtAllocateVirtua
sleepmask-vs/library/syscallapi.cpp:15
↓ 1 callers
Function
XORHeapRecords
* XOR Heap Records * * @param beaconInfo A pointer to the BEACON_INFO structure */
sleepmask-vs/library/masking.cpp:176
↓ 1 callers
Function
XORSections
* XOR the sections in the provided memory region * * @param allocatedRegion A pointer to a ALLOCATED_MEMORY_REGION structure * @param maskKey A pointe
sleepmask-vs/library/masking.cpp:96
↓ 1 callers
Function
_NtAllocateVirtualMemory
Memory management APIs.
sleepmask-vs/library/indirectsyscalls.cpp:18
↓ 1 callers
Function
_NtClose
sleepmask-vs/library/indirectsyscalls.cpp:95
↓ 1 callers
Function
_NtCreateSection
sleepmask-vs/library/indirectsyscalls.cpp:38
↓ 1 callers
Function
_NtCreateThreadEx
Thread APIs.
sleepmask-vs/library/indirectsyscalls.cpp:64
↓ 1 callers
Function
_NtDuplicateObject
sleepmask-vs/library/indirectsyscalls.cpp:100
↓ 1 callers
Function
_NtFreeVirtualMemory
sleepmask-vs/library/indirectsyscalls.cpp:28
↓ 1 callers
Function
_NtGetContextThread
sleepmask-vs/library/indirectsyscalls.cpp:69
↓ 1 callers
Function
_NtMapViewOfSection
sleepmask-vs/library/indirectsyscalls.cpp:43
↓ 1 callers
Function
_NtOpenProcess
Handle APIs.
sleepmask-vs/library/indirectsyscalls.cpp:85
↓ 1 callers
Function
_NtOpenThread
sleepmask-vs/library/indirectsyscalls.cpp:90
↓ 1 callers
Function
_NtProtectVirtualMemory
sleepmask-vs/library/indirectsyscalls.cpp:23
↓ 1 callers
Function
_NtQueryVirtualMemory
sleepmask-vs/library/indirectsyscalls.cpp:33
↓ 1 callers
Function
_NtReadVirtualMemory
sleepmask-vs/library/indirectsyscalls.cpp:53
↓ 1 callers
Function
_NtSetContextThread
sleepmask-vs/library/indirectsyscalls.cpp:74
↓ 1 callers
Function
_NtUnmapViewOfSection
sleepmask-vs/library/indirectsyscalls.cpp:48
↓ 1 callers
Function
_NtWriteVirtualMemory
sleepmask-vs/library/indirectsyscalls.cpp:58
Function
DoIndirectSyscallx86
sleepmask-vs/library/indirectsyscalls.cpp:167
Function
PrintAllocatedMemoryRegion
* A helper function to display the contents of a ALLOCATED_MEMORY_REGION structure. * * @param memoryRegion A pointer to a ALLOCATED_MEMORY_REGION str
sleepmask-vs/library/debug.cpp:44
Function
SpoofCall
* Spoofs the call stack for a target function. * * Note: The fake call stack could be cached to avoid re-calculating it for each function call. *
sleepmask-vs/library/stackspoofing.cpp:340
Function
SpoofReturnAddressx64
This attribute ensures the compiler generates code without prolog / epilog code. Note: This attribute causes an intellisense error as it cannot parse
sleepmask-vs/library/retaddrspoofing.cpp:159
Function
SpoofReturnAddressx86
sleepmask-vs/library/retaddrspoofing.cpp:195
Function
TestArgumentsArePassedCorrectly
Test function to ensure that asm harnesses correctly pass up to 10 arguments.
sleepmask-vs/unit-tests/syscallapi-unit-tests.cpp:7
Function
_memcpy
* Copy memory from one location to another * * @param dest A pointer to the destination buffer * @param src A pointer to the source buffer * @param si
sleepmask-vs/library/stdlib.cpp:11
Function
dlog
sleepmask-vs/library/debug.cpp:12
Function
go
sleepmask-vs/unit-test-bof.cpp:40
Function
main
sleepmask-vs/unit-test-bof.cpp:408
Function
main
sleepmask-vs/retaddrspoofing-sleepmask.cpp:96
Function
main
sleepmask-vs/indirectsyscalls-sleepmask.cpp:81
Function
main
sleepmask-vs/default-sleepmask.cpp:41
Function
main
sleepmask-vs/draugr-sleepmask.cpp:107
Function
sleep_mask
* Sleepmask-VS entry point * * Note: To enable logging for Release builds set ENABLE_LOGGING to * 1 in debug.h. */
sleepmask-vs/retaddrspoofing-sleepmask.cpp:45
Function
sleep_mask
* Sleepmask-VS entry point * * Note: To enable logging for Release builds set ENABLE_LOGGING to * 1 in debug.h. */
sleepmask-vs/indirectsyscalls-sleepmask.cpp:44
Function
sleep_mask
* Sleepmask-VS entry point * * Note: To enable logging for Release builds set ENABLE_LOGGING to * 1 in debug.h. */
sleepmask-vs/default-sleepmask.cpp:33
Function
sleep_mask
* Sleepmask-VS entry point * * Note: To enable logging for Release builds set ENABLE_LOGGING to * 1 in debug.h. */
sleepmask-vs/draugr-sleepmask.cpp:69