Function at 0x46de30
Capabilities:
Set socket configuration

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
mov rsi, qword [rsp + 0x110]
test ecx, 0x4202
mov r14d, edx
mov rdi, r8
mov rbp, r9
mov dword [rsp + 0x60], 1
mov qword [rsp + 0x68], 0
jne 0x46e24f
mov ebx, ecx
or bh, 0x24
test ch, 0x80
cmove ebx, ecx
test rsi, rsi
je 0x46e24f
mov eax, ebx
and eax, 0x240
cmp eax, 0x240
je 0x46e24f
mov edx, ebx
and edx, 0x204
cmp edx, 0x204
je 0x46e24f
mov edx, ebx
and edx, 0x4c
cmp edx, 0x40
je 0x46e24f
test ebx, 0x10000
je 0x46ded5
test eax, eax
jne 0x46e24f
test bl, 4
je 0x46e270
or ebx, 0x40
mov edx, 0x1e0
mov ecx, 1
call sub.msvcrt.dll_calloc
test rax, rax
mov r15, rax
je 0x46e24f
mov rax, 0xffffffffffffffff
mov rdx, qword [rsp + 0x118]
mov dword [r15 + 0x18c], ebx
mov qword [r15 + 0x150], rax
shr ebx, 5
mov qword [r15 + 0x60], rdi
mov qword [r15 + 0x168], rax
mov qword [r15 + 0x160], rax
lea rdi, [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 + 0x68], rbp
mov qword [r15], rsi
mov dword [r15 + 0x178], 0
mov dword [r15 + 0x17c], 0x7fe
mov qword [r15 + 0xd8], 0x8000
mov qword [r15 + 0xe0], 0x400
mov qword [r15 + 0xa0], rdi
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 0x46e280
mov ecx, eax
mov edx, eax
mov r8, qword [rsp + 0x120]
or ch, 4
and dh, 0xfb
test al, 8
mov eax, ecx
mov qword [r15 + 0x1d0], 0
mov qword [r15 + 0x198], 0
cmove eax, edx
lea rdx, [rsp + 0x68]
mov dword [r15 + 0x1d8], 4
mov dword [r15 + 0x18c], eax
mov rcx, r15
call fcn.00469e50
cmp eax, 1
jne 0x46e247
test byte [r15 + 0x18d], 4
je 0x46e03f
mov r9d, dword [r15 + 0xf0]
test r9d, r9d
je 0x46e310
mov r8d, dword [r15 + 0x1d8]
test r8d, r8d
je 0x46e089
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 0x46e5f0
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [r15 + 0x1a0], rax
je 0x46e909
lea r13, [r15 + 0x1a8]
mov edx, 0x10
mov rbp, qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov rcx, r13
call rbp
test eax, eax
je 0x46e7d5
mov ecx, dword [r15 + 0x18c]
test cl, 8
jne 0x46e0c5
mov r8d, dword [r15 + 0xf0]
test r8d, r8d
jne 0x46e360
mov r12, qword [r15 + 0x150]
cmp r12, 0xffffffffffffffff
je 0x46e5b3
mov rcx, r12
call fcn.00471390
test eax, eax
je 0x46e2a0
lea rax, [r15 + 0x100]
mov edx, 0x10
mov qword [rsp + 0x38], rax
mov rcx, rax
call rbp
test eax, eax
je 0x46e1e0
lea rax, [r15 + 0x128]
mov edx, 0x10
mov qword [rsp + 0x48], rax
mov rcx, rax
call rbp
test eax, eax
je 0x46e650
mov ebx, dword [r15 + 0x18c]
test bl, 8
je 0x46e380
mov ecx, dword [r15 + 0xf0]
test ecx, ecx
jne 0x46e396
and bh, 1
jne 0x46e252
mov rdx, qword [r15 + 0xe8]
lea rcx, [r15 + 0xf8]
lea r8, [0x0046d340]
mov r9, r15
call fcn.00470630
test eax, eax
jne 0x46e380
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 0x46e207
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46e207
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 word [rax + rax]
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 0x46ea7a
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 0x46e247
mov rbx, qword [sym.imp.WS2_32.dll_closesocket]
call rbx
test eax, eax
mov rcx, qword [r15 + 0x168]
jne 0x46e590
call rbx
test eax, eax
jne 0x46e592
mov rcx, r15
call sub.msvcrt.dll_free
xor r15d, r15d
mov rax, r15
add rsp, 0xa8
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 0x46ded5
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 0x46dfce
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 0x46e2d8
mov eax, dword [r15 + 0xf0]
test eax, eax
je 0x46e0e6
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46e200
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 0x46e03f
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 0x46e252
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 0x46e207
mov ecx, dword [r15 + 0xf0]
test ecx, ecx
je 0x46e252
mov ebx, dword [r15 + 0x18c]
and ebx, 0x100
jne 0x46e252
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 0x46e548
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 0x46e481
mov qword [r13 + 0x168], 0xffffffffffffffff
mov qword [r13 + 0x160], 0xffffffffffffffff
cmp ebx, dword [rsp + 0x44]
mov eax, dword [rsp + 0x40]
lea rsi, [r13 + 0x128]
mov edx, 0x10
mov rcx, rsi
cmovb eax, r15d
mov dword [r13 + 0x17c], eax
call rbp
test eax, eax
je 0x46e870
mov rdx, qword [r12 + 0xe8]
lea rcx, [r13 + 0xf8]
lea r8, [0x0046d340]
mov r9, r13
call fcn.00470630
test eax, eax
je 0x46e891
add ebx, 1
cmp dword [r12 + 0xf0], ebx
jbe 0x46e8cb
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 0x46e400
lea rcx, [r13 + 0x160]
mov edx, 1
call fcn.00470fb0
test eax, eax
jne 0x46e416
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 0x46ea45
cmp r12, 0xffffffffffffffff
je 0x46e55f
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
jne 0x46ea59
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 0x46e207
call sub.msvcrt.dll_free
jmp 0x46e207
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 0x46e6a0
lea rax, [r15 + 0x100]
mov edx, 0x10
mov qword [rsp + 0x38], rax
mov rcx, rax
call rbp
test eax, eax
jne 0x46e610
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0046f900
jmp 0x46e200
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 0x46e252
lea rax, [r15 + 0x128]
mov edx, 0x10
mov qword [rsp + 0x48], rax
mov rcx, rax
call rbp
test eax, eax
jne 0x46e122
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 0x46e207
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 0x46e207
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 0x46e8d3
cmp dword [r15 + 0x158], 0
je 0x46e6ee
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x60]
mov r8d, 4
jle 0x46e8fe
mov edx, 0xffff
mov rcx, r12
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x46e9f6
mov eax, dword [r15 + 0x18c]
test al, 0x10
je 0x46e7f5
cmp qword [rsp + 0x68], 0
je 0x46e982
mov qword [r15 + 0x150], r12
mov ebx, 0x1c
and eax, 0x810
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x64]
cmp eax, 0x810
mov r8d, 0x1b
mov edx, 0x29
setne al
mov rcx, r12
movzx eax, al
mov dword [rsp + 0x64], eax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x46ea21
mov rdx, qword [rsp + 0x68]
mov r8d, ebx
mov rcx, r12
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x46e814
mov edx, dword [r15 + 0x1dc]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x46e0d6
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 0x46e200
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]
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 0x46e247
mov rdx, qword [rsp + 0x68]
test rdx, rdx
je 0x46e925
mov qword [r15 + 0x150], r12
mov ebx, 0x10
jmp 0x46e757
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
movzx r8d, r14w
mov rcx, r15
call fcn.0046f900
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x46e200
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]
nop dword [rax]
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 0x46e540
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 0x46e540
mov r15, r12
jmp 0x46e252
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 0x46e207
mov r8d, 0xfffffffb
jmp 0x46e6d8
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 0x46e340
mov edx, 2
mov qword [rsp + 0x70], 0
movzx ecx, r14w
mov word [rsp + 0x70], dx
mov qword [rsp + 0x78], 0
lea rbx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x72], ax
mov eax, dword [r15 + 0x18c]
mov rdx, rbx
mov qword [rsp + 0x68], rbx
mov ebx, 0x10
mov ecx, eax
and ecx, 0x10
test ecx, ecx
mov qword [r15 + 0x150], r12
je 0x46e757
jmp 0x46e715
mov ecx, 0x17
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x88], 0
mov word [rsp + 0x80], cx
mov qword [rsp + 0x90], 0
movzx ecx, r14w
mov dword [rsp + 0x98], 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 + 0x68], rbx
mov ebx, 0x1c
mov ecx, eax
and ecx, 0x10
jmp 0x46e96e
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 0x46e207
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 0x46e752
mov dword [r15 + 0xf0], ebx
mov rcx, r15
call sym.xmrig.exe_MHD_stop_daemon
jmp 0x46e24f
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]