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

Disassembly:
push rbx
sub rsp, 0x20
mov rbx, rcx
mov rcx, qword [rcx]
mov rax, qword [rcx + 0x208]
cmp dword [rax + 0x18], 0
je 0x140038699
mov edx, 1
mov rcx, rbx
mov dword [rbx + 0x884], 0xd
lea r8d, [rdx + 0xc]
add rsp, 0x20
pop rbx
jmp fcn.1400387b0
cmp dword [rcx + 0x784], 0
je 0x1400386b1
xor edx, edx
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp 0x140039420
cmp dword [rcx + 0x7d0], 0
je 0x140038752
mov r8, qword [rbx + 0x848]
test r8, r8
jne 0x14003870c
mov r8, qword [rcx + 0x840]
test r8, r8
jne 0x1400386ef
cmp dword [rcx + 0x780], 0
lea rax, str.NLST
lea r8, str.LIST
cmovne r8, rax
lea rcx, [rbx + 0x7c0]
lea rdx, str.PRET__s
call fcn.1400447d0
test eax, eax
je 0x140038742
add rsp, 0x20
pop rbx
ret
cmp dword [rcx + 0x7b0], 0
lea rcx, [rbx + 0x7c0]
je 0x140038732
lea rdx, str.PRET_STOR__s
call fcn.1400447d0
test eax, eax
je 0x140038742
add rsp, 0x20
pop rbx
ret
lea rdx, str.PRET_RETR__s
call fcn.1400447d0
test eax, eax
jne 0x14003875f
mov dword [rbx + 0x884], 0x1d
add rsp, 0x20
pop rbx
ret
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp fcn.140039380
add rsp, 0x20
pop rbx
ret
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x900]
sub rsp, 0xa00
mov rax, qword [0x1400a45d0]
xor rax, rsp
mov qword [rbp + 0x8f0], rax
mov r13, qword [rcx]
mov rdi, rcx
mov esi, edx
lea rcx, [rbp - 0x1f]
xor edx, edx
mov r8d, 0xff
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x38], 0xffffffffffffffff
mov byte [rbp - 0x20], 0
call fcn.14004d2b0
mov rbx, qword [r13 + 0x870]
xor r12d, r12d
mov qword [rsp + 0x58], r12
mov rcx, qword [r13 + 0x870]
movzx r14d, r12w
mov dword [rsp + 0x40], r14d
mov word [rsp + 0x34], r12w
mov dword [rsp + 0x50], 1
mov r15d, r12d
test rcx, rcx
je 0x1400396c3
or rax, 0xffffffffffffffff
nop dword [rax + rax]
inc rax
cmp byte [rcx + rax], r12b
jne 0x1400394c0
cmp rax, 1
jbe 0x1400396c3
or rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], r12b
jne 0x1400394d7
cmp rax, 0x41
jae 0x1400394ed
mov ecx, 0x41
jmp 0x1400394fa
or rcx, 0xffffffffffffffff
inc rcx
cmp byte [rbx + rcx], r12b
jne 0x1400394f1
inc rcx
mov edx, 1
call qword [case.0x14000dcb6.1]
mov r15, rax
test rax, rax
jne 0x140039519
lea eax, [r15 + 0x1b]
jmp 0x140039c2d
movzx eax, byte [rbx]
cmp al, 0x5b
jne 0x140039553
mov edx, 0x5d
mov rcx, rbx
lea r12, [rbx + 1]
call fcn.14004da10
mov r14, rax
test rax, rax
je 0x140039671
mov r8, rax
mov rdx, r12
mov rcx, r15
sub r8, r12
call fcn.14004e300
xor r12d, r12d
jmp 0x1400395c2
cmp al, 0x3a
jne 0x14003955c
mov r14, rbx
jmp 0x1400395c2
mov edx, Ordinal_60
mov rcx, rbx
call fcn.14004da10
mov r14, rax
test rax, rax
je 0x140039653
lea r8, [rsp + 0x60]
mov rdx, rbx
mov ecx, reloc.WS2_32.dll_socket
call fcn.1400262b0
mov rcx, r15
cmp eax, 1
jne 0x1400395b4
mov dword [rsp + 0x34], r12d
mov dword [rsp + 0x40], r12d
sub rcx, rbx
nop dword [rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 1]
mov byte [rcx + rbx - 1], al
test al, al
jne 0x1400395a0
jmp 0x140039674
mov r8, r14
mov rdx, rbx
sub r8, rbx
call fcn.14004e300
test r14, r14
je 0x140039674
mov edx, Ordinal_60
mov rcx, r14
call fcn.14004da10
mov rbx, rax
test rax, rax
je 0x140039674
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.14004ef58
mov ecx, eax
call fcn.140019150
mov edx, reloc.WLDAP32.dll_Ordinal_45
mov rcx, rbx
movzx r14d, ax
mov dword [rsp + 0x40], r14d
call fcn.14004da10
test rax, rax
je 0x14003964b
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.14004ef58
mov ecx, eax
call fcn.140019150
movzx r12d, ax
mov dword [rsp + 0x34], r12d
cmp r14w, ax
jbe 0x140039671
xor r12d, r12d
mov word [rsp + 0x34], r12w
mov word [rsp + 0x40], r12w
jmp 0x140039674
mov word [rsp + 0x34], r14w
jmp 0x140039674
mov rcx, r15
sub rcx, rbx
nop dword [rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 1]
mov byte [rcx + rbx - 1], al
test al, al
jne 0x140039660
jmp 0x140039674
xor r12d, r12d
cmp byte [r15], 0
je 0x1400396c3
mov rcx, qword [rdi + 0x70]
mov rcx, qword [rcx + 0x20]
call fcn.14003fc00
mov r8d, dword [rdi + 0xb8]
lea rcx, [rbp + 0xe0]
mov edx, eax
mov rax, qword [rdi + 0x70]
mov dword [rsp + 0x28], 0x401
mov qword [rsp + 0x20], rcx
mov ecx, dword [rax + 4]
mov r9, r15
call fcn.14000f5d0
test eax, eax
je 0x140039705
dec eax
je 0x140039c28
dec eax
je 0x140039740
mov rcx, qword [rdi + 0x238]
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x60]
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x14003970a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.1400289e0
lea rdx, str.getsockname___failed:__s
mov r8, rax
jmp 0x140039c17
mov rbx, r15
jmp 0x140039747
movzx eax, word [rsp + 0x60]
mov r9d, 0x401
lea r8, [rbp + 0xe0]
cmp ax, 0x17
je 0x14003972c
movzx ecx, ax
lea rdx, [rsp + 0x64]
jmp 0x140039736
lea rdx, [rsp + 0x68]
mov ecx, reloc.WS2_32.dll_socket
call fcn.140029420
mov dword [rsp + 0x50], r12d
lea rbx, [rbp + 0xe0]
lea r9, [rsp + 0x58]
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call fcn.14000edf0
cmp eax, 1
jne 0x14003976c
lea rdx, [rsp + 0x58]
mov rcx, rdi
call fcn.14000e1a0
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x140039c0d
mov r14, qword [rdx]
mov rcx, r13
call fcn.14000ef90
test r14, r14
je 0x140039c0d
mov rcx, r15
call qword [fcn.140049fdc]
mov qword [rsp + 0x38], 0xffffffffffffffff
mov ebx, r12d
nop word [rax + rax]
lea r9, [rsp + 0x38]
xor r8d, r8d
mov rdx, r14
mov rcx, rdi
call fcn.1400180b0
mov r12d, eax
test eax, eax
je 0x1400397dd
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14, qword [r14 + 0x28]
mov ebx, eax
test r14, r14
jne 0x1400397b0
jmp 0x1400397e2
test r14, r14
jne 0x140039803
mov edx, ebx
mov rcx, rdi
call fcn.1400289e0
lea rdx, str.socket_failure:__s
mov rcx, r13
mov r8, rax
call fcn.140016bd0
jmp 0x140039c28
movsxd r8, dword [r14 + 0x10]
mov rdx, qword [r14 + 0x20]
lea rcx, [rsp + 0x60]
call fcn.140049a70
mov eax, dword [r14 + 0x10]
movzx r13d, word [rsp + 0x34]
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0x40]
movzx r15d, ax
movzx ebx, ax
cmp r15d, r13d
jg 0x1400398e4
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov r8d, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
lea rdx, [rsp + 0x60]
mov word [rsp + 0x62], ax
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x1400398e4
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [rsp + 0x50], 0
je 0x1400398c8
cmp eax, 0x2741
jne 0x1400398c8
mov edx, eax
mov rcx, rdi
call fcn.1400289e0
mov rbx, qword [rsp + 0x48]
lea rdx, str.bind_port_hu__on_non_local_address_failed:__s_n
mov rcx, rbx
mov r9, rax
mov r8d, r15d
call fcn.140016ce0
mov rcx, qword [rdi + 0x238]
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x60]
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x140039912
movzx ebx, word [rsp + 0x40]
mov dword [rsp + 0x50], eax
jmp 0x1400398d7
cmp eax, 0x2740
je 0x1400398d4
cmp eax, 0xd
jne 0x140039946
inc bx
movzx r15d, bx
cmp r15d, r13d
jle 0x140039837
cmp bx, word [rsp + 0x34]
jbe 0x14003997a
mov rcx, qword [rsp + 0x48]
lea rdx, str.bind___failed__we_ran_out_of_ports_
call fcn.140016bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400176a0
jmp 0x140039c28
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.1400289e0
mov rcx, rbx
lea rdx, str.getsockname___failed:__s
mov r8, rax
call fcn.140016bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400176a0
jmp 0x140039c28
mov edx, eax
mov rcx, rdi
call fcn.1400289e0
mov rcx, qword [rsp + 0x48]
lea rdx, str.bind_port_hu__failed:__s
mov r9, rax
movzx r8d, bx
call fcn.140016bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400176a0
jmp 0x140039c28
mov rcx, qword [rsp + 0x38]
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x60]
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x1400399b5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.1400289e0
mov rcx, qword [rsp + 0x48]
jmp 0x140039925
mov rcx, qword [rsp + 0x38]
mov edx, 1
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x1400399ea
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.1400289e0
mov rcx, qword [rsp + 0x48]
lea rdx, str.socket_failure:__s
jmp 0x14003992c
lea rdx, [rbp - 0x20]
mov r8d, 0x100
mov rcx, r14
call fcn.14000edb0
cmp dword [rdi + 0x404], 0
jne 0x140039a18
cmp dword [rdi + 0x3dc], 0
je 0x140039a18
mov dword [rdi + 0x404], 1
cmp esi, 2
je 0x140039a6f
movzx eax, word [rsp + 0x60]
cmp dword [rdi + 0x404], 0
jne 0x140039a2f
test esi, esi
je 0x140039a68
cmp esi, 1
jne 0x140039a3a
cmp ax, 2
jne 0x140039a68
movzx ecx, ax
cmp ecx, 2
je 0x140039a47
cmp ecx, 0x17
jne 0x140039a68
movzx ecx, word [rsp + 0x62]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
test esi, esi
je 0x140039b83
cmp esi, 1
je 0x140039ac4
movzx eax, word [rsp + 0x60]
inc esi
cmp esi, 2
jne 0x140039a22
lea rbx, [rdi + 0x7c0]
mov dword [rbx + 0xb8], esi
mov rdx, qword [rdi + 0x240]
cmp rdx, 0xffffffffffffffff
je 0x140039a9c
mov rcx, rdi
call fcn.1400176a0
mov qword [rdi + 0x240], 0xffffffffffffffff
mov rax, qword [rsp + 0x38]
mov dword [rdi + 0x3e8], 1
mov qword [rdi + 0x240], rax
mov dword [rdi + 0x884], 0x1c
mov eax, r12d
jmp 0x140039c2d
lea r10, [rbp + 0x4f0]
lea rdx, [rbp - 0x20]
mov r9d, Ordinal_46
movzx ecx, byte [rdx]
test cl, cl
je 0x140039af2
cmp cl, 0x2e
movzx eax, cl
cmove eax, r9d
inc r10
mov byte [r10 - 1], al
inc rdx
jne 0x140039ad5
movzx r9d, r8w
lea r8, str.__d__d
mov edx, reloc.WS2_32.dll_sendto
movzx eax, r9b
mov rcx, r10
shr r9d, 8
mov dword [rsp + 0x20], eax
mov byte [r10], 0
call fcn.1400267b0
lea rbx, [rdi + 0x7c0]
lea r9, [rbp + 0x4f0]
lea r8, str.PORT
lea rdx, [0x140082a90]
mov rcx, rbx
call fcn.1400447d0
mov r12d, eax
test eax, eax
je 0x140039a76
mov ecx, eax
call fcn.140028b20
mov rcx, qword [rsp + 0x48]
lea rdx, str.Failure_sending_PORT_command:__s
mov r8, rax
call fcn.140016bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400176a0
mov dword [rdi + 0x884], 0
mov eax, r12d
jmp 0x140039c2d
xor r9d, r9d
cmp word [rsp + 0x60], 2
movzx eax, r8w
mov dword [rsp + 0x28], eax
setne r9b
lea rax, [rbp - 0x20]
lea rbx, [rdi + 0x7c0]
lea r8, str.EPRT
lea rdx, str._s__d_s_hu
inc r9d
mov rcx, rbx
mov qword [rsp + 0x20], rax
call fcn.1400447d0
mov r12d, eax
test eax, eax
je 0x140039a76
mov ecx, eax
call fcn.140028b20
mov rcx, qword [rsp + 0x48]
lea rdx, str.Failure_sending_EPRT_command:__s
mov r8, rax
call fcn.140016bd0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400176a0
mov dword [rbx + 0xb8], 1
mov dword [rdi + 0x884], 0
mov eax, r12d
jmp 0x140039c2d
mov r8, rbx
lea rdx, str.failed_to_resolve_the_address_provided_to_PORT:__s
mov rcx, r13
call fcn.140016bd0
mov rcx, r15
call qword [fcn.140049fdc]
mov eax, reloc.WLDAP32.dll_Ordinal_30
mov rcx, qword [rbp + 0x8f0]
xor rcx, rsp
call fcn.140049680
mov rbx, qword [rsp + 0xa50]
add rsp, 0xa00
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret