Function at 0x46eaa0
Capabilities:
Set socket configuration

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
mov rsi, qword [rsp + 0x120]
lea rdi, [rsp + 0x130]
test ecx, 0x4202
mov r14d, edx
mov rbp, r8
mov r12, r9
mov dword [rsp + 0x68], 1
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x78], 0
jne 0x46eebf
mov ebx, ecx
or bh, 0x24
test ch, 0x80
cmove ebx, ecx
test rsi, rsi
je 0x46eebf
mov eax, ebx
and eax, 0x240
cmp eax, 0x240
je 0x46eebf
mov edx, ebx
and edx, 0x204
cmp edx, 0x204
je 0x46eebf
mov edx, ebx
and edx, 0x4c
cmp edx, 0x40
je 0x46eebf
test ebx, 0x10000
je 0x46eb52
test eax, eax
jne 0x46eebf
test bl, 4
je 0x46eee0
or ebx, 0x40
mov edx, 0x1e0
mov ecx, 1
call sub.msvcrt.dll_calloc
test rax, rax
mov r15, rax
je 0x46eebf
mov rax, 0xffffffffffffffff
mov rdx, qword [rsp + 0x128]
mov dword [r15 + 0x18c], ebx
mov qword [r15 + 0x150], rax
shr ebx, 5
mov qword [r15], rsi
mov qword [r15 + 0x168], rax
mov qword [r15 + 0x160], rax
lea rsi, [0x0046a2f0]
lea rax, [0x0046a2e0]
and ebx, 1
mov qword [r15 + 8], rdx
mov dword [r15 + 0x158], 0
mov dword [r15 + 0x194], ebx
mov word [r15 + 0x190], r14w
mov qword [r15 + 0x60], rbp
mov qword [r15 + 0x68], r12
mov dword [r15 + 0x178], 0
mov dword [r15 + 0x17c], 0x7fe
mov qword [r15 + 0xd8], 0x8000
mov qword [r15 + 0xe0], 0x400
mov qword [r15 + 0xa0], rsi
mov qword [r15 + 0x180], 0
mov dword [r15 + 0x1dc], 0x7fffffff
mov qword [r15 + 0xb0], rax
call qword [sym.imp.msvcrt.dll___iob_func]
add rax, 0x60
mov qword [r15 + 0xb8], rax
mov eax, dword [r15 + 0x18c]
mov edx, eax
and edx, 0xc
cmp edx, 4
je 0x46eef0
mov ecx, eax
mov edx, eax
mov qword [r15 + 0x1d0], 0
or ch, 4
and dh, 0xfb
test al, 8
mov eax, ecx
mov qword [r15 + 0x198], 0
mov dword [r15 + 0x1d8], 4
cmove eax, edx
lea rdx, [rsp + 0x78]
mov r8, rdi
mov dword [r15 + 0x18c], eax
mov rcx, r15
call fcn.00469e50
cmp eax, 1
jne 0x46eeb7
test byte [r15 + 0x18d], 4
je 0x46ecb7
mov r9d, dword [r15 + 0xf0]
test r9d, r9d
je 0x46ef80
mov r8d, dword [r15 + 0x1d8]
test r8d, r8d
je 0x46ed01
lea rax, [r8 + r8*8]
movabs rdx, 0xd79435e50d79435f
lea rcx, [r8 + rax*2]
shl rcx, 3
mov rax, rcx
mul rdx
shr rdx, 7
cmp r8, rdx
jne 0x46f260
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [r15 + 0x1a0], rax
je 0x46f57c
lea r13, [r15 + 0x1a8]
mov edx, 0x10
mov rbp, qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov rcx, r13
call rbp
test eax, eax
je 0x46f450
mov ecx, dword [r15 + 0x18c]
test cl, 8
jne 0x46ed3d
mov r8d, dword [r15 + 0xf0]
test r8d, r8d
jne 0x46efd0
mov r12, qword [r15 + 0x150]
cmp r12, 0xffffffffffffffff
je 0x46f223
mov rcx, r12
call fcn.00471390
test eax, eax
je 0x46ef10
lea rax, [r15 + 0x100]
mov edx, 0x10
mov qword [rsp + 0x38], rax
mov rcx, rax
call rbp
test eax, eax
je 0x46ee50
lea rax, [r15 + 0x128]
mov edx, 0x10
mov qword [rsp + 0x48], rax
mov rcx, rax
call rbp
test eax, eax
je 0x46f2c0
mov ebx, dword [r15 + 0x18c]
test bl, 8
je 0x46eff0
mov ecx, dword [r15 + 0xf0]
test ecx, ecx
jne 0x46f006
and bh, 1
jne 0x46eec2
mov rdx, qword [r15 + 0xe8]
lea rcx, [r15 + 0xf8]
lea r8, [0x0046d340]
mov r9, r15
call fcn.00470630
test eax, eax
jne 0x46eff0
call qword [sym.imp.msvcrt.dll__errno]
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rdx, str.Failed_to_create_listen_thread:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
mov rcx, qword [rsp + 0x48]
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
mov rcx, qword [rsp + 0x38]
call rbx
cmp r12, 0xffffffffffffffff
je 0x46ee77
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46ee77
lea r9, str.Close_socket_failed._n
mov r8d, 0x1765
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
nop
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0046f900
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
jne 0x46f6fa
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [r15 + 0x1a0]
call sub.msvcrt.dll_free
mov rcx, r13
call rbx
mov rcx, qword [r15 + 0x160]
cmp rcx, 0xffffffffffffffff
je 0x46eeb7
mov rbx, qword [sym.imp.WS2_32.dll_closesocket]
call rbx
test eax, eax
mov rcx, qword [r15 + 0x168]
jne 0x46f200
call rbx
test eax, eax
jne 0x46f202
mov rcx, r15
call sub.msvcrt.dll_free
xor r15d, r15d
mov rax, r15
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, ebx
or eax, 0x40
test bl, 8
cmovne ebx, eax
jmp 0x46eb52
lea rdx, str.Warning:_MHD_USE_THREAD_PER_CONNECTION_must_be_used_only_with_MHD_USE_INTERNAL_POLLING_THREAD._Flag_MHD_USE_INTERNAL_POLLING_THREAD_was_added._Consider_setting_MHD_USE_INTERNAL_POLLING_THREAD_explicitly._n
mov rcx, r15
call fcn.0046f900
mov eax, dword [r15 + 0x18c]
or eax, 8
jmp 0x46ec4b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_set_nonblocking_mode_on_listening_socket:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
test byte [r15 + 0x18d], 2
jne 0x46ef48
mov eax, dword [r15 + 0xf0]
test eax, eax
je 0x46ed5e
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46ee70
lea r9, str.Close_socket_failed._n
mov r8d, 0x1708
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
nop word [rax + rax]
lea rcx, [r15 + 0x160]
mov edx, 1
call fcn.00470fb0
test eax, eax
jne 0x46ecb7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_create_inter_thread_communication_channel:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
mov rcx, r15
xor r15d, r15d
call sub.msvcrt.dll_free
jmp 0x46eec2
lea rdx, str.MHD_thread_pooling_only_works_with_MHD_USE_INTERNAL_POLLING_THREAD_n
mov rcx, r15
call fcn.0046f900
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x46ee77
mov ecx, dword [r15 + 0xf0]
test ecx, ecx
je 0x46eec2
mov ebx, dword [r15 + 0x18c]
and ebx, 0x100
jne 0x46eec2
mov eax, dword [r15 + 0x17c]
xor edx, edx
div ecx
mov dword [rsp + 0x40], eax
mov rax, rcx
mov dword [rsp + 0x44], edx
shl rax, 4
sub rax, rcx
mov rcx, rax
shl rcx, 5
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [r15 + 0xc8], rax
je 0x46f1b8
mov edi, dword [rsp + 0x40]
lea r14, [r15 + 0x1e8]
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x50], r13
mov r12, r15
add edi, 1
mov r15d, edi
jmp 0x46f0f1
mov qword [r13 + 0x168], 0xffffffffffffffff
mov qword [r13 + 0x160], 0xffffffffffffffff
cmp dword [rsp + 0x44], ebx
mov eax, dword [rsp + 0x40]
lea rsi, [r13 + 0x128]
mov edx, 0x10
mov rcx, rsi
cmova eax, r15d
mov dword [r13 + 0x17c], eax
call rbp
test eax, eax
je 0x46f4e3
mov rdx, qword [r12 + 0xe8]
lea rcx, [r13 + 0xf8]
lea r8, [0x0046d340]
mov r9, r13
call fcn.00470630
test eax, eax
je 0x46f504
add ebx, 1
cmp ebx, dword [r12 + 0xf0]
jae 0x46f53e
mov rax, qword [r12 + 0xc8]
mov edx, ebx
mov rsi, r12
mov r9, rdx
shl r9, 4
sub r9, rdx
shl r9, 5
lea r13, [rax + r9]
mov rax, qword [r12]
lea rdi, [r13 + 8]
mov rcx, r13
mov qword [r13], rax
mov rax, qword [r14 - 0x10]
and rdi, 0xfffffffffffffff8
sub rcx, rdi
sub rsi, rcx
add ecx, 0x1e0
mov qword [r13 + 0x1d8], rax
shr ecx, 3
rep movsq qword [rdi], qword [rsi]
mov qword [r13 + 0xc0], r12
mov dword [r13 + 0xf0], 0
mov qword [r13 + 0xc8], 0
test byte [r12 + 0x18d], 4
je 0x46f070
lea rcx, [r13 + 0x160]
mov edx, 1
call fcn.00470fb0
test eax, eax
jne 0x46f086
mov r15, r12
mov r13, qword [rsp + 0x50]
mov r12, qword [rsp + 0x58]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_create_worker_inter_thread_communication_channel:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
nop dword [rax]
test ebx, ebx
jne 0x46f6c5
cmp r12, 0xffffffffffffffff
je 0x46f1cf
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
jne 0x46f6d9
mov rcx, qword [rsp + 0x48]
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
mov rcx, qword [rsp + 0x38]
call rbx
mov rcx, qword [r15 + 0xc8]
test rcx, rcx
je 0x46ee77
call sub.msvcrt.dll_free
jmp 0x46ee77
call rbx
lea r9, str.Failed_to_destroy_ITC._n
mov r8d, 0x180a
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
test ch, 1
je 0x46f310
lea rax, [r15 + 0x100]
mov edx, 0x10
mov qword [rsp + 0x38], rax
mov rcx, rax
call rbp
test eax, eax
jne 0x46f280
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0046f900
jmp 0x46ee70
lea rdx, str.Specified_value_for_NC_SIZE_too_large_n
mov rcx, r15
call fcn.0046f900
mov rcx, r15
xor r15d, r15d
call sub.msvcrt.dll_free
jmp 0x46eec2
lea rax, [r15 + 0x128]
mov edx, 0x10
mov qword [rsp + 0x48], rax
mov rcx, rax
call rbp
test eax, eax
jne 0x46ed9a
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0046f900
mov rcx, qword [rsp + 0x48]
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
jmp 0x46ee77
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0046f900
mov rcx, qword [rsp + 0x48]
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46ee77
lea r9, str.Close_socket_failed._n
mov r8d, 0x173f
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
nop
and ecx, 0x10
call fcn.004713e0
cmp rax, 0xffffffffffffffff
mov r12, rax
je 0x46f546
cmp dword [r15 + 0x158], 0
je 0x46f35e
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x68]
mov r8d, 4
jle 0x46f571
mov edx, 0xffff
mov rcx, r12
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x46f676
mov eax, dword [r15 + 0x18c]
movzx r14d, r14w
test al, 0x10
je 0x46f470
cmp qword [rsp + 0x78], 0
je 0x46f603
mov qword [r15 + 0x150], r12
mov ebx, 0x1c
and eax, 0x810
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x6c]
cmp eax, 0x810
mov r8d, 0x1b
mov edx, 0x29
setne al
mov rcx, r12
movzx eax, al
mov dword [rsp + 0x6c], eax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x46f6a1
mov rdx, qword [rsp + 0x78]
mov r8d, ebx
mov rcx, r12
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x46f48f
mov edx, dword [r15 + 0x1dc]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x46ed4e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_listen_for_connections:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46ee70
lea r9, str.Close_socket_failed._n
mov r8d, 0x16f1
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
nop dword [rax]
lea rdx, str.MHD_failed_to_initialize_nonce_nc_mutex_n
mov rcx, r15
call fcn.0046f900
mov rcx, qword [r15 + 0x1a0]
call sub.msvcrt.dll_free
jmp 0x46eeb7
mov rdx, qword [rsp + 0x78]
test rdx, rdx
je 0x46f598
mov qword [r15 + 0x150], r12
mov ebx, 0x10
jmp 0x46f3cb
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_bind_to_port__u:__s_n
mov r9, rax
mov r8d, r14d
mov rcx, r15
call fcn.0046f900
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46ee70
lea r9, str.Close_socket_failed._n
mov r8d, 0x16d3
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
mov r15, r12
lea rdx, str.MHD_failed_to_initialize_cleanup_connection_mutex_n
mov r13, qword [rsp + 0x50]
mov rcx, r15
mov r12, qword [rsp + 0x58]
call fcn.0046f900
jmp 0x46f1b0
mov r15, r12
mov r13, qword [rsp + 0x50]
mov r12, qword [rsp + 0x58]
call qword [sym.imp.msvcrt.dll__errno]
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rdx, str.Failed_to_create_pool_thread:__s_n
mov rcx, r15
mov r8, rax
call fcn.0046f900
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x46f1b0
mov r15, r12
jmp 0x46eec2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.Failed_to_create_socket_for_listening:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x46ee77
mov r8d, 0xfffffffb
jmp 0x46f348
call qword [sym.imp.msvcrt.dll__errno]
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rdx, str.Failed_to_allocate_memory_for_nonce_nc_map:__s_n
mov r8, rax
jmp 0x46efb0
mov edx, 2
mov qword [rsp + 0x80], 0
mov ecx, r14d
mov word [rsp + 0x80], dx
mov qword [rsp + 0x88], 0
lea rbx, [rsp + 0x80]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x82], ax
mov eax, dword [r15 + 0x18c]
mov rdx, rbx
mov qword [rsp + 0x78], rbx
mov ebx, 0x10
mov ecx, eax
and ecx, 0x10
test ecx, ecx
mov qword [r15 + 0x150], r12
je 0x46f3cb
jmp 0x46f389
mov ecx, 0x17
mov qword [rsp + 0x90], 0
mov qword [rsp + 0x98], 0
mov word [rsp + 0x90], cx
mov qword [rsp + 0xa0], 0
mov ecx, r14d
mov dword [rsp + 0xa8], 0
lea rbx, [rsp + 0x90]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x92], ax
mov eax, dword [r15 + 0x18c]
mov rdx, rbx
mov qword [rsp + 0x78], rbx
mov ebx, 0x1c
mov ecx, eax
and ecx, 0x10
jmp 0x46f5ef
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.setsockopt_failed:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x46ee77
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.00470690
lea rdx, str.setsockopt_failed:__s_n
mov r8, rax
mov rcx, r15
call fcn.0046f900
jmp 0x46f3c6
mov dword [r15 + 0xf0], ebx
mov rcx, r15
call sym.xmrig.exe_MHD_stop_daemon
jmp 0x46eebf
lea r9, str.Close_socket_failed._n
mov r8d, 0x17db
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
lea r9, str.Close_socket_failed._n
mov r8d, 0x1734
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.55_src_microhttpd_daemon.c
mov rcx, qword [0x004cd150]
call qword [0x004cd158]
nop
nop dword [rax]