Function at 0x1002fd20
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 0x1002fd70
mov eax, dword [ebx + 0x290]
cmp eax, 0xffffffff
je 0x1002fd70
push 0
push eax
push ebx
call fcn.1002bd90
mov byte [ebx + 0x294], 0xff
jmp 0x1002fd70
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 0x10030239
js 0x10030297
add dword [ebp - 4], eax
mov eax, dword [ebx + 0x15c]
cmp eax, 0xffffffff
je 0x1002ff0c
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1002ff0c
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 0x10030322
cmp eax, 0xffffffff
je 0x10030322
mov edx, dword [ebx + 0x15c]
push 0
push 4
lea ecx, [ebp - 0x17]
push ecx
push edx
call esi
test eax, eax
je 0x10030322
cmp eax, 0xffffffff
je 0x10030322
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x100302a9
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 0x100302c2
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 0x100302e2
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 0x10030302
mov esi, dword [ebp + 8]
push 0
push ebx
push esi
call fcn.1002bd90
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x1002ff03
mov esi, dword [esi + 0x15c]
cmp dword [ebp + eax*4 - 0x13c], esi
je 0x1002fed2
inc eax
cmp eax, ecx
jb 0x1002fec2
jmp 0x1002ff03
lea edx, [ecx - 1]
cmp eax, edx
jae 0x1002fefc
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 0x1002fee0
dec ecx
mov dword [ebp - 0x140], ecx
dec dword [ebp - 8]
je 0x1003022d
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x17c]
cmp eax, 0xffffffff
je 0x1002ffcc
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1002ffcc
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 0x1003029d
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 0x10030335
push 0
push esi
push ebx
call fcn.1002bd90
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x1002ffc3
mov edx, dword [ebx + 0x17c]
cmp dword [ebp + eax*4 - 0x13c], edx
je 0x1002ff97
inc eax
cmp eax, ecx
jb 0x1002ff87
jmp 0x1002ffc3
lea edx, [ecx - 1]
cmp eax, edx
jae 0x1002ffbc
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 0x1002ffa0
dec ecx
mov dword [ebp - 0x140], ecx
dec dword [ebp - 8]
je 0x1003022d
mov eax, dword [ebx + 0x29c]
cmp eax, 0xffffffff
je 0x1003013d
lea ecx, [ebp - 0x140]
push ecx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1003013d
cmp dword [ebx + 0x2a0], 0
jne 0x1003000f
mov edx, dword [ebx + 0x29c]
push 0xffffffffffffffff
push edx
push ebx
call fcn.1002bd90
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 0x1003003c
mov byte [ebx + 0x2a4], 0
jmp 0x100300db
cmp byte [ebx + 0x2a4], 0
mov edx, dword [ebp - 0xc]
je 0x10030090
mov eax, edx
lea esi, [ebx + 0x2a8]
lea edi, [ebp - 0x2c]
cmp edx, 4
jb 0x1003006c
mov ecx, dword [edi]
cmp ecx, dword [esi]
jne 0x10030090
sub eax, 4
add esi, 4
add edi, 4
cmp eax, 4
jae 0x10030058
test eax, eax
je 0x100300d4
mov cl, byte [esi]
cmp cl, byte [edi]
jne 0x10030090
cmp eax, 1
jbe 0x100300d4
mov cl, byte [esi + 1]
cmp cl, byte [edi + 1]
jne 0x10030090
cmp eax, 2
jbe 0x100300d4
mov al, byte [esi + 2]
cmp al, byte [edi + 2]
je 0x100300d4
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 0x10030348
mov eax, dword [ebx + 0x29c]
push 0
push 1
push 0x1004ef5c
push eax
call dword [sym.imp.WS2_32.dll_send]
mov esi, ebx
call fcn.1002f850
mov ecx, dword [ebp - 0x140]
xor eax, eax
test ecx, ecx
je 0x10030133
mov edx, dword [ebx + 0x29c]
lea ecx, [ecx]
cmp dword [ebp + eax*4 - 0x13c], edx
je 0x10030100
inc eax
cmp eax, ecx
jb 0x100300f0
jmp 0x10030133
lea edx, [ecx - 1]
cmp eax, edx
jae 0x1003012c
jmp 0x10030110
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 0x10030110
dec ecx
mov dword [ebp - 0x140], ecx
mov eax, dword [ebp - 8]
dec eax
je 0x1003022d
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 0x1003016a
mov ecx, dword [edi + 4]
mov edx, dword [ecx + 0x2d4]
mov dword [edi], edx
jmp 0x10030172
mov eax, dword [eax + 0x765c]
mov dword [edi], eax
mov esi, dword [edi]
test esi, esi
je 0x10030216
cmp byte [esi + 0x29], 0
jne 0x10030157
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 0x1003020a
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 0x1003020a
mov eax, dword [esi + 0x24]
cmp eax, 3
ja case.default.0x100301b4
jmp dword [eax*4 + 0x1003035c]
mov eax, esi
call fcn.1002c3c0
mov eax, esi
call fcn.1002d330
jmp 0x10030157
mov eax, esi
call fcn.10037ee0
mov eax, esi
call fcn.1002d330
jmp 0x10030157
mov eax, esi
call fcn.10038020
mov eax, esi
call fcn.1002d330
jmp 0x10030157
push esi
call fcn.1002c540
mov eax, esi
call fcn.1002d330
jmp 0x10030157
mov eax, esi
call fcn.1002dd40
mov eax, esi
call fcn.1002d330
jmp 0x10030157
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
cmp byte [ebx + 0x33c], 0
jne 0x1002fd70
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 0x10030266
mov ecx, dword [esi + 4]
mov edx, dword [ecx + 0x2d4]
mov dword [esi], edx
jmp 0x1003026e
mov eax, dword [eax + 0x765c]
mov dword [esi], eax
mov eax, dword [esi]
test eax, eax
je 0x10030281
cmp byte [eax + 0x29], 0
jne 0x10030253
call fcn.1002d330
jmp 0x10030253
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.1002fb40
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