Function at 0x406070
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x11c
push esi
xor esi, esi
push 0x400
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
call fcn.004075bf
add esp, 4
cmp eax, esi
mov dword [esp + 8], eax
jne 0x4060ab
mov eax, 0x15
pop esi
add esp, 0x11c
ret
mov eax, dword [esp + 0x128]
mov esi, dword [esp + 0x124]
push ebx
push ebp
push edi
mov dword [esp + 0x20], eax
mov eax, dword [esi + 0x9c]
xor ecx, ecx
test eax, eax
mov dword [esp + 0x28], ecx
jne 0x4060ea
mov eax, dword [esi + 0xa4]
test eax, eax
jne 0x4060ea
mov ecx, dword [esi + 0x24]
mov dword [esp + 0x2c], ecx
mov ecx, 1
mov dword [esp + 0x28], ecx
mov eax, dword [esi + 0xa0]
test eax, eax
jne 0x406126
xor eax, eax
test ecx, ecx
jbe 0x40610d
mov edi, dword [esi + 0x28]
lea edx, [esp + 0x2c]
cmp dword [edx], edi
je 0x40610d
inc eax
add edx, 4
cmp eax, ecx
jb 0x406101
cmp eax, ecx
jne 0x406126
cmp ecx, 0x40
jae 0x406126
mov edx, dword [esi + 0x28]
mov dword [esp + eax*4 + 0x2c], edx
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x28]
mov ecx, dword [esi + 0x24]
cmp eax, ecx
jbe 0x406133
inc eax
jmp 0x406136
lea eax, [ecx + 1]
lea ecx, [esp + 0x20]
lea edx, [esp + 0x28]
push ecx
push 0
push 0
push edx
push eax
call dword [sym.imp.WS2_32.dll_select]
mov ebp, eax
test ebp, ebp
je 0x40634c
jl 0x406353
mov ecx, dword [esi + 0x28]
lea eax, [esp + 0x28]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x406267
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x10]
lea eax, [esi + 0x80]
push edx
mov edx, dword [esi + 0x28]
push eax
push 0
push 0x400
mov edi, 0x10
push ecx
push edx
mov dword [esp + 0x28], edi
call dword [sym.imp.WS2_32.dll_recvfrom]
mov ebx, eax
test ebx, ebx
jle 0x40624b
mov eax, dword [esi + 0x14]
test eax, eax
je 0x4061e6
push ebx
push esi
call eax
add esp, 8
test eax, eax
je 0x4061e6
mov ecx, dword [esp + 0x134]
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
shl ecx, 3
cmp eax, ecx
jg 0x40635a
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 3
push edx
call dword [sym.imp.KERNEL32.DLL_Sleep]
mov dword [esp + 0x10], edi
xor edi, edi
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push eax
lea eax, [esi + 0x70]
mov ecx, ebx
push eax
mov eax, dword [esi + 0x24]
sub ecx, edi
push 0
add edx, edi
push ecx
push edx
push eax
call dword [sym.imp.WS2_32.dll_sendto]
mov ebp, eax
test ebp, ebp
jle 0x406361
add edi, ebp
cmp edi, ebx
jl 0x4061ec
mov edi, dword [esi + 0x98]
mov edx, dword [esp + 0x18]
mov eax, dword [esi + 0xa4]
add edi, ebx
add edx, ebx
mov dword [esi + 0x98], edi
test eax, eax
mov dword [esp + 0x18], edx
je 0x406270
mov ecx, edx
cmp eax, ecx
jle 0x406368
jmp 0x406270
je 0x40636f
test ebx, ebx
jge 0x406270
cmp dword [0x412190], 0x2733
jne 0x4063b8
jmp 0x406270
cmp ebp, 0xffffffff
je 0x4063bf
mov eax, dword [esi + 0x9c]
test eax, eax
jne 0x4060c0
mov edx, dword [esi + 0x24]
lea ecx, [esp + 0x28]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x406342
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x10]
lea ecx, [esi + 0x70]
push eax
mov eax, dword [esi + 0x24]
push ecx
push 0
push 0x400
mov edi, 0x10
push edx
push eax
mov dword [esp + 0x28], edi
call dword [sym.imp.WS2_32.dll_recvfrom]
mov ebx, eax
test ebx, ebx
jle 0x406327
mov dword [esp + 0x10], edi
xor edi, edi
lea ebp, [esi + 0x80]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov edx, ebx
push ecx
mov ecx, dword [esi + 0x28]
push ebp
sub edx, edi
push 0
add eax, edi
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jle 0x406361
add edi, eax
cmp edi, ebx
jl 0x4062ce
mov edi, dword [esi + 0x94]
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 0xa0]
add edi, ebx
add edx, ebx
mov dword [esi + 0x94], edi
test eax, eax
mov dword [esp + 0x1c], edx
je 0x4060c0
mov ecx, edx
cmp eax, ecx
jle 0x406390
jmp 0x4060c0
je 0x406397
test ebx, ebx
jge 0x4060c0
cmp dword [0x412190], 0x2733
jne 0x4063b8
jmp 0x4060c0
cmp ebp, 0xffffffff
je 0x4063bf
jmp 0x4060c0
mov esi, 0x61
jmp 0x4063c4
mov esi, 0x5b
jmp 0x4063c4
mov esi, 0x5f
jmp 0x4063c4
mov esi, 0x5c
jmp 0x4063c4
mov esi, 0x62
jmp 0x4063c4
mov edx, dword [esi + 0x28]
push 2
push edx
call dword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [esi + 0x28]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x28], 0xffffffff
xor esi, esi
jmp 0x4063c4
mov esi, 0x63
jmp 0x4063c4
mov ecx, dword [esi + 0x24]
push 2
push ecx
call dword [sym.imp.WS2_32.dll_shutdown]
mov edx, dword [esi + 0x24]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x24], 0xffffffff
xor esi, esi
jmp 0x4063c4
mov esi, 0x5d
jmp 0x4063c4
mov esi, 0x5e
mov eax, dword [esp + 0x14]
push eax
call fcn.00407669
add esp, 4
mov eax, esi
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x11c
ret