Function at 0x403b40
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0x3e8
call fcn.00406b84
push 1
call fcn.00406c91
add esp, 8
test eax, eax
jne 0x403b7a
push 0x8000
push 1
call fcn.00406d0f
add esp, 8
push 0
call fcn.00406c91
add esp, 4
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x403b99
push 0x8000
push eax
call fcn.00406d0f
add esp, 8
mov edx, dword [0x41eff8]
mov eax, dword [edx]
cmp eax, 0x40
jae 0x403bba
mov ecx, dword [ebp + 8]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [0x41eff8]
inc dword [eax]
mov edx, dword [0x41eff8]
mov eax, dword [0x41d1a8]
push ebx
push esi
push edi
xor edi, edi
xor ebx, ebx
mov dword [ebp - 0x14], 0
mov dword [ebp - 4], edi
test eax, eax
je 0x403c44
mov ebx, eax
mov eax, dword [0x41f000]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x14], 1
cmp word [0x418024], di
je 0x403bf6
mov dword [0x41d1a8], edi
jmp 0x403c4a
mov esi, dword [edx]
xor ecx, ecx
test esi, esi
je 0x403c38
lea eax, [edx + 4]
cmp dword [eax], edi
je 0x403c19
inc ecx
add eax, 4
cmp ecx, esi
jb 0x403c01
push 0
call fcn.0040f0d1
add esp, 4
jmp 0x403c4a
lea eax, [esi - 1]
cmp ecx, eax
jae 0x403c36
mov eax, dword [edx + ecx*4 + 8]
mov dword [edx + ecx*4 + 4], eax
mov edx, dword [0x41eff8]
inc ecx
mov eax, dword [edx]
dec eax
cmp ecx, eax
jb 0x403c20
dec dword [edx]
push 0
call fcn.0040f0d1
add esp, 4
jmp 0x403c4a
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0xc], eax
mov eax, dword [0x41d1d8]
test eax, eax
je 0x403c5c
push eax
call fcn.00406912
add esp, 4
call fcn.0040651c
push 0
mov dword [eax], edi
call sub.WS2_32.dll_WSASetLastError
push dword [0x41eff8]
push dword [ebp + 8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x403fb1
cmp word [ebp - 0x14], 0
mov esi, 0x2008
mov dword [ebp - 8], esi
je 0x403c9b
mov dword [ebp - 0x14], 0
jmp 0x403e93
mov esi, dword [0x41eff8]
mov edi, dword [0x41eff4]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov edx, dword [0x41d1b4]
test edx, edx
je 0x403ccc
mov eax, dword [0x41d1b8]
mov ecx, dword [edx]
mov dword [eax], ecx
mov eax, dword [0x41d1b8]
mov ecx, dword [edx + 4]
mov dword [eax + 4], ecx
lea eax, [ebp - 0x28]
push eax
push 0
push 0
push dword [0x41eff4]
push 0x10
call sub.WS2_32.dll_select
mov esi, eax
test esi, esi
jns 0x403cf9
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x403fc2
test esi, esi
jne 0x403d36
lea eax, [ebp - 0x30]
push eax
call fcn.00406b84
add esp, 4
cmp dword [0x41d1f4], 0
jbe 0x403d36
mov esi, dword [ebp - 0x30]
mov eax, dword [0x41d1b4]
sub esi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x2c]
mov eax, dword [eax]
sbb ecx, dword [ebp - 0x1c]
cdq
cmp ecx, edx
jg 0x403fe8
jl 0x403d36
cmp esi, eax
ja 0x403fe8
push dword [0x41eff4]
mov edi, dword [ebp + 8]
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x403de0
lea eax, [ebp - 0x20]
push eax
call fcn.00406b84
push 0x2000
push dword [0x41effc]
push edi
call fcn.004016f0
add esp, 0x10
test eax, eax
jg 0x403dbc
mov edx, dword [0x41eff8]
xor ecx, ecx
mov esi, dword [edx]
test esi, esi
je 0x403db8
lea eax, [edx + 4]
nop
cmp dword [eax], edi
je 0x403d90
inc ecx
add eax, 4
cmp ecx, esi
jb 0x403d80
xor ebx, ebx
jmp 0x403deb
lea eax, [esi - 1]
cmp ecx, eax
jae 0x403db6
jmp 0x403da0
mov eax, dword [edx + ecx*4 + 8]
mov dword [edx + ecx*4 + 4], eax
mov edx, dword [0x41eff8]
inc ecx
mov eax, dword [edx]
dec eax
cmp ecx, eax
jb 0x403da0
dec dword [edx]
xor ebx, ebx
jmp 0x403deb
cmp word [0x41d198], 0
mov ecx, dword [0x41effc]
mov edi, eax
mov dword [ebp - 4], edi
mov dword [ebp - 0x10], ecx
je 0x403de3
push eax
push ecx
call fcn.00402150
add esp, 8
jmp 0x403de3
mov edi, dword [ebp - 4]
test ebx, ebx
jne 0x403e90
cmp dword [ebp - 0x18], 0
je 0x403e4e
call fcn.0040fc15
test eax, eax
je 0x403e8d
push dword [0x41f000]
call fcn.004072d3
mov edi, dword [0x41f000]
add esp, 4
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x403e13
mov ax, word [0x411804]
mov word [edi], ax
mov eax, dword [0x41f000]
mov ebx, eax
mov dword [ebp - 0xc], eax
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x403e33
sub ebx, ecx
cmp word [0x418024], 0
jne 0x403e8d
mov dword [0x41d1a8], ebx
jmp 0x403e83
push 0x2000
push dword [0x41f000]
push 0
call fcn.0040e2eb
mov ecx, eax
add esp, 0xc
test ecx, ecx
jle 0x403e83
cmp word [0x418024], 0
mov eax, dword [0x41f000]
mov ebx, ecx
mov dword [ebp - 0xc], eax
jne 0x403e8d
mov dword [0x41d1a8], ecx
push 0
call fcn.0040f0d1
add esp, 4
mov edi, dword [ebp - 4]
mov esi, dword [ebp - 8]
cmp ebx, 0x2008
ja 0x403ea3
cmp edi, 0x2008
jbe 0x403eb9
push edi
push ebx
push str.Preposterous_Pointers:__d___d
call fcn.00402c20
xor edi, edi
add esp, 0xc
mov dword [ebp - 4], edi
xor ebx, ebx
test si, si
je 0x404022
test edi, edi
je 0x403f00
push edi
push dword [ebp - 0x10]
push 1
call fcn.0040b397
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x403f00
cmp word [0x41d1e4], 0
je 0x403ef2
push esi
push dword [ebp - 0x10]
push 1
call fcn.004039e0
add esp, 0xc
add dword [ebp - 0x10], esi
sub edi, esi
add dword [0x41d1ac], esi
mov dword [ebp - 4], edi
test ebx, ebx
je 0x403f5b
cmp dword [0x41d1d8], 0
mov esi, dword [ebp - 0xc]
je 0x403f3b
test esi, esi
jne 0x403f18
xor eax, eax
jmp 0x403f3d
cmp ebx, 0x2000
jbe 0x403f24
xor eax, eax
jmp 0x403f3d
mov ecx, ebx
mov eax, esi
test ebx, ebx
jle 0x403f3b
lea esp, [esp]
cmp byte [eax], 0xa
je 0x403f7d
dec ecx
inc eax
test ecx, ecx
jg 0x403f30
mov eax, ebx
push eax
push esi
push dword [ebp + 8]
call fcn.00401840
add esp, 0xc
test eax, eax
jle 0x403f5b
add esi, eax
sub ebx, eax
add dword [0x41d1b0], eax
mov dword [ebp - 0xc], esi
cmp dword [0x41d1d8], 0
jne 0x403f82
test ebx, ebx
jne 0x403f6c
test edi, edi
je 0x403f9b
mov esi, dword [ebp - 8]
add esi, 0xffff
mov dword [ebp - 8], esi
jmp 0x403e93
sub eax, esi
inc eax
jmp 0x403f3d
push dword [0x41d1d8]
call fcn.00406912
add esp, 4
call fcn.0040651c
mov dword [eax], 0
push dword [0x41eff8]
push dword [ebp + 8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x403c80
push dword [ebp + 8]
call sub.WS2_32.dll_closesocket
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
call sub.WS2_32.dll_WSAGetLastError
push str.select_fuxored
call fcn.00402c20
add esp, 4
push dword [ebp + 8]
call sub.WS2_32.dll_closesocket
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
cmp word [0x41d1f0], 1
jbe 0x403fff
push str.net_timeout
call fcn.00402c20
add esp, 4
push dword [ebp + 8]
call sub.WS2_32.dll_closesocket
mov eax, dword [0x41eff8]
push 0
mov dword [eax], 0
call sub.WS2_32.dll_WSASetLastError
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push str.too_many_output_retries
call fcn.00402c20
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret