Function at 0x10030850
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x144
push ebx
mov ebx, dword [ebp + 8]
cmp byte [ebx + 0x294], 0
push esi
push edi
mov dword [ebp - 0xc], 0x10
mov dword [ebp - 0x10], 1
mov dword [ebp - 4], 0
jne 0x100308a0
mov eax, dword [ebx + 0x290]
cmp eax, 0xffffffff
je 0x100308a0
push 0
push eax
push ebx
call fcn.1002c8d0
mov byte [ebx + 0x294], 0xff
jmp 0x100308a0
mov eax, dword [ebp + 0xc]
lea edi, [ebp - 0x140]
lea esi, [ebx + 0x188]
mov ecx, 0x104
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x34]
push ecx
push 0
mov dword [ebp - 0x30], eax
mov eax, dword [ebx + 0x184]
push 0
lea edx, [ebp - 0x140]
push edx
inc eax
push eax
mov dword [ebp - 0x34], 0
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 8], eax
test eax, eax
je 0x10030d69
js 0x10030dc7
add dword [ebp - 4], eax
mov eax, dword [ebx + 0x15c]
cmp eax, 0xffffffff
je 0x10030a3c
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x10030a3c
mov eax, dword [ebx + 0x15c]
mov esi, dword [sym.imp.WS2_32.dll_recv]
push 0
push 5
lea edx, [ebp - 0x1c]
push edx
push eax
call esi
test eax, eax
je 0x10030e52
cmp eax, 0xffffffff
je 0x10030e52
mov edx, dword [ebx + 0x15c]
push 0
push 4
lea ecx, [ebp - 0x17]
push ecx
push edx
call esi
test eax, eax
je 0x10030e52
cmp eax, 0xffffffff
je 0x10030e52
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x10030dd9
push 4
lea eax, [ebp - 0x10]
push eax
push 1
push 6
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x10030df2
mov eax, dword [ebp - 0xc]
mov esi, dword [ebp + 8]
mov ecx, eax
add esi, 0x164
lea edi, [ebp - 0x2c]
rep movsb byte es:[edi], byte [esi]
push eax
lea ecx, [ebp - 0x2c]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x10030e12
push 0
push 9
lea edx, [ebp - 0x1c]
push edx
push ebx
mov byte [ebp - 0x18], 3
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 9
jne 0x10030e32
mov esi, dword [ebp + 8]
push 0
push ebx
push esi
call fcn.1002c8d0
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x10030a33
mov esi, dword [esi + 0x15c]
cmp dword [ebp + eax*4 - 0x13c], esi
je 0x10030a02
inc eax
cmp eax, ecx
jb 0x100309f2
jmp 0x10030a33
lea edx, [ecx - 1]
cmp eax, edx
jae 0x10030a2c
lea esp, [esp]
mov ecx, dword [ebp + eax*4 - 0x138]
mov dword [ebp + eax*4 - 0x13c], ecx
mov ecx, dword [ebp - 0x140]
inc eax
lea edx, [ecx - 1]
cmp eax, edx
jb 0x10030a10
dec ecx
mov dword [ebp - 0x140], ecx
dec dword [ebp - 8]
je 0x10030d5d
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x17c]
cmp eax, 0xffffffff
je 0x10030afc
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x10030afc
mov ecx, dword [ebx + 0x17c]
lea edx, [ebp - 0xc]
push edx
lea eax, [ebp - 0x2c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_accept]
mov esi, eax
test esi, esi
js 0x10030dcd
push 4
lea edx, [ebp - 0x10]
push edx
push 1
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x10030e65
push 0
push esi
push ebx
call fcn.1002c8d0
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x10030af3
mov edx, dword [ebx + 0x17c]
cmp dword [ebp + eax*4 - 0x13c], edx
je 0x10030ac7
inc eax
cmp eax, ecx
jb 0x10030ab7
jmp 0x10030af3
lea edx, [ecx - 1]
cmp eax, edx
jae 0x10030aec
mov edi, edi
mov ecx, dword [ebp + eax*4 - 0x138]
mov dword [ebp + eax*4 - 0x13c], ecx
mov ecx, dword [ebp - 0x140]
inc eax
lea edx, [ecx - 1]
cmp eax, edx
jb 0x10030ad0
dec ecx
mov dword [ebp - 0x140], ecx
dec dword [ebp - 8]
je 0x10030d5d
mov eax, dword [ebx + 0x29c]
cmp eax, 0xffffffff
je 0x10030c6d
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x10030c6d
cmp dword [ebx + 0x2a0], 0
jne 0x10030b3f
mov edx, dword [ebx + 0x29c]
push 0xffffffffffffffff
push edx
push ebx
call fcn.1002c8d0
mov dword [ebx + 0x2a0], eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebx + 0x29c]
lea ecx, [ebp - 0x2c]
push ecx
push 2
push 1
lea edx, [ebp - 0x1c]
push edx
push eax
call dword [sym.imp.WS2_32.dll_recvfrom]
test eax, eax
jns 0x10030b6c
mov byte [ebx + 0x2a4], 0
jmp 0x10030c0b
cmp byte [ebx + 0x2a4], 0
mov edx, dword [ebp - 0xc]
je 0x10030bc0
mov eax, edx
lea esi, [ebx + 0x2a8]
lea edi, [ebp - 0x2c]
cmp edx, 4
jb 0x10030b9c
mov ecx, dword [edi]
cmp ecx, dword [esi]
jne 0x10030bc0
sub eax, 4
add esi, 4
add edi, 4
cmp eax, 4
jae 0x10030b88
test eax, eax
je 0x10030c04
mov cl, byte [esi]
cmp cl, byte [edi]
jne 0x10030bc0
cmp eax, 1
jbe 0x10030c04
mov cl, byte [esi + 1]
cmp cl, byte [edi + 1]
jne 0x10030bc0
cmp eax, 2
jbe 0x10030c04
mov al, byte [esi + 2]
cmp al, byte [edi + 2]
je 0x10030c04
mov ecx, edx
lea esi, [ebp - 0x2c]
lea edi, [ebx + 0x2a8]
rep movsb byte es:[edi], byte [esi]
push edx
mov edx, dword [ebx + 0x29c]
lea ecx, [ebp - 0x2c]
push ecx
push edx
mov byte [ebx + 0x2a4], 0xff
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
js 0x10030e78
mov eax, dword [ebx + 0x29c]
push 0
push 1
push 0x1004e05c
push eax
call dword [sym.imp.WS2_32.dll_send]
mov esi, ebx
call fcn.10030380
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x10030c63
mov edx, dword [ebx + 0x29c]
lea ecx, [ecx]
cmp dword [ebp + eax*4 - 0x13c], edx
je 0x10030c30
inc eax
cmp eax, ecx
jb 0x10030c20
jmp 0x10030c63
lea edx, [ecx - 1]
cmp eax, edx
jae 0x10030c5c
jmp 0x10030c40
mov ecx, dword [ebp + eax*4 - 0x138]
mov dword [ebp + eax*4 - 0x13c], ecx
mov ecx, dword [ebp - 0x140]
inc eax
lea edx, [ecx - 1]
cmp eax, edx
jb 0x10030c40
dec ecx
mov dword [ebp - 0x140], ecx
mov eax, dword [ebp - 8]
dec eax
je 0x10030d5d
push 0xc
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
add esp, 4
mov dword [edi], 0
mov dword [edi + 4], ebx
mov byte [edi + 8], 0
mov eax, dword [edi]
test eax, eax
jne 0x10030c9a
mov ecx, dword [edi + 4]
mov edx, dword [ecx + 0x2d4]
mov dword [edi], edx
jmp 0x10030ca2
mov eax, dword [eax + 0x765c]
mov dword [edi], eax
mov esi, dword [edi]
test esi, esi
je 0x10030d46
cmp byte [esi + 0x29], 0
jne 0x10030c87
mov ecx, dword [esi + 0x14]
lea eax, [ebx + 0x188]
push eax
push ecx
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x10030d3a
mov eax, dword [esi + 0x14]
lea edx, [ebp - 0x140]
push edx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x10030d3a
mov eax, dword [esi + 0x24]
cmp eax, 3
ja case.default.0x10030ce4
jmp dword [eax*4 + 0x10030e8c]
mov eax, esi
call fcn.1002cf00
mov eax, esi
call fcn.1002de60
jmp 0x10030c87
mov eax, esi
call fcn.10038a10
mov eax, esi
call fcn.1002de60
jmp 0x10030c87
mov eax, esi
call fcn.10038b50
mov eax, esi
call fcn.1002de60
jmp 0x10030c87
push esi
call fcn.1002d080
mov eax, esi
call fcn.1002de60
jmp 0x10030c87
mov eax, esi
call fcn.1002e870
mov eax, esi
call fcn.1002de60
jmp 0x10030c87
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
cmp byte [ebx + 0x33c], 0
jne 0x100308a0
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0xc
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 4
mov dword [esi], 0
mov dword [esi + 4], ebx
mov byte [esi + 8], 0
mov eax, dword [esi]
test eax, eax
jne 0x10030d96
mov ecx, dword [esi + 4]
mov edx, dword [ecx + 0x2d4]
mov dword [esi], edx
jmp 0x10030d9e
mov eax, dword [eax + 0x765c]
mov dword [esi], eax
mov eax, dword [esi]
test eax, eax
je 0x10030db1
cmp byte [eax + 0x29], 0
jne 0x10030d83
call fcn.1002de60
jmp 0x10030d83
push esi
call dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [ebp - 4]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x28c], 2
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [ebp + 8]
push ebx
mov dword [edx + 0x28c], 2
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 8]
push ebx
mov dword [eax + 0x28c], 2
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp + 8]
push ebx
mov dword [ecx + 0x28c], 2
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov esi, ebx
call fcn.10030670
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
pop edi
pop esi
mov byte [ebx + 0x2a4], 0
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 8