Skip to content

Instantly share code, notes, and snippets.

@psifertex psifertex/scc-built-in.h
Last active Dec 11, 2017

What would you like to do?
list of built-in functions available via SCC on windows
CloseHandle(HANDLE handle) __import("kernel32");
CreateDirectoryA(const char* name, void* security) __import("kernel32");
CreateFileA(const char* name, uint32_t access, uint32_t share, void* security, uint32_t disposition,
CreateFileMappingA(HANDLE file, void* security, uint32_t prot,
CreatePipe(HANDLE* read, HANDLE* write, void* security, uint32_t size) __import("kernel32");
CreateProcessA(const char* app, const char* cmdline, void* processAttr, void* threadAttr,
DeleteFileA(const char* name) __import("kernel32");
ExitProcess(uint32_t exitCode) __import("kernel32") __noreturn;
FindClose(HANDLE find) __import("kernel32");
FindFirstFileA(const char* name, WIN32_FIND_DATAA* data) __import("kernel32");
FindNextFileA(HANDLE find, WIN32_FIND_DATAA* data) __import("kernel32");
GetCurrentDirectoryA(uint32_t len, char* buf) __import("kernel32");
GetCurrentProcessId() __import("kernel32");
GetCurrentThreadId() __import("kernel32");
GetExitCodeProcess(HANDLE proc, uint32_t* exitCode) __import("kernel32");
GetExitCodeThread(HANDLE thread, uint32_t* exitCode) __import("kernel32");
GetFileAttributesA(const char* name) __import("kernel32");
GetFileAttributesExA(const char* name, uint32_t level, void* info) __import("kernel32");
GetFileInformationByHandle(HANDLE file, BY_HANDLE_FILE_INFORMATION* info) __import("kernel32");
GetFileSize(HANDLE file, uint32_t* high) __import("kernel32");
GetHandleInformation(HANDLE obj, uint32_t* flags) __import("kernel32");
GetModuleHandleA(const char* name) __import("kernel32");
GetProcAddress(void* module, const char* name) __import("kernel32");
GetProcessHeap() __import("kernel32");
GetProcessId(HANDLE proc) __import("kernel32");
GetStdHandle(uint32_t type) __import("kernel32");
GetThreadId(HANDLE thread) __import("kernel32");
GetUserNameA(char* buf, uint32_t* size) __import("advapi32");
LoadLibraryA(const char* name) __import("kernel32");
LoadLibraryExA(const char* name, void* reserved, uint32_t flags) __import("kernel32");
MapViewOfFile(HANDLE mapping, uint32_t access, uint32_t offsetHigh,
MessageBoxA(HANDLE hwnd, const char* msg, const char* title, uint32_t flags) __import("user32");
MoveFileA(const char* from, const char* to) __import("kernel32");
OpenProcess(uint32_t access, bool inherit, uint32_t pid) __import("kernel32");
ReadFile(HANDLE file, void* buf, uint32_t bytesToRead, uint32_t* bytesRead, void* overlapped) __import("kernel32");
RemoveDirectoryA(const char* name) __import("kernel32");
RtlAllocateHeap(void* heap, uint32_t flags, size_t bytes) __import("ntdll");
RtlFreeHeap(void* heap, uint32_t flags, void* ptr) __import("ntdll");
SetCurrentDirectoryA(const char* name) __import("kernel32");
SetEndOfFile(HANDLE file) __import("kernel32");
SetFilePointer(HANDLE file, int32_t dist, int32_t* distHigh, uint32_t method) __import("kernel32");
SetHandleInformation(HANDLE obj, uint32_t mask, uint32_t flags) __import("kernel32");
TerminateProcess(HANDLE proc, uint32_t code) __import("kernel32");
UnmapViewOfFile(void* addr) __import("kernel32");
VirtualAlloc(void* addr, size_t size, uint32_t alloc, uint32_t protect) __import("kernel32");
VirtualFree(void* addr, size_t size, uint32_t type) __import("kernel32");
VirtualProtect(void* addr, size_t size, uint32_t prot, uint32_t* oldProt) __import("kernel32");
WSAStartup(uint16_t versionRequested, WSADATA* data) __import("ws2_32");
WaitForMultipleObjects(uint32_t count, const HANDLE* handles, bool all,
WaitForSingleObject(HANDLE handle, uint32_t milliseconds) __import("kernel32");
WriteFile(HANDLE file, const void* buf, uint32_t bytesToWrite, uint32_t* bytesWritten,
accept(int sockfd, struct sockaddr* addr, socklen_t* addrlen) __import("ws2_32");
bind(int sockfd, const struct sockaddr* addr, socklen_t addrlen) __import("ws2_32");
closesocket(int sockfd) __import("ws2_32");
connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen) __import("ws2_32");
getpeername(int sockfd, struct sockaddr* addr, socklen_t* addrlen) __import("ws2_32");
getsockname(int sockfd, struct sockaddr* addr, socklen_t* addrlen) __import("ws2_32");
getsockopt(int fd, int level, int optname, void* optval, socklen_t* optlen) __import("ws2_32");
listen(int sockfd, int backlog) __import("ws2_32");
recv(int fd, void* buf, int n, int flags) __import("ws2_32");
recvfrom(int fd, void* buf, int n, int flags, struct sockaddr* addr, socklen_t* addrlen) __import("ws2_32");
send(int fd, const void* buf, int n, int flags) __import("ws2_32");
sendto(int fd, const void* buf, int n, int flags, const struct sockaddr* addr, socklen_t addrlen) __import("ws2_32");
setsockopt(int fd, int level, int optname, const void* optval, socklen_t optlen) __import("ws2_32");
shutdown(int sockfd, int how) __import("ws2_32");
socket(int af, int type, int protocol) __import("ws2_32");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.