Function at 0x100402a0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create raw socket
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, edx
mov eax, ecx
mov ecx, dword [ebp + 8]
push edi
mov dword [ebp - 0x70], esi
cmp dword [esi + 4], 0
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x78], ecx
jne 0x100402cf
movzx eax, word [eax + 0x70]
jmp 0x100402d4
mov eax, 1
mov dword [ebp - 0x6c], eax
movzx eax, ax
mov dword [ebp - 0x74], eax
lea edi, [eax + eax*2]
shl edi, 6
sub edi, 0xffffff80
push edi
push 0
push dword [0x10059a38]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x10040329
test byte [0x10059ab8], 2
je 0x10040313
push eax
push edi
push str.CXPLAT_SOCKET
call fcn.10001500
add esp, 0xc
mov eax, 0x8007000e
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.100483f7
mov esp, ebp
pop ebp
ret
test byte [0x10059abe], 8
je 0x10040357
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push eax
neg eax
sbb al, al
and al, 0x1c
movzx eax, al
push eax
push ecx
neg ecx
sbb cl, cl
and cl, 0x1c
movzx eax, cl
push eax
push ebx
call fcn.1003f420
add esp, 0x14
push edi
push 0
push ebx
call fcn.10049330
mov edx, dword [ebp - 0x64]
add esp, 0xc
mov dword [ebx], edx
mov eax, dword [esi + 0x10]
mov dword [ebx + 4], eax
mov ecx, dword [esi + 4]
movzx eax, byte [ebx + 0x4c]
neg ecx
sbb cl, cl
and al, 0xfb
and cl, 4
or cl, al
and cl, 0xfc
mov byte [ebx + 0x4c], cl
movzx eax, byte [edx + 0x73]
shl al, 5
xor al, cl
and al, 0x20
xor al, cl
mov byte [ebx + 0x4c], al
mov ecx, dword [esi]
test ecx, ecx
je 0x100403a9
lea edx, [ebx + 8]
call fcn.1003f4e0
mov edx, dword [ebp - 0x64]
jmp 0x100403b2
mov ecx, 0x17
mov word [ebx + 8], cx
mov eax, 0x5dc
mov word [ebx + 0x44], ax
test byte [esi + 8], 1
je 0x100403c5
or byte [ebx + 0x4c], 0x10
mov edi, dword [ebp - 0x74]
mov eax, 0xfff7
mov dword [ebx + 0x40], edi
mov ecx, 0x5c0
test byte [edx + 0x64], 2
cmove eax, ecx
mov dword [ebx + 0x48], eax
xor eax, eax
cmp ax, word [ebp - 0x6c]
jae 0x10040950
lea esi, [ebx + 0xf0]
and byte [esi - 0x18], 0xfe
lea eax, [esi - 0x68]
mov dword [esi - 0x70], 1
mov dword [esi - 0x28], ebx
mov dword [esi - 0x2c], 0
mov dword [esi - 0x24], 0xffffffff
mov dword [esi - 0x60], 0
mov dword [esi - 0x5c], 0
push 0
mov dword [esi - 0x58], 0
mov dword [esi - 0x54], 0
push 0
mov dword [esi - 0x50], 0
push 0
mov dword [eax], 0x8004
mov dword [esi - 0x64], eax
push 0
mov dword [esi - 0x20], 1
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi - 0x1c], eax
lea eax, [esi - 4]
mov dword [esi - 0x14], 0
lea esi, [esi + 0xc0]
mov dword [esi - 0xd0], 0
mov dword [esi - 0xc0], eax
mov dword [eax], eax
sub edi, 1
jne 0x100403f1
mov esi, dword [ebp - 0x70]
xor eax, eax
movzx ecx, ax
lfence
mov dword [ebp - 0x68], ecx
nop dword [eax]
movzx eax, cx
lea edi, [eax + eax*2]
movzx eax, cx
mov dword [ebp - 0x14], eax
movzx eax, byte [ebx + 0x4c]
and eax, 0x20
shl edi, 6
shl eax, 3
add edi, ebx
or eax, 1
push eax
push 0
push 0
push 0x11
push 2
push 0x17
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov dword [edi + 0xcc], eax
cmp eax, 0xffffffff
je 0x10040bee
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 0
push eax
push 0x1b
push 0x29
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040bd6
cmp dword [esi + 4], 0
jne 0x1004052c
mov eax, dword [ebp - 0x68]
push 0
push 0
mov word [ebp - 0x10], ax
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
push 2
lea eax, [ebp - 0x10]
push eax
push 0x98000015
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x10040982
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0xe
push 0
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040bbe
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0xe
push 0x29
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040ba6
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0x13
push 0x29
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040b8e
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0x13
push 0
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040b72
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0x32
push 0x29
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040b53
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 1
push eax
push 0x32
push 0
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040b34
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], bind
push eax
push 0x1002
push 0xffff
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040b15
mov eax, dword [ebp - 0x64]
test byte [eax + 0x64], 2
je 0x1004066b
push 4
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 0xfff7
push eax
push 3
push 0x11
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x100409a1
push 3
push dword [edi + 0xcc]
call dword [sym.imp.KERNEL32.dll_SetFileCompletionNotificationModes]
test eax, eax
je 0x10040af6
cmp dword [esi + 4], 0
je 0x100406b6
lea eax, [ebp - 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessorNumberEx]
movzx ecx, word [ebp - 0x50]
mov eax, dword [0x10059aa8]
movzx edx, byte [ebp - 0x4e]
add dx, word [eax + ecx*8 + 4]
mov ecx, dword [ebp - 0x64]
movzx eax, dx
xor edx, edx
movzx ecx, word [ecx + 0x70]
div ecx
movzx eax, dx
jmp 0x100406b9
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x64]
mov edx, eax
call fcn.1003f610
mov dword [edi + 0xc4], eax
lea ecx, [eax + 8]
mov eax, 1
lock xadd dword [ecx], eax
inc eax
cmp eax, 1
jg 0x100406e2
mov ecx, 0xe
int 0x29
mov eax, dword [edi + 0xc4]
push 0
push 0
mov esi, dword [eax + 4]
push dword [esi]
push dword [edi + 0xcc]
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
cmp dword [esi], eax
jne 0x10040ad7
test byte [ebx + 0x4c], 0x20
je 0x100407dc
mov eax, dword [edi + 0xc4]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x60], 2
mov eax, dword [eax + 4]
mov eax, dword [eax]
mov dword [ebp - 0x5c], eax
lea eax, [edi + 0xb0]
mov dword [ebp - 0x54], eax
lea eax, [edi + 0xa8]
mov dword [edi + 0xac], 0
mov dword [edi + 0xb0], 0
mov dword [edi + 0xb4], 0
mov dword [edi + 0xb8], 0
mov dword [edi + 0xbc], 0
mov dword [edi + 0xc0], 0
mov dword [eax], 0x8004
mov dword [eax + 4], eax
lea eax, [ebp - 0x60]
push eax
mov eax, dword [ebp - 0x64]
push 0x200
mov esi, dword [eax + 0x40]
mov ecx, esi
call dword [0x1004b298]
call esi
mov dword [edi + 0xdc], eax
test eax, eax
je 0x100409df
push 0
push eax
push eax
mov eax, dword [ebp - 0x64]
push 1
push 0x100
push 1
mov esi, dword [eax + 0x44]
mov ecx, esi
push 0x100
push dword [edi + 0xcc]
call dword [0x1004b298]
call esi
mov dword [edi + 0xe0], eax
test eax, eax
je 0x100409c0
mov esi, dword [ebp - 0x70]
mov eax, dword [esi + 0xc]
test eax, eax
je 0x10040833
push 4
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0xc]
push eax
push 0x1f
push 0x29
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x10040a1d
push dword [esi + 0xc]
call dword [sym.imp.WS2_32.dll_htonl]
push 4
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0xc]
push eax
push 0x1f
push 0
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x100409fe
mov eax, dword [ebp - 0x64]
test byte [eax + 0x64], 0x10
je 0x100408b9
mov eax, dword [esi]
test eax, eax
je 0x100408b9
movzx eax, word [eax + 2]
test ax, ax
je 0x100408b9
cmp word [ebp - 0x68], 0
jne 0x1004088d
push 0
mov word [ebp - 0x18], ax
mov eax, 1
push 0
mov word [ebp - 0x16], ax
lea eax, [ebp - 0x1c]
push eax
push 0x10
lea eax, [ebp - 0x4c]
push eax
push 4
lea eax, [ebp - 0x18]
push eax
push 0x98000064
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_WSAIoctl]
cmp eax, 0xffffffff
je 0x10040a3c
push 0
push 0
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
push 8
lea eax, [ebp - 0x44]
push eax
push 0x98000066
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_WSAIoctl]
cmp eax, 0xffffffff
je 0x10040a5b
push 0x1c
lea eax, [ebx + 8]
push eax
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x10040ab8
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x10040910
xorps xmm0, xmm0
mov dword [ebp - 0x20], 0
lea edx, [ebp - 0x38]
movq qword [ebp - 0x28], xmm0
movups xmmword [ebp - 0x38], xmm0
call fcn.1003f4e0
push 0x1c
mov eax, edx
push eax
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x10040a7a
mov ecx, dword [ebp - 0x68]
test cx, cx
jne 0x1004093f
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0x1c
push eax
lea eax, [ebx + 8]
push eax
push dword [edi + 0xcc]
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
je 0x10040a99
mov ecx, dword [ebp - 0x68]
inc ecx
mov dword [ebp - 0x68], ecx
cmp cx, word [ebp - 0x6c]
jb 0x10040490
mov edi, dword [ebp - 0x74]
lea edx, [ebx + 8]
lea ecx, [ebx + 8]
call fcn.1003f5b0
mov eax, dword [esi + 4]
test eax, eax
je 0x10040c3d
movups xmm0, xmmword [eax]
movups xmmword [ebx + 0x24], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebx + 0x34], xmm0
mov eax, dword [eax + 0x18]
mov dword [ebx + 0x3c], eax
jmp 0x10040c43
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.SIO_CPU_AFFINITY
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_UDP_RECV_MAX_COALESCED_SIZE
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.RIOCreateRequestQueue
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.RIOCreateCompletionQueue
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IP_UNICAST_IF
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IPV6_UNICAST_IF
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.SIO_ACQUIRE_PORT_RESERVATION
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.SIO_ASSOCIATE_PORT_RESERVATION
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.connect
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.getsockaddress
jmp 0x10040c07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.bind
jmp 0x10040c04
call dword [sym.imp.KERNEL32.dll_GetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push 0x100552f8
jmp 0x10040c04
call dword [sym.imp.KERNEL32.dll_GetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push 0x100552d4
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_SO_RCVBUF
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IP_ECN
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IPV6_ECN
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IP_PKTINFO
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IPV6_PKTINFO
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IPV6_DONTFRAG
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IP_DONTFRAGMENT
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push str.Set_IPV6_V6ONLY
jmp 0x10040c04
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test byte [0x10059abe], 4
mov esi, eax
je 0x10040c16
push 0x1005520c
lfence
push esi
push ebx
mov edx, 0x1004c660
call fcn.100048b0
add esp, 0xc
test esi, esi
jle 0x10040c23
movzx esi, si
or esi, 0x80070000
mov ecx, ebx
call fcn.10040f10
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.100483f7
mov esp, ebp
pop ebp
ret
xor eax, eax
mov word [ebx + 0x26], ax
mov eax, dword [ebp - 0x78]
mov dword [eax], ebx
xor eax, eax
cmp ax, word [ebp - 0x6c]
jae 0x10040c7f
lfence
add ebx, 0xd8
nop dword [eax]
push 0
push 0
lea ecx, [ebx - 0x58]
xor edx, edx
call fcn.10042160
or byte [ebx], 1
lea ebx, [ebx + 0xc0]
add esp, 8
sub edi, 1
jne 0x10040c60
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100483f7
mov esp, ebp
pop ebp
ret