Function at 0x402340
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x37c
mov ebx, dword [esp + 0x390]
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
test ebx, ebx
je 0x40238b
mov esi, dword [esp + 0x394]
test esi, esi
je 0x40238b
cmp dword [ebx], 0xffffffff
jne 0x4023ac
xor eax, eax
mov edx, dword [esp + 0x394]
jmp 0x402386
cmp dword [ebx + eax*8], 0xffffffff
jne 0x4023ac
inc eax
cmp eax, edx
jne 0x402380
mov ecx, dword [esp + 0x398]
mov dword [esp], ecx
call fcn.00401e08
mov ebx, eax
mov eax, ebx
add esp, 0x37c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x398]
test eax, eax
jle 0x402798
call fcn.0040fd14
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], edx
mov ecx, dword [esp + 0x398]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x64], 0
mov dword [esp + 0x168], 0
mov dword [esp + 0x26c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x3c], 0
mov ebp, ebx
mov ebx, dword [esp + 0x394]
lea ebx, [ebp + ebx*8]
mov dword [esp + 0x30], ebx
mov ecx, ebp
mov dword [esp + 0x44], 0
xor ebx, ebx
xor esi, esi
xor eax, eax
mov dword [esp + 0x48], ebp
mov ebp, eax
mov word [ecx + 6], 0
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x402508
mov di, word [ecx + 4]
test edi, 7
je 0x402508
test edi, 1
je 0x402484
test ebx, ebx
je 0x4027a5
cmp eax, dword [esp + 0x68]
je 0x402484
xor edx, edx
jmp 0x40246e
cmp eax, dword [esp + edx*4 + 0x68]
je 0x4026ac
inc edx
cmp edx, ebx
jne 0x402464
cmp ebx, 0x3f
ja 0x402484
mov dword [esp + edx*4 + 0x68], eax
inc ebx
mov dword [esp + 0x40], ebx
lea esi, [esi]
test edi, 4
je 0x4024c8
test esi, esi
je 0x4027b3
cmp eax, dword [esp + 0x16c]
je 0x4024c8
xor edx, edx
jmp 0x4024b1
cmp eax, dword [esp + edx*4 + 0x16c]
je 0x4026bc
inc edx
cmp edx, esi
jne 0x4024a4
cmp esi, 0x3f
ja 0x4024c8
mov dword [esp + edx*4 + 0x16c], eax
inc esi
mov dword [esp + 0x3c], esi
nop
and edi, 2
je 0x402508
test ebp, ebp
je 0x4027ac
cmp eax, dword [esp + 0x270]
je 0x402508
xor edx, edx
jmp 0x4024f1
cmp eax, dword [esp + edx*4 + 0x270]
je 0x4026cc
inc edx
cmp edx, ebp
jne 0x4024e4
cmp ebp, 0x3f
ja 0x402508
mov dword [esp + edx*4 + 0x270], eax
inc ebp
mov dword [esp + 0x44], ebp
nop
add ecx, 8
cmp ecx, dword [esp + 0x30]
jne 0x402428
mov eax, ebp
mov ebp, dword [esp + 0x48]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x64], edx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x168], ecx
mov edx, dword [esp + 0x44]
mov dword [esp + 0x26c], edx
test ebx, ebx
jne 0x402545
test esi, esi
je 0x402788
mov ecx, dword [esp + 0x398]
test ecx, ecx
js 0x402780
lea edi, [esp + 0x5c]
mov ecx, esi
mov dword [esp + 0x30], edi
mov edi, eax
mov dword [esp + 0x3c], ebp
mov ebp, dword [esp + 0x4c]
mov esi, dword [esp + 0x398]
jmp 0x402629
lea edx, [esp + 0x26c]
test ecx, ecx
je 0x402685
lea eax, [esp + 0x168]
test ebx, ebx
je 0x40268f
lea ecx, [esp + 0x64]
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], 0
call sub.WS2_32.dll_select
sub esp, 0x14
mov ebx, eax
cmp eax, 0xffffffff
jne 0x4026dc
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x4025e6
mov edx, dword [0x65c010]
test edx, edx
jne 0x40239c
cmp eax, 0x2714
jne 0x40239c
test esi, esi
jle 0x402617
call fcn.0040fd14
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], ecx
mov ebx, dword [esp + 0x38]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040fd4c
mov ebp, esi
sub ebp, eax
test ebp, ebp
jle 0x4027ba
mov edi, dword [esp + 0x26c]
mov ecx, dword [esp + 0x168]
mov ebx, dword [esp + 0x64]
cmp esi, 0
jle 0x402698
mov eax, 0x10624dd3
imul ebp
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
sar edx, 6
mov dword [esp + 0x40], edx
mov eax, ebp
cdq
sub dword [esp + 0x40], edx
mov edx, dword [esp + 0x40]
mov dword [esp + 0x5c], edx
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov edx, ebp
sub edx, eax
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov dword [esp + 0x60], eax
test edi, edi
jne 0x402574
xor edx, edx
test ecx, ecx
jne 0x402583
xor eax, eax
test ebx, ebx
jne 0x402592
xor ecx, ecx
jmp 0x402596
jne 0x402673
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
jmp 0x402673
cmp ebx, edx
jne 0x402484
jmp 0x402473
cmp esi, edx
jne 0x4024c8
jmp 0x4024b6
cmp ebp, edx
jne 0x402508
jmp 0x4024f6
mov ebp, dword [esp + 0x3c]
cmp eax, 0
jl 0x4027c1
je 0x40239c
xor ebx, ebx
xor esi, esi
lea edi, [esp + 0x168]
jmp 0x402714
cmp word [ebp + 6], 0
jne 0x40277b
inc esi
add ebp, 8
cmp esi, dword [esp + 0x394]
je 0x40239c
mov word [ebp + 6], 0
mov eax, dword [ebp]
cmp eax, 0xffffffff
je 0x402703
lea edx, [esp + 0x64]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x40273e
or word [ebp + 6], 1
mov dword [esp + 4], edi
mov eax, dword [ebp]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x402759
or word [ebp + 6], 4
lea eax, [esp + 0x26c]
mov dword [esp + 4], eax
mov eax, dword [ebp]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4026fc
or word [ebp + 6], 2
inc ebx
jmp 0x402703
xor edi, edi
jmp 0x402558
test eax, eax
jne 0x402545
jmp 0x40238b
mov dword [esp + 0x4c], 0
jmp 0x4023d3
xor edx, edx
jmp 0x402478
xor edx, edx
jmp 0x4024fb
xor edx, edx
jmp 0x4024bb
xor ebx, ebx
jmp 0x40239c
mov ebx, 0xffffffff
jmp 0x40239c