Function at 0x516450
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24c
mov dword [ebp - 0x24c], ecx
mov eax, dword [ebp + 0x24]
mov byte [eax], 0
mov ecx, dword [ebp + 0x2c]
mov byte [ecx], 0
mov edx, dword [ebp + 0x28]
mov byte [edx], 0
mov eax, dword [ebp + 0x20]
mov byte [eax], 0
cmp dword [ebp + 8], 0
je 0x51648a
cmp dword [ebp + 8], 0x32
jae 0x51648a
mov dword [ebp + 8], 0x32
cmp dword [ebp + 0x10], 0
jne 0x516497
mov dword [ebp + 0x10], 0x1499700
cmp dword [ebp + 0x1c], 0
je 0x5164a3
cmp dword [ebp + 8], 0
jne 0x5164cc
mov ecx, dword [ebp + 0x2c]
push ecx
mov edx, dword [ebp + 0x28]
push edx
mov eax, dword [ebp + 0x20]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
movzx edx, byte [ebp + 0x14]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0x24c]
call fcn.00516120
jmp 0x5168c0
mov ecx, dword [ebp - 0x24c]
cmp dword [ecx + 0xa4], 0xffffffff
jne 0x5164fa
push str.invalid_socket__not_ready_for_writing.
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
mov eax, dword [ebp + 0x2c]
mov byte [eax], 1
xor al, al
jmp 0x5168c0
mov dword [ebp - 4], 0
cmp dword [ebp + 0xc], 0
je 0x516580
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 0
je 0x516580
mov edx, dword [ebp + 8]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 8]
jbe 0x516527
mov ecx, dword [ebp - 8]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
push edx
call fcn.00482b30
add esp, 4
cmp dword [ebp + 0x1c], 0
je 0x516575
push 0x71
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp + 0x1c]
call fcn.0049d4d0
mov ecx, dword [ebp + 0x1c]
call fcn.0049d1c0
movzx ecx, al
test ecx, ecx
je 0x516575
mov edx, dword [ebp + 0x24]
mov byte [edx], 1
push str.socket_operation_aborted_by_application_callback..
mov eax, dword [ebp + 0x18]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
xor al, al
jmp 0x5168c0
mov ecx, dword [ebp - 8]
sub ecx, dword [ebp - 0xc]
mov dword [ebp - 8], ecx
jmp 0x51650d
cmp dword [ebp + 0x10], 0
je 0x516592
mov edx, dword [ebp - 4]
cmp edx, dword [ebp + 0x10]
jae 0x51688a
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], eax
cmp dword [ebp + 0x10], 0
je 0x5165c3
mov ecx, dword [ebp + 0x10]
cmp ecx, dword [ebp - 4]
jbe 0x5165c3
mov edx, dword [ebp + 0x10]
sub edx, dword [ebp - 4]
mov dword [ebp - 0x20], edx
cmp dword [ebp + 8], 0
je 0x5165c3
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp + 8]
jbe 0x5165c3
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x20]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x1c]
imul edx, edx, 0x3e8
mov eax, dword [ebp - 0x20]
sub eax, edx
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x18]
imul ecx, ecx, 0x3e8
mov dword [ebp - 0x234], ecx
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x23c], edx
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x230], 0
mov dword [ebp - 0x244], 0
jmp 0x51662c
mov ecx, dword [ebp - 0x244]
add ecx, 1
mov dword [ebp - 0x244], ecx
mov edx, dword [ebp - 0x244]
cmp edx, dword [ebp - 0x230]
jae 0x516659
mov eax, dword [ebp - 0x244]
mov ecx, dword [ebp - 0x24c]
mov edx, dword [ebp + eax*4 - 0x22c]
cmp edx, dword [ecx + 0xa4]
jne 0x516657
jmp 0x516659
jmp 0x51661d
mov eax, dword [ebp - 0x244]
cmp eax, dword [ebp - 0x230]
jne 0x516698
cmp dword [ebp - 0x230], 0x40
jae 0x516698
mov ecx, dword [ebp - 0x244]
mov edx, dword [ebp - 0x24c]
mov eax, dword [edx + 0xa4]
mov dword [ebp + ecx*4 - 0x22c], eax
mov ecx, dword [ebp - 0x230]
add ecx, 1
mov dword [ebp - 0x230], ecx
xor edx, edx
jne 0x516611
mov dword [ebp - 0x240], 0
movzx eax, byte [ebp + 0x14]
test eax, eax
je 0x51675b
mov dword [ebp - 0x128], 0
mov dword [ebp - 0x248], 0
jmp 0x5166db
mov ecx, dword [ebp - 0x248]
add ecx, 1
mov dword [ebp - 0x248], ecx
mov edx, dword [ebp - 0x248]
cmp edx, dword [ebp - 0x128]
jae 0x516708
mov eax, dword [ebp - 0x248]
mov ecx, dword [ebp - 0x24c]
mov edx, dword [ebp + eax*4 - 0x124]
cmp edx, dword [ecx + 0xa4]
jne 0x516706
jmp 0x516708
jmp 0x5166cc
mov eax, dword [ebp - 0x248]
cmp eax, dword [ebp - 0x128]
jne 0x516747
cmp dword [ebp - 0x128], 0x40
jae 0x516747
mov ecx, dword [ebp - 0x248]
mov edx, dword [ebp - 0x24c]
mov eax, dword [edx + 0xa4]
mov dword [ebp + ecx*4 - 0x124], eax
mov ecx, dword [ebp - 0x128]
add ecx, 1
mov dword [ebp - 0x128], ecx
xor edx, edx
jne 0x5166c0
lea eax, [ebp - 0x128]
mov dword [ebp - 0x240], eax
mov dword [ebp - 0x14], 0
lea ecx, [ebp - 0x23c]
push ecx
mov edx, dword [ebp - 0x240]
push edx
lea eax, [ebp - 0x230]
push eax
push 0
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.WSOCK32.dll_select]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
je 0x516792
cmp dword [ebp - 0x10], 0
jge 0x5167b3
push str.select_returned_a_socket_error
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
mov eax, dword [ebp + 0x2c]
mov byte [eax], 1
xor al, al
jmp 0x5168c0
cmp dword [ebp - 0x10], 0
jle 0x51682d
lea ecx, [ebp - 0x230]
push ecx
mov edx, dword [ebp - 0x24c]
mov eax, dword [edx + 0xa4]
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x5167df
mov al, 1
jmp 0x5168c0
cmp dword [ebp - 0x240], 0
je 0x516814
mov ecx, dword [ebp - 0x240]
push ecx
mov edx, dword [ebp - 0x24c]
mov eax, dword [edx + 0xa4]
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x516814
mov ecx, dword [ebp + 0x20]
mov byte [ecx], 1
xor al, al
jmp 0x5168c0
push str.Socket_select_after_connect_returned_0.
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x18]
call edx
xor al, al
jmp 0x5168c0
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x20]
mov dword [ebp - 4], eax
cmp dword [ebp + 0x10], 0
je 0x516846
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp + 0x10]
jb 0x516846
jmp 0x51688a
cmp dword [ebp + 0x1c], 0
je 0x516885
push 0x72
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp + 0x1c]
call fcn.0049d4d0
mov ecx, dword [ebp + 0x1c]
call fcn.0049d1c0
movzx eax, al
test eax, eax
je 0x516885
mov ecx, dword [ebp + 0x24]
mov byte [ecx], 1
push 0x668a58
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
xor al, al
jmp 0x5168c0
jmp 0x516580
movzx eax, byte [ebp + 0x14]
test eax, eax
je 0x5168a6
push str.timeout_waiting_for_connect_to_complete_
mov ecx, dword [ebp + 0x18]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
jmp 0x5168b8
push str.socket_is_not_ready_for_writing_
mov ecx, dword [ebp + 0x18]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [ebp + 0x28]
mov byte [ecx], 1
xor al, al
mov esp, ebp
pop ebp
ret 0x28