Function at 0x479890
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x118
mov r12, qword [rsp + 0x180]
mov ebx, ecx
mov ebp, ecx
mov r14d, edx
and ebx, 0x4202
mov rdi, r8
mov rsi, r9
mov dword [rsp + 0x50], 1
mov qword [rsp + 0x58], 0
jne 0x479e28
mov eax, ecx
or ah, 0x24
test ch, 0x80
cmovne ebp, eax
test r12, r12
je 0x479e28
mov eax, ebp
and eax, 0x240
cmp eax, 0x240
je 0x479e28
mov edx, ebp
and edx, 0x204
cmp edx, 0x204
je 0x479e28
mov edx, ebp
and edx, 0x4c
cmp edx, 0x40
je 0x479e28
test ebp, 0x10000
je 0x47993a
test eax, eax
jne 0x479e28
test bpl, 4
je 0x479e65
or ebp, 0x40
mov edx, 0x1e8
mov ecx, 1
call sub.msvcrt.dll_calloc
test rax, rax
mov r15, rax
je 0x479e28
mov rax, 0xffffffffffffffff
mov rdx, qword [rsp + 0x188]
mov dword [r15 + 0x194], ebp
mov qword [r15 + 0x158], rax
shr ebp, 5
mov qword [r15 + 0x68], rsi
mov qword [r15 + 0x170], rax
mov qword [r15 + 0x168], rax
lea rsi, [0x00476150]
lea rax, [0x00476140]
and ebp, 1
mov qword [r15 + 0x60], rdi
movabs rdi, 0x7fe00000000
mov qword [r15 + 8], rdx
mov dword [r15 + 0x160], 0
mov dword [r15 + 0x19c], ebp
mov word [r15 + 0x198], r14w
mov qword [r15], r12
mov qword [r15 + 0xd8], 0x8000
mov qword [r15 + 0xe0], 0x400
mov qword [r15 + 0xa0], rsi
mov qword [r15 + 0x180], rdi
mov qword [r15 + 0x188], 0
mov dword [r15 + 0x1e4], 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 + 0x194]
mov edx, eax
and edx, 0xc
cmp edx, 4
je 0x479e42
mov edx, eax
and dh, 0xfb
test al, 8
jne 0x479e5b
mov r8, qword [rsp + 0x190]
mov dword [r15 + 0x194], edx
lea rdx, [rsp + 0x58]
mov qword [r15 + 0x1d8], 0
mov qword [r15 + 0x1a0], 0
mov rcx, r15
mov dword [r15 + 0x1e0], 4
call fcn.004773c0
cmp eax, 1
jne 0x479e20
test byte [r15 + 0x195], 4
je 0x479a9a
mov esi, dword [r15 + 0xf0]
test esi, esi
je 0x479de0
mov r8d, dword [r15 + 0x1e0]
test r8d, r8d
je 0x479ae4
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 0x47a0b0
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [r15 + 0x1a8], rax
je 0x47a3fa
lea r13, [r15 + 0x1b0]
mov edx, 0x10
mov rbp, qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov rcx, r13
call rbp
test eax, eax
je 0x47a2a0
mov ecx, dword [r15 + 0x194]
test cl, 8
jne 0x479b20
mov r11d, dword [r15 + 0xf0]
test r11d, r11d
jne 0x479ef0
mov r12, qword [r15 + 0x158]
cmp r12, 0xffffffffffffffff
je 0x479f70
cmp word [r15 + 0x198], 0
jne 0x479bb4
test byte [r15 + 0x195], 1
jne 0x479bb4
lea rdx, [rsp + 0x90]
xor eax, eax
mov ecx, 0x10
mov dword [rsp + 0x54], pe_nt_image_headers64
lea r8, [rsp + 0x54]
mov rdi, rdx
rep stosq qword [rdi], rax
mov rcx, r12
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x47a130
movzx eax, word [rsp + 0x90]
cmp ax, 2
je 0x47a2d0
cmp ax, 0x17
je 0x47a2d0
cmp ax, 1
je 0x479baa
lea rdx, str.Unknown_address_family__n
mov rcx, r15
call fcn.0047b4a0
xor edx, edx
mov word [r15 + 0x198], dx
mov rcx, r12
call fcn.0047ce30
test eax, eax
je 0x479e80
lea r14, [r15 + 0x108]
mov edx, 0x10
mov rcx, r14
call rbp
test eax, eax
je 0x47a080
mov edi, dword [r15 + 0xf0]
test edi, edi
je 0x479fb0
mov eax, dword [r15 + 0x194]
and eax, 0x108
cmp eax, 8
jne 0x479e2b
mov ecx, edi
mov esi, dword [r15 + 0x184]
imul rcx, rcx, 0x1e8
call sub.msvcrt.dll_malloc
test rax, rax
mov rcx, rax
mov qword [r15 + 0xc8], rax
je 0x479d9c
mov eax, esi
xor edx, edx
mov qword [rsp + 0x38], r13
div edi
lea rdi, [r15 + 0x1f0]
mov qword [rsp + 0x40], r12
mov r13, r15
mov qword [rsp + 0x48], r14
mov r12, rdi
mov dword [rsp + 0x30], eax
add eax, 1
mov dword [rsp + 0x34], edx
mov r15d, eax
jmp 0x479cde
mov qword [r14 + 0x170], 0xffffffffffffffff
mov qword [r14 + 0x168], 0xffffffffffffffff
cmp ebx, dword [rsp + 0x34]
mov eax, dword [rsp + 0x30]
lea rsi, [r14 + 0x130]
mov edx, 0x10
mov rcx, rsi
cmovb eax, r15d
mov dword [r14 + 0x184], eax
call rbp
test eax, eax
je 0x47a38d
mov rdx, qword [r13 + 0xe8]
lea rcx, [r14 + 0xf8]
lea r8, [0x00479250]
mov r9, r14
call fcn.0047c140
test eax, eax
je 0x47a3b3
add ebx, 1
cmp dword [r13 + 0xf0], ebx
jbe 0x47a3f2
mov rcx, qword [r13 + 0xc8]
mov r9d, ebx
mov rax, qword [r13]
mov rsi, r13
imul r9, r9, 0x1e8
lea r14, [rcx + r9]
lea rdi, [r14 + 8]
mov qword [r14], rax
mov rcx, r14
mov rax, qword [r12 - 0x10]
and rdi, 0xfffffffffffffff8
sub rcx, rdi
sub rsi, rcx
add ecx, 0x1e8
mov qword [r14 + 0x1e0], rax
shr ecx, 3
rep movsq qword [rdi], qword [rsi]
mov qword [r14 + 0xc0], r13
mov dword [r14 + 0xf0], 0
mov qword [r14 + 0xc8], 0
test byte [r13 + 0x195], 4
je 0x479c60
lea rcx, [r14 + 0x168]
mov edx, 1
call fcn.0047ca90
test eax, eax
jne 0x479c76
mov r15, r13
mov r12, qword [rsp + 0x40]
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_create_worker_inter_thread_communication_channel:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
test ebx, ebx
jne 0x47a533
cmp r12, 0xffffffffffffffff
je 0x479db3
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
jne 0x47a54e
mov rcx, r14
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
mov rcx, qword [r15 + 0xc8]
test rcx, rcx
je 0x479f06
call sub.msvcrt.dll_free
jmp 0x479f06
lea rcx, [r15 + 0x168]
mov edx, 1
call fcn.0047ca90
test eax, eax
jne 0x479a9a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_create_inter_thread_communication_channel:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
nop dword [rax + rax]
mov rcx, r15
call sub.msvcrt.dll_free
xor r15d, r15d
mov rax, r15
add rsp, 0x118
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
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.0047b4a0
mov eax, dword [r15 + 0x194]
or eax, 8
or ah, 4
mov edx, eax
jmp 0x479a3b
mov eax, ebp
or eax, 0x40
test bpl, 8
cmovne ebp, eax
jmp 0x47993a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_set_nonblocking_mode_on_listening_socket:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
test byte [r15 + 0x195], 2
jne 0x479eb8
mov eax, dword [r15 + 0xf0]
test eax, eax
je 0x479bc4
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x47a0a0
lea r9, str.Close_socket_failed._n
mov r8d, 0x16d4
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop word [rax + rax]
lea rdx, str.MHD_thread_pooling_only_works_with_MHD_USE_INTERNAL_POLLING_THREAD_n
mov rcx, r15
call fcn.0047b4a0
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [r15 + 0x1a8]
call sub.msvcrt.dll_free
mov rcx, r13
call rbx
mov rcx, qword [r15 + 0x168]
cmp rcx, 0xffffffffffffffff
je 0x479e20
mov rbx, qword [sym.imp.WS2_32.dll_closesocket]
call rbx
test eax, eax
mov rcx, qword [r15 + 0x170]
jne 0x47a547
call rbx
test eax, eax
je 0x479e20
lea r9, str.Failed_to_destroy_ITC._n
mov r8d, 0x17dd
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop dword [rax + rax]
test ch, 1
je 0x47a154
lea r14, [r15 + 0x108]
mov edx, 0x10
mov rcx, r14
call rbp
test eax, eax
jne 0x479bdd
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0047b4a0
jmp 0x47a0a0
lea rsi, [r15 + 0x130]
mov edx, 0x10
mov rcx, rsi
call rbp
test eax, eax
je 0x47a0d0
mov eax, dword [r15 + 0x194]
and eax, 0x108
cmp eax, 8
jne 0x479e2b
mov edi, dword [r15 + 0xf0]
test edi, edi
jne 0x479c01
mov rdx, qword [r15 + 0xe8]
lea rcx, [r15 + 0xf8]
lea r8, [0x00479250]
mov r9, r15
call fcn.0047c140
test eax, eax
jne 0x479e2b
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.0047b4a0
mov rcx, rsi
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
mov rcx, r14
call rbx
cmp r12, 0xffffffffffffffff
je 0x479f06
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x479f06
lea r9, str.Close_socket_failed._n
mov r8d, 0x1738
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0047b4a0
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
jne 0x47a56f
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x479f06
lea rdx, str.Specified_value_for_NC_SIZE_too_large_n
mov rcx, r15
call fcn.0047b4a0
mov rcx, r15
xor r15d, r15d
call sub.msvcrt.dll_free
jmp 0x479e2b
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, r15
call fcn.0047b4a0
mov rcx, rsi
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call rbx
cmp r12, 0xffffffffffffffff
je 0x479f06
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x479f06
lea r9, str.Close_socket_failed._n
mov r8d, 0x170e
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop word [rax + rax]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_get_listen_port_number:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
jmp 0x479bb4
and ecx, 0x10
call fcn.0047ce80
cmp rax, 0xffffffffffffffff
mov r12, rax
je 0x47a362
cmp dword [r15 + 0x160], 0
je 0x47a1a4
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x50]
mov r8d, 4
jg 0x47a18e
mov r8d, 0xfffffffb
mov edx, 0xffff
mov rcx, r12
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x47a4e4
mov eax, dword [r15 + 0x194]
mov rdx, qword [rsp + 0x58]
test al, 0x10
je 0x47a2f0
test rdx, rdx
mov dword [rsp + 0x54], 0x1c
je 0x47a480
mov qword [r15 + 0x158], r12
and eax, 0x810
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x90]
cmp eax, 0x810
mov r8d, 0x1b
mov edx, 0x29
setne al
mov rcx, r12
movzx eax, al
mov dword [rsp + 0x90], eax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x47a50f
mov rdx, qword [rsp + 0x58]
mov r8d, dword [rsp + 0x54]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x47a30d
mov edx, dword [r15 + 0x1e4]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x479b31
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_listen_for_connections:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x47a0a0
lea r9, str.Close_socket_failed._n
mov r8d, 0x167b
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop dword [rax + rax]
lea rdx, str.MHD_failed_to_initialize_nonce_nc_mutex_n
mov rcx, r15
call fcn.0047b4a0
mov rcx, qword [r15 + 0x1a8]
call sub.msvcrt.dll_free
mov rcx, r15
xor r15d, r15d
call sub.msvcrt.dll_free
jmp 0x479e2b
movzx ecx, word [rsp + 0x92]
call qword [sym.imp.WS2_32.dll_ntohs]
mov word [r15 + 0x198], ax
jmp 0x479bb4
test rdx, rdx
mov dword [rsp + 0x54], 0x10
je 0x47a416
mov qword [r15 + 0x158], r12
jmp 0x47a218
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_bind_to_port__u:__s_n
mov r9, rax
movzx r8d, r14w
mov rcx, r15
call fcn.0047b4a0
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x47a0a0
lea r9, str.Close_socket_failed._n
mov r8d, 0x165d
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.Failed_to_create_socket_for_listening:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x479f06
mov r15, r13
lea rdx, str.MHD_failed_to_initialize_cleanup_connection_mutex_n
mov r12, qword [rsp + 0x40]
mov rcx, r15
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x38]
call fcn.0047b4a0
jmp 0x479d94
mov r15, r13
mov r12, qword [rsp + 0x40]
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x38]
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.0047b4a0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x479d94
mov r15, r13
jmp 0x479e2b
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 0x479e10
xor ecx, ecx
mov r8d, 2
lea rsi, [rsp + 0x60]
mov word [rsp + 0x6e], cx
mov qword [rsp + 0x62], 0
movzx ecx, r14w
mov dword [rsp + 0x6a], 0
mov word [rsp + 0x60], r8w
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x62], ax
mov eax, dword [r15 + 0x194]
mov qword [rsp + 0x58], rsi
mov rdx, rsi
mov qword [r15 + 0x158], r12
mov ecx, eax
and ecx, 0x10
test ecx, ecx
je 0x47a218
jmp 0x47a1d0
xor r9d, r9d
mov r10d, 0x17
mov qword [rsp + 0x72], 0
mov qword [rsp + 0x7a], 0
mov qword [rsp + 0x82], 0
movzx ecx, r14w
mov word [rsp + 0x8a], r9w
mov word [rsp + 0x70], r10w
lea rsi, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_htons]
mov qword [rsp + 0x78], 0
mov word [rsp + 0x72], ax
mov qword [rsp + 0x80], 0
jmp 0x47a44e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.setsockopt_failed:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
mov rbx, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x479f06
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.0047c1a0
lea rdx, str.setsockopt_failed:__s_n
mov r8, rax
mov rcx, r15
call fcn.0047b4a0
jmp 0x47a213
mov dword [r15 + 0xf0], ebx
mov rcx, r15
call sym.xmrig.exe_MHD_stop_daemon
jmp 0x479e28
call rbx
jmp 0x479f4a
lea r9, str.Close_socket_failed._n
mov r8d, 0x17af
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
lea r9, str.Close_socket_failed._n
mov r8d, 0x1700
lea rdx, str.T:_Bin_prep_mhd_src_libmicrohttpd_0.9.58_src_microhttpd_daemon.c
mov rcx, qword [0x004e5ae0]
call qword [0x004e5ae8]
nop
nop dword [rax + rax]
nop word cs:[rax + rax]