Function at 0x51d790
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0x38], ecx
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp + 0xc]
call fcn.00540570
mov ecx, dword [ebp - 0x38]
cmp dword [ecx + 0xa4], 0xffffffff
jne 0x51d7d3
push str.Invalid_socket.
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x14]
call edx
mov eax, dword [ebp + 0xc]
mov byte [eax + 0xe], 1
xor al, al
jmp 0x51da2c
mov dword [ebp - 8], 0
mov ecx, dword [ebp + 0xc]
cmp dword [ecx + 4], 0
je 0x51d7f2
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 4]
mov ecx, dword [eax + 0x88]
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 0
je 0x51d805
cmp dword [ebp - 8], 0x32
jae 0x51d805
mov dword [ebp - 8], 0x32
cmp dword [ebp - 0xc], 0
jne 0x51d812
mov dword [ebp - 0xc], 0x1499700
mov dword [ebp - 0x10], 0
mov byte [ebp - 1], 1
cmp dword [ebp - 0xc], 0
je 0x51d82f
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0xc]
jae 0x51da23
mov eax, dword [ebp - 8]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x51d841
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x24], ecx
cmp dword [ebp - 0xc], 0
je 0x51d86c
mov edx, dword [ebp - 0xc]
cmp edx, dword [ebp - 0x10]
jbe 0x51d86c
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 8], 0
je 0x51d86c
mov ecx, dword [ebp - 0x24]
cmp ecx, dword [ebp - 8]
jbe 0x51d86c
mov edx, dword [ebp - 8]
mov dword [ebp - 0x24], edx
movzx eax, byte [ebp - 1]
test eax, eax
je 0x51d889
mov ecx, dword [ebp - 0x24]
shr ecx, 1
mov dword [ebp - 0x24], ecx
cmp dword [ebp - 0x24], 1
jae 0x51d889
mov dword [ebp - 0x24], 1
mov eax, dword [ebp - 0x24]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x20]
imul edx, edx, 0x3e8
mov eax, dword [ebp - 0x24]
sub eax, edx
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
imul ecx, ecx, 0x3e8
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x38]
add ecx, 0x250
call fcn.00517ab0
mov dword [ebp - 0x34], 0
jmp 0x51d8e1
mov ecx, dword [ebp - 0x34]
add ecx, 1
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x34]
cmp eax, dword [edx + 0x258]
jae 0x51d90b
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x38]
mov ecx, dword [edx + ecx*4 + 0x25c]
cmp ecx, dword [eax + 0xa4]
jne 0x51d909
jmp 0x51d90b
jmp 0x51d8d8
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x34]
cmp eax, dword [edx + 0x258]
jne 0x51d953
mov ecx, dword [ebp - 0x38]
cmp dword [ecx + 0x258], 0x200
jae 0x51d953
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x38]
mov ecx, dword [ecx + 0xa4]
mov dword [eax + edx*4 + 0x25c], ecx
mov edx, dword [ebp - 0x38]
mov eax, dword [edx + 0x258]
add eax, 1
mov ecx, dword [ebp - 0x38]
mov dword [ecx + 0x258], eax
xor edx, edx
jne 0x51d8cf
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
lea eax, [ebp - 0x30]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x38]
add ecx, 0x258
push ecx
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
je 0x51d994
cmp dword [ebp - 0x14], 0
jge 0x51d9cb
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00518ec0
add esp, 8
mov edx, dword [ebp + 0xc]
mov byte [edx + 0xe], 1
push str.Error_waiting_for_socket_to_become_ready_for_reading.
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [ebp - 0x38]
call fcn.0051d5b0
xor al, al
jmp 0x51da2c
cmp dword [ebp - 0x14], 0
je 0x51d9d5
mov al, 1
jmp 0x51da2c
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0x24]
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0xc], 0
je 0x51d9ee
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0xc]
jb 0x51d9ee
jmp 0x51da23
mov ecx, dword [ebp + 0xc]
call fcn.005405c0
movzx eax, al
test eax, eax
je 0x51da1a
mov ecx, dword [ebp + 0xc]
mov byte [ecx + 0xd], 1
push str.socket_operation_aborted_by_application
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x14]
call edx
xor al, al
jmp 0x51da2c
mov byte [ebp - 1], 0
jmp 0x51d81d
mov eax, dword [ebp + 0xc]
mov byte [eax + 0xc], 1
xor al, al
mov esp, ebp
pop ebp
ret 0xc