Function at 0x580f30
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
mov rsi, qword [rsp + 0x128]
test rcx, rcx
mov rbx, rcx
mov r13, rdx
mov rbp, r8
mov edi, r9d
mov dword [rsp + 0x2c], pe_nt_image_headers64
je 0x581185
call fcn.00578010
test rax, rax
je 0x581185
cmp dword [rsp + 0x120], 0
jg 0x5811a0
jne 0x581221
lea rdx, [rsp + 0x30]
lea r8, [rsp + 0x2c]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x581240
mov edx, 0x60
mov ecx, 1
call fcn.0056d1f0
test rax, rax
mov r14, rax
je 0x581256
or byte [r14 + 0x34], 1
lea rax, [0x006cae60]
mov edx, 1
or edi, 0x10
mov word [r14 + 0x2c], dx
mov rcx, rbx
mov qword [r14], rax
mov qword [r14 + 0x10], r13
mov qword [r14 + 0x20], rbp
mov dword [r14 + 0x28], edi
call fcn.00578010
mov qword [r14 + 0x38], rsi
mov qword [r14 + 0x48], rax
mov r8d, 1
mov qword [r14 + 0x40], rbx
mov rdx, rsi
mov rcx, rax
call fcn.00577c70
test eax, eax
js 0x58117d
mov ecx, 1
call fcn.00573210
mov qword [r14 + 8], rax
mov eax, 4
mov edx, 8
mov word [r14 + 0x50], ax
mov ecx, 4
call fcn.0056d1f0
test rax, rax
mov qword [r14 + 0x58], rax
je 0x581269
xor esi, esi
cmp word [r14 + 0x50], 0
jg 0x581129
jmp 0x5811d0
cmp edx, 0x17
jne 0x5811c0
mov edx, 0xef
mov r12d, 0x58
mov ecx, 1
call fcn.0056d1f0
test rax, rax
mov r15, rax
je 0x5810e9
lea rcx, [rax + 0x28]
lea rdx, [fcn.00580730]
call fcn.00577c40
mov qword [r15 + 0x50], 0xffffffffffffffff
mov qword [r15 + 0x88], r14
mov byte [r15 + 0x90], r12b
mov byte [r15 + 0x91], bpl
mov rcx, qword [r14 + 0x40]
call fcn.0056b320
mov edx, eax
lea rcx, [r15 + 0x60]
lea r8, [0x00580990]
shr edx, 0x1f
mov r9, r15
add edx, eax
sar edx, 1
movzx edx, dl
call fcn.0056d030
mov edx, 0x3e8
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
mov qword [rbx], r15
mov rax, qword [r14 + 0x58]
mov rcx, qword [rax + rdi]
test rcx, rcx
je 0x581155
test r13, r13
je 0x58110b
call fcn.00580820
test eax, eax
js 0x5811f5
movsx edx, word [r14 + 0x50]
lea eax, [rsi + 1]
add word [r14 + 0x2c], 1
add rsi, 1
cmp edx, eax
jle 0x5811d0
mov rax, qword [r14 + 0x58]
movsx edx, word [rsp + 0x30]
lea rdi, [rsi*8]
lea rbx, [rax + rdi]
cmp edx, 2
mov ebp, edx
jne 0x581060
mov edx, 0xd7
mov r12d, 0x40
jmp 0x581074
lea rcx, str.Couldnt_create_accepting_socket
call fcn.00577220
mov rcx, qword [r14 + 0x58]
call fcn.0056f680
mov rcx, qword [r14 + 8]
test rcx, rcx
je 0x58117d
mov edx, 1
call fcn.00573230
mov rcx, r14
call fcn.0056f680
xor eax, eax
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov edx, dword [rsp + 0x120]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x580f8a
jmp 0x581185
xor r15d, r15d
jmp 0x5810e9
movzx eax, byte [r14 + 0x54]
test al, 2
je 0x5811e0
mov rax, r14
jmp 0x581187
mov rcx, qword [r14 + 0x40]
or eax, 2
mov byte [r14 + 0x54], al
call fcn.0056ff00
mov rax, r14
jmp 0x581187
lea rcx, str.Couldnt_start_accepting_on_socket
call fcn.00577220
mov rax, qword [r14 + 0x58]
mov rcx, qword [rax + rdi]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [r14 + 0x58]
mov rcx, qword [rax + rdi]
call fcn.005804b0
jmp 0x581161
mov edx, pe_nt_image_headers64
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x580f8a
jmp 0x581185
lea rdx, str.getsockname
mov rcx, rsi
call fcn.00577190
xor eax, eax
jmp 0x581187
lea rcx, str.calloc
call fcn.005770f0
xor eax, eax
jmp 0x581187
lea rcx, str.calloc
call fcn.005770f0
jmp 0x58116a
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov ebx, dword [rsp + 0x90]
mov rbp, qword [rsp + 0x98]
test rcx, rcx
mov rdi, rcx
mov r13, rdx
mov r12, r8
mov esi, r9d
je 0x5812d0
call fcn.00578010
test rax, rax
je 0x5812d0
call fcn.00577ca0
cmp qword [rax], 0
je 0x5812d0
cmp qword [rax + 0x10], 0
jne 0x5813c3
nop dword [rax]
cmp ebx, 0
jg 0x581375
jne 0x5813f0
mov edx, 0xb0
mov ecx, 1
call fcn.0056d1f0
test rax, rax
mov rbx, rax
je 0x581388
lea rax, [0x006caea0]
mov qword [rbx + 0x10], r13
mov qword [rbx + 0x20], r12
mov dword [rbx + 0x28], esi
mov qword [rbx], rax
mov eax, 1
mov word [rbx + 0x2c], ax
xor eax, eax
test sil, 1
sete al
shl eax, 0x1a
test sil, 4
mov dword [rbx + 0x30], eax
je 0x581334
or dword [rbx + 0x30], 0x80000000
test sil, 0x10
jne 0x5813b0
lea rax, [0x00580560]
lea rcx, [rbx + 0x38]
mov qword [rsp + 0x28], rbx
mov r9d, 0x12
mov r8, rbp
mov rdx, rdi
mov qword [rsp + 0x20], rax
call fcn.0056b6e0
and esi, 0x20
je 0x581390
mov rax, rbx
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov edx, ebx
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x5812df
xor ebx, ebx
jmp 0x581365
mov rcx, rbx
call fcn.00580d30
mov rax, rbx
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov ecx, 1
call fcn.00573210
mov qword [rbx + 8], rax
jmp 0x58133a
mov r9d, esi
mov r8, r12
mov rdx, r13
mov rcx, rdi
mov qword [rsp + 0x98], rbp
mov dword [rsp + 0x90], ebx
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp 0x580f30
mov edx, pe_nt_image_headers64
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x5812df
xor ebx, ebx
jmp 0x581365