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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10324
call fcn.0040d87c
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
mov ebx, 0x252c400a
add ebx, 0x4dd5
mov eax, ebx
mul ebx
mov dword [ebp - 0x1031c], eax
mov ebx, eax
push 0
call sub.CRTDLL.DLL__sleep
pop ecx
and dword [ebp - 0x104], 0
xor ebx, 0x771b
cmp dword [ebp - 0x104], 0x40
jae 0x4091c5
mov edx, dword [ebp - 0x104]
inc dword [ebp - 0x104]
mov dword [ebp + edx*4 - 0x100], edi
cmp dword [ebp - 0x104], 0x40
jae 0x4091e1
mov edx, dword [ebp - 0x104]
inc dword [ebp - 0x104]
mov dword [ebp + edx*4 - 0x100], esi
inc dword [0x42f748]
mov eax, ebx
add eax, ebx
mov ebx, eax
and dword [ebp - 0x30c], 0
cmp dword [ebp - 0x30c], 0x40
jae 0x409210
mov edx, dword [ebp - 0x30c]
inc dword [ebp - 0x30c]
mov dword [ebp + edx*4 - 0x308], edi
cmp dword [ebp - 0x30c], 0x40
jae 0x40922c
mov edx, dword [ebp - 0x30c]
inc dword [ebp - 0x30c]
mov dword [ebp + edx*4 - 0x308], esi
and dword [ebp - 0x208], 0
mov eax, ebx
add eax, ebx
mov ebx, eax
cmp dword [ebp - 0x208], 0x40
jae 0x409255
mov edx, dword [ebp - 0x208]
inc dword [ebp - 0x208]
mov dword [ebp + edx*4 - 0x204], edi
cmp dword [ebp - 0x208], 0x40
jae 0x409271
mov edx, dword [ebp - 0x208]
inc dword [ebp - 0x208]
mov dword [ebp + edx*4 - 0x204], esi
inc dword [0x42f748]
mov eax, ebx
mul ebx
mov dword [ebp - 0x10320], eax
mov ebx, eax
and dword [ebp - 0x318], 0
mov dword [ebp - 0x314], 0x64
lea eax, [ebp - 0x318]
push eax
lea eax, [ebp - 0x30c]
push eax
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x104]
push eax
push 2
call sub.wsock32.dll_select
lea eax, [ebp - 0x104]
push eax
push esi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x409377
lea edx, [ebp - 0x208]
push edx
push edi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x409377
push 0
push 0xffff
lea eax, [ebp - 0x10317]
push eax
push esi
call sub.wsock32.dll_recv
mov dword [ebp - 0x310], eax
cmp eax, 0xffffffff
jne 0x409313
push edi
call sub.wsock32.dll_closesocket
add ebx, 0x6235
xor eax, eax
jmp 0x40949f
inc dword [0x42f748]
cmp dword [ebp - 0x310], 0
jne 0x40933b
push esi
call sub.wsock32.dll_closesocket
xor eax, eax
jmp 0x40949f
mov eax, dword [ebp - 0x310]
mov byte [ebp + eax - 0x10317], 0
inc dword [0x42f748]
push 0
push eax
lea eax, [ebp - 0x10317]
push eax
push edi
call sub.wsock32.dll_send
cmp eax, 0xffffffff
jne 0x409377
push edi
call sub.wsock32.dll_closesocket
xor ebx, 0x6c9a
xor eax, eax
jmp 0x40949f
lea eax, [ebp - 0x104]
push eax
push edi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x409440
lea edx, [ebp - 0x208]
push edx
push esi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x409440
push 0
push 0xffff
lea eax, [ebp - 0x10317]
push eax
push edi
call sub.wsock32.dll_recv
mov dword [ebp - 0x310], eax
cmp eax, 0xffffffff
jne 0x4093d3
push edi
call sub.wsock32.dll_closesocket
mov eax, ebx
xor eax, ebx
mov ebx, eax
xor eax, eax
jmp 0x40949f
cmp dword [ebp - 0x310], 0
jne 0x409401
inc dword [0x42f748]
xor ebx, 0x4627
push edi
call sub.wsock32.dll_closesocket
xor eax, eax
jmp 0x40949f
inc dword [0x42f748]
add ebx, 0x305b
mov eax, dword [ebp - 0x310]
mov byte [ebp + eax - 0x10317], 0
push 0
push eax
lea eax, [ebp - 0x10317]
push eax
push esi
call sub.wsock32.dll_send
cmp eax, 0xffffffff
jne 0x409440
push edi
call sub.wsock32.dll_closesocket
mov eax, ebx
sub eax, ebx
mov ebx, eax
xor eax, eax
jmp 0x40949f
lea eax, [ebp - 0x30c]
push eax
push esi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x40946e
inc dword [0x42f748]
mov eax, ebx
add eax, ebx
mov ebx, eax
push esi
call sub.wsock32.dll_closesocket
xor eax, eax
inc eax
jmp 0x40949f
lea eax, [ebp - 0x30c]
push eax
push edi
call sub.wsock32.dll___WSAFDIsSet
or eax, eax
je 0x409490
push edi
call sub.wsock32.dll_closesocket
mov eax, ebx
add eax, ebx
mov ebx, eax
xor eax, eax
inc eax
jmp 0x40949f
jmp 0x409194
pop edi
pop esi
pop ebx
leave
ret