Function at 0x51b120
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
mov eax, dword [0x57c06c]
xor eax, ebp
mov dword [ebp - 4], eax
mov edx, dword [ebp + 8]
mov dword [ebp - 0x324], edx
mov dword [ebp - 0x32c], 0
mov dword [ebp - 0x328], 0
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x318], ebx
test edx, edx
je 0x51b172
mov ecx, dword [ebp + 0xc]
xor eax, eax
test ecx, ecx
je 0x51b172
cmp dword [edx + eax*8], 0xffffffff
jne 0x51b18a
inc eax
cmp eax, ecx
jb 0x51b167
push ebx
call fcn.0051b740
add esp, 4
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
test ebx, ebx
jle 0x51b19f
call fcn.005148a0
mov dword [ebp - 0x32c], eax
mov dword [ebp - 0x328], edx
xor eax, eax
mov ecx, ebx
test ebx, ebx
push esi
cmovle ecx, eax
xor esi, esi
push edi
xor edi, edi
mov dword [ebp - 0x320], ecx
xor edx, edx
mov dword [ebp - 0x108], esi
or ebx, 0xffffffff
mov dword [ebp - 0x20c], edi
xor ecx, ecx
mov dword [ebp - 0x310], edx
mov dword [ebp - 0x314], ebx
mov dword [ebp - 0x31c], ecx
nop dword [eax]
mov ebx, dword [ebp - 0x324]
xor eax, eax
mov word [ebx + ecx*8 + 6], ax
mov ecx, dword [ebx + ecx*8]
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x314]
cmp ecx, 0xffffffff
je 0x51b2f2
mov eax, dword [ebp - 0x31c]
mov ebx, dword [ebp - 0x324]
movzx ebx, word [ebx + eax*8 + 4]
test bl, 7
je 0x51b2e9
cmp ecx, dword [ebp - 0x314]
mov eax, ecx
cmovbe eax, dword [ebp - 0x314]
mov dword [ebp - 0x314], eax
test bl, 1
je 0x51b26b
xor eax, eax
test esi, esi
je 0x51b24e
nop dword [eax]
cmp dword [ebp + eax*4 - 0x104], ecx
je 0x51b24e
inc eax
cmp eax, esi
jb 0x51b240
cmp eax, esi
jne 0x51b26b
cmp esi, 0x40
jae 0x51b26b
mov dword [ebp + eax*4 - 0x104], ecx
mov esi, dword [ebp - 0x108]
inc esi
mov dword [ebp - 0x108], esi
test bl, 4
je 0x51b2a1
xor eax, eax
test edi, edi
je 0x51b284
cmp dword [ebp + eax*4 - 0x208], ecx
je 0x51b284
inc eax
cmp eax, edi
jb 0x51b276
cmp eax, edi
jne 0x51b2a1
cmp edi, 0x40
jae 0x51b2a1
mov dword [ebp + eax*4 - 0x208], ecx
mov edi, dword [ebp - 0x20c]
inc edi
mov dword [ebp - 0x20c], edi
test bl, 2
je 0x51b2e9
xor eax, eax
test edx, edx
je 0x51b2be
nop dword [eax]
cmp dword [ebp + eax*4 - 0x30c], ecx
je 0x51b2be
inc eax
cmp eax, edx
jb 0x51b2b0
cmp eax, edx
jne 0x51b2db
cmp edx, 0x40
jae 0x51b2db
mov dword [ebp + eax*4 - 0x30c], ecx
mov edx, dword [ebp - 0x310]
inc edx
mov dword [ebp - 0x310], edx
mov ebx, dword [ebp - 0x314]
mov dword [ebp - 0x314], ebx
jmp 0x51b2ef
mov ebx, dword [ebp - 0x314]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x31c]
inc ecx
mov dword [ebp - 0x31c], ecx
cmp ecx, eax
jb 0x51b1e0
mov eax, dword [ebp - 0x318]
lea esi, [ebp - 0x334]
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ecx, ecx
test eax, eax
cmovs esi, ecx
mov ecx, dword [ebp - 0x320]
inc ebx
test eax, eax
jle 0x51b358
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x334], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [ebp - 0x330], eax
jmp 0x51b36e
jne 0x51b36e
mov dword [ebp - 0x334], 0
mov dword [ebp - 0x330], 0
push esi
lea eax, [ebp - 0x310]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x108]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x51b3e5
call edi
test eax, eax
je 0x51b39d
cmp eax, 0x2714
jne 0x51b3e9
mov eax, dword [ebp - 0x318]
mov ecx, dword [ebp - 0x320]
test eax, eax
jle 0x51b358
push dword [ebp - 0x328]
push dword [ebp - 0x32c]
call fcn.005148a0
push edx
push eax
call fcn.00514830
mov ecx, dword [ebp - 0x318]
add esp, 0x10
sub ecx, eax
mov dword [ebp - 0x320], ecx
test ecx, ecx
jle 0x51b3e9
mov eax, dword [ebp - 0x318]
jmp 0x51b327
test eax, eax
jns 0x51b3fd
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
jne 0x51b412
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e24d7
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x324]
xor edi, edi
add esi, 6
nop dword [eax]
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x51b477
lea ecx, [ebp - 0x108]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51b442
or word [esi], 1
lea eax, [ebp - 0x20c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51b459
or word [esi], 4
lea eax, [ebp - 0x310]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51b470
or word [esi], 2
cmp word [esi], 0
je 0x51b477
inc edi
add esi, 8
sub dword [ebp + 0xc], 1
jne 0x51b420
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004e24d7
mov esp, ebp
pop ebp
ret