Function at 0x478730
Capabilities:
Receive data
Receive data on socket

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov esi, dword [rcx + 0x194]
mov rbx, rcx
mov r15d, edx
mov ecx, esi
and ecx, 0x2000
and esi, 4
je 0x4787f1
mov rsi, qword [rbx + 0x158]
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x58], 0
cmp rsi, 0xffffffffffffffff
je 0x478a40
movzx eax, byte [rbx + 0x179]
test al, al
jne 0x478b00
mov r9, qword [rbx + 0x168]
mov qword [rsp + 0x40], rsi
mov r8d, 0x300
xor esi, esi
mov word [rsp + 0x48], r8w
mov ebp, 2
mov edi, 1
mov eax, 1
cmp r9, 0xffffffffffffffff
jne 0x478a5a
test ecx, ecx
movsxd rdi, r9d
jne 0x478b5c
test eax, eax
jne 0x478cea
mov eax, 1
jmp 0x4789ed
test ecx, ecx
jne 0x478b70
mov rax, qword [rbx + 0x10]
test rax, rax
je 0x478be0
xor edx, edx
jmp 0x478812
mov edx, edi
mov rax, qword [rax]
lea edi, [rdx + 1]
test rax, rax
jne 0x478810
lea ecx, [rdx + 3]
mov edx, 0x10
call sub.msvcrt.dll_calloc
test rax, rax
mov rbp, rax
je 0x478bb2
mov r12, qword [rbx + 0x158]
cmp r12, 0xffffffffffffffff
je 0x478b84
movzx eax, byte [rbx + 0x179]
test al, al
je 0x478b13
xor r13d, r13d
mov ecx, 1
xor r11d, r11d
xor r14d, r14d
mov r12d, 0xffffffff
mov rax, qword [rbx + 0x168]
cmp rax, 0xffffffffffffffff
je 0x478ba3
lea rdx, [rbp + r14]
mov r13d, ecx
mov qword [rdx], rax
mov dword [rdx + 8], 0x300
test r15d, r15d
jne 0x478a20
mov rdx, qword [rbx + 0x18]
test rdx, rdx
je 0x478910
mov ecx, r13d
xor r9d, r9d
jmp 0x4788d4
jb 0x478a10
cmp r10d, 2
je 0x478a00
cmp r10d, 3
cmove r15d, r9d
mov rdx, qword [rdx + 8]
add ecx, 1
test rdx, rdx
je 0x478910
mov r10, qword [rdx + 0x118]
mov eax, ecx
shl rax, 4
add rax, rbp
mov qword [rax], r10
mov r10d, dword [rdx + 0x12c]
cmp r10d, 1
jne 0x4788b0
or word [rax + 8], 0x210
add ecx, 1
mov rdx, qword [rdx + 8]
test rdx, rdx
jne 0x4788d4
nop word cs:[rax + rax]
mov edx, r13d
add edx, edi
je 0x4789e0
mov r8d, r15d
mov rcx, rbp
mov dword [rsp + 0x2c], r11d
call sub.WS2_32.dll_WSAPoll
test eax, eax
mov r11d, dword [rsp + 0x2c]
js 0x478cb1
cmp r11d, 0xffffffff
mov byte [rbx + 0x17c], 0
je 0x478953
test word [rbp + r14 + 0xa], 0x300
jne 0x478c30
movzx eax, byte [rbx + 0x178]
test al, al
jne 0x478c70
mov rcx, qword [rbx + 0x18]
test rcx, rcx
je 0x4789cb
test edi, edi
mov r14, qword [rcx + 8]
jne 0x478983
jmp 0x4789cb
cmp esi, edi
mov rax, qword [r14 + 8]
mov rcx, r14
jae 0x4789cb
mov r14, rax
lea eax, [r13 + rsi]
mov rdx, qword [rcx + 0x118]
shl rax, 4
add rax, rbp
cmp qword [rax], rdx
jne 0x4789c6
movzx eax, word [rax + 0xa]
xor r9d, r9d
mov r8d, eax
test ax, 0x607
setne r9b
shr r8w, 4
xor edx, edx
test ah, 3
setne dl
and r8d, 1
add esi, 1
call fcn.00474d60
test r14, r14
jne 0x478975
cmp r12d, 0xffffffff
je 0x4789e0
test word [rbp + 0xa], 0x300
jne 0x478c5f
nop dword [rax]
mov rcx, rbp
call sub.msvcrt.dll_free
mov eax, 1
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
or word [rax + 8], 0x200
jmp 0x4788c8
or word [rax + 8], 0x300
jmp 0x4788c8
test byte [rbx + 0x194], 4
je 0x478bf0
mov r15d, 0xffffffff
jmp 0x478896
mov ebp, 1
xor edi, edi
xor eax, eax
mov r9, qword [rbx + 0x168]
cmp r9, 0xffffffffffffffff
je 0x4787d4
shl rax, 4
mov edx, 0x300
test ecx, ecx
mov qword [rsp + rax + 0x40], r9
mov word [rsp + rax + 0x48], dx
jne 0x478b60
lea rcx, [rsp + 0x40]
mov r8d, r15d
mov edx, ebp
neg r8d
call sub.WS2_32.dll_WSAPoll
test eax, eax
js 0x478c80
cmp edi, 0xffffffff
je 0x478aca
shl rdi, 4
test word [rsp + rdi + 0x4a], 0x300
je 0x478aca
mov r14, qword [sym.imp.WS2_32.dll_recv]
lea r15, [rsp + 0x3c]
nop dword [rax]
xor r9d, r9d
mov rcx, qword [rbx + 0x168]
mov r8d, 4
mov rdx, r15
call r14
test eax, eax
jg 0x478ab0
movzx edx, byte [rbx + 0x178]
xor eax, eax
test dl, dl
jne 0x4789ed
cmp esi, 0xffffffff
je 0x4787e7
test word [rsp + 0x4a], 0x300
je 0x4787e7
mov rcx, rbx
call fcn.00475890
jmp 0x4787e7
mov ebp, 1
xor edi, edi
mov esi, 0xffffffff
xor eax, eax
jmp 0x478a49
mov eax, dword [rbx + 0x184]
cmp dword [rbx + 0x180], eax
jae 0x478856
cmp byte [rbx + 0x17a], 0
jne 0x478856
mov qword [rbp], r12
mov dword [rbp + 8], 0x300
mov ecx, 2
mov r11d, 1
mov r14d, 0x10
xor r12d, r12d
mov r13d, 1
jmp 0x47886a
mov ebp, eax
nop
mov rcx, rbx
call fcn.00474af0
mov eax, ebp
jmp 0x4787df
mov rcx, rbx
call fcn.00474af0
cmp eax, 1
cmove r15d, esi
jmp 0x4787f9
mov rax, qword [rbx + 0x168]
xor r13d, r13d
xor r11d, r11d
xor r14d, r14d
mov ecx, 1
cmp rax, 0xffffffffffffffff
jne 0x47887b
mov r14, 0xfffffffffffffff0
mov r11d, eax
jmp 0x47888d
call qword [sym.imp.msvcrt.dll__errno]
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rdx, str.Error_allocating_memory:__s_n
mov r8, rax
mov rcx, rbx
call fcn.0047b4a0
xor eax, eax
jmp 0x4789ed
xor edi, edi
mov ecx, 2
jmp 0x478820
lea rdx, [rsp + 0x40]
mov rcx, rbx
mov dword [rsp + 0x2c], r11d
call sym.xmrig.exe_MHD_get_timeout
cmp eax, 1
mov r11d, dword [rsp + 0x2c]
jne 0x478a2d
mov r8, qword [rsp + 0x40]
mov eax, 0x7fffffff
cmp r8, 0x7fffffff
cmovbe eax, r8d
mov r15d, eax
jmp 0x478896
mov r14, qword [sym.imp.WS2_32.dll_recv]
lea r15, [rsp + 0x3c]
nop dword [rax]
xor r9d, r9d
mov rcx, qword [rbx + 0x168]
mov r8d, 4
mov rdx, r15
call r14
test eax, eax
jg 0x478c40
jmp 0x478953
mov rcx, rbx
call fcn.00475890
jmp 0x4789e0
mov rcx, rbp
call sub.msvcrt.dll_free
xor eax, eax
jmp 0x4789ed
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x4787e7
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.poll_failed:__s_n
mov r8, rax
mov rcx, rbx
call fcn.0047b4a0
xor eax, eax
jmp 0x4789ed
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x4789e0
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.poll_failed:__s_n
mov r8, rax
mov rcx, rbx
call fcn.0047b4a0
mov rcx, rbp
call sub.msvcrt.dll_free
xor eax, eax
jmp 0x4789ed
mov ebp, eax
jmp 0x478a75