Function at 0x413140
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x4044
call fcn.00415f20
mov eax, dword [0x41e00c]
xor eax, esp
mov dword [esp + 0x4040], eax
push ebx
mov ebx, dword [0x41e7f8]
xor edx, edx
push esi
push edi
mov esi, 1
mov dword [esp + 0x2040], edx
mov eax, dword [ebx + 8]
mov edi, dword [ebx]
mov dword [esp + 0xc], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], esi
test edi, edi
je 0x413222
nop
cmp dword [edi], 2
jl 0x4131d5
xor ecx, ecx
test edx, edx
je 0x4131ae
mov eax, dword [edi + 0x50]
nop
cmp dword [esp + ecx*4 + 0x2044], eax
je 0x4131ae
inc ecx
cmp ecx, edx
jb 0x4131a0
cmp ecx, edx
jne 0x413207
cmp edx, 0x800
jae 0x413207
mov eax, dword [edi + 0x50]
mov dword [esp + ecx*4 + 0x2044], eax
mov edx, dword [esp + 0x2040]
inc edx
mov dword [esp + 0x2040], edx
jmp 0x413207
xor eax, eax
test esi, esi
je 0x4131eb
mov ecx, dword [edi + 0x50]
nop
cmp dword [esp + eax*4 + 0x3c], ecx
je 0x4131eb
inc eax
cmp eax, esi
jb 0x4131e0
cmp eax, esi
jne 0x413207
cmp esi, 0x800
jae 0x413207
mov ecx, dword [edi + 0x50]
mov dword [esp + eax*4 + 0x3c], ecx
mov esi, dword [esp + 0x38]
inc esi
mov dword [esp + 0x38], esi
mov eax, dword [edi + 0x50]
cmp eax, dword [esp + 0xc]
mov edi, dword [edi + 0x70]
cmovbe eax, dword [esp + 0xc]
mov dword [esp + 0xc], eax
test edi, edi
jne 0x413190
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], 0
push ecx
push 0
lea ecx, [esp + 0x2048]
mov dword [esp + 0x20], 0x2710
push ecx
lea ecx, [esp + 0x44]
inc eax
push ecx
push eax
call dword [sym.imp.WS2_32.dll_select]
call fcn.00412320
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], edx
mov edi, dword [ebx]
mov dword [esp + 0xc], ebx
mov esi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea eax, [esp + 0x38]
push eax
test edi, edi
je 0x413355
push dword [edi + 0x50]
call esi
test eax, eax
je 0x41328a
mov ecx, edi
call fcn.00412b70
test eax, eax
jne 0x4133af
lea eax, [esp + 0x2040]
push eax
push dword [edi + 0x50]
call esi
test eax, eax
je 0x4132aa
mov ecx, edi
call fcn.00412d40
test eax, eax
jne 0x4133af
mov edx, dword [ebx + 0x18]
mov eax, edx
mov ecx, dword [ebx + 0x1c]
or eax, ecx
je 0x4132e0
mov eax, dword [ebx + 0x10]
sub eax, dword [edi + 0x40]
mov esi, dword [ebx + 0x14]
sbb esi, dword [edi + 0x44]
push 0
push 0x3e8
push ecx
push edx
mov dword [esp + 0x20], eax
call fcn.00415d70
cmp esi, edx
jg 0x413322
jl 0x4132e0
cmp dword [esp + 0x10], eax
ja 0x413322
mov edx, dword [ebx + 0x20]
mov eax, edx
mov ecx, dword [ebx + 0x24]
or eax, ecx
je 0x413316
mov eax, dword [ebx + 0x10]
sub eax, dword [edi + 0x38]
mov esi, dword [ebx + 0x14]
sbb esi, dword [edi + 0x3c]
push 0
push 0x3e8
push ecx
push edx
mov dword [esp + 0x20], eax
call fcn.00415d70
cmp esi, edx
jg 0x413322
jl 0x413316
cmp dword [esp + 0x10], eax
ja 0x413322
mov eax, dword [ebx + 0x28]
test eax, eax
je 0x413329
cmp dword [edi + 0x58], eax
jb 0x413329
mov ecx, edi
call fcn.00412aa0
cmp dword [edi], 6
mov esi, dword [esp + 0xc]
jne 0x413345
mov eax, dword [edi + 0x70]
mov ecx, edi
mov dword [esi], eax
call fcn.00412b00
mov edi, dword [esi]
jmp 0x41325f
mov esi, dword [esi]
add esi, 0x70
mov dword [esp + 0xc], esi
mov edi, dword [esi]
jmp 0x41325f
push dword [ebx + 8]
call esi
test eax, eax
je 0x4133ad
mov edi, dword [sym.imp.WS2_32.dll_accept]
push 0
push 0
push dword [ebx + 8]
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x4133ad
mov edx, esi
mov ecx, ebx
call fcn.00412a30
test eax, eax
je 0x4133c4
mov ecx, dword [ebx]
lea edx, [esp + 0x1c]
mov dword [eax + 0x70], ecx
mov ecx, eax
mov dword [ebx], eax
mov dword [esp + 0x1c], 0
call fcn.00412ab0
test eax, eax
jne 0x4133af
push eax
push eax
push dword [ebx + 8]
call edi
mov esi, eax
cmp esi, 0xffffffff
jne 0x413374
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4040]
xor ecx, esp
call fcn.00414bfe
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x404c]
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00414bfe
mov esp, ebp
pop ebp
ret