Function at 0x10187bf0
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push esi
mov dword [ebp - 0x14], 0
cmp dword [0x1026ce54], 0
jne 0x10187c0c
call fcn.10184350
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle]
add esp, 4
mov dword [ebp - 4], eax
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp - 4]
push edx
call fcn.10184410
add esp, 8
cmp dword [0x1026cda4], 0
je 0x10187c46
mov eax, dword [ebp - 0x14]
and eax, 0xffff
and eax, 1
je 0x10187d4b
cmp dword [ebp + 8], 0
je 0x10187cb8
cmp dword [ebp + 0x1c], 0
je 0x10187c7b
cmp dword [ebp + 0x20], 0
je 0x10187c7b
mov ecx, dword [ebp + 0x20]
push ecx
mov edx, dword [ebp + 0x1c]
push edx
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [ebp - 8], eax
jmp 0x10187c94
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x10187cb3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call sym.ruby.dll_rb_w32_map_errno
add esp, 4
mov esi, eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], esi
jmp 0x10187d3e
cmp dword [ebp + 0x1c], 0
je 0x10187ce9
cmp dword [ebp + 0x20], 0
je 0x10187ce9
mov edx, dword [ebp + 0x20]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x1c]
push ecx
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp + 0x14]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.WS2_32.dll_sendto]
mov dword [ebp - 8], eax
jmp 0x10187d02
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x10187d3e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0x2745
jne 0x10187d28
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x20
jmp 0x10187d3e
mov ecx, dword [ebp - 0x18]
push ecx
call sym.ruby.dll_rb_w32_map_errno
add esp, 4
mov esi, eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], esi
xor edx, edx
jne 0x10187c46
jmp 0x10187e66
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x24], ecx
push 0x14
push 0
lea edx, [ebp - 0x3c]
push edx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x2c], eax
cmp dword [ebp + 8], 0
je 0x10187dde
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x1c], eax
cmp dword [ebp + 0x1c], 0
je 0x10187dbb
cmp dword [ebp + 0x20], 0
je 0x10187dbb
push 0
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 0x20]
push edx
mov eax, dword [ebp + 0x1c]
push eax
lea ecx, [ebp - 0x1c]
push ecx
lea edx, [ebp - 0xc]
push edx
push 1
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.WS2_32.dll_WSARecvFrom]
mov dword [ebp - 0x10], eax
jmp 0x10187ddc
push 0
lea edx, [ebp - 0x3c]
push edx
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0xc]
push ecx
push 1
lea edx, [ebp - 0x28]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.WS2_32.dll_WSARecv]
mov dword [ebp - 0x10], eax
jmp 0x10187e38
cmp dword [ebp + 0x1c], 0
je 0x10187e17
cmp dword [ebp + 0x20], 0
je 0x10187e17
push 0
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 0x20]
mov eax, dword [edx]
push eax
mov ecx, dword [ebp + 0x1c]
push ecx
mov edx, dword [ebp + 0x18]
push edx
lea eax, [ebp - 0xc]
push eax
push 1
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.WS2_32.dll_WSASendTo]
mov dword [ebp - 0x10], eax
jmp 0x10187e38
push 0
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
lea edx, [ebp - 0xc]
push edx
push 1
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.WS2_32.dll_WSASend]
mov dword [ebp - 0x10], eax
xor edx, edx
jne 0x10187d67
mov eax, dword [ebp - 0xc]
push eax
lea ecx, [ebp - 0x20]
push ecx
mov edx, dword [ebp - 0x10]
push edx
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.10187ac0
add esp, 0x18
mov eax, dword [ebp - 0x20]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
pop esi
mov esp, ebp
pop ebp
ret