Function at 0x140122910
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 + 0x1f8]
cmp dword [rax + 0x18], 0
je 0x140122948
mov r8d, reloc.WS2_32.dll_listen
mov dl, 1
mov rcx, rbx
mov dword [rbx + 0x620], 0xd
add rsp, 0x20
pop rbx
jmp fcn.140122a60
cmp byte [rcx + 0x4a6], 0
je 0x140122960
xor edx, edx
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp 0x140123560
cmp byte [rcx + 0x4be], 0
je 0x140122a01
mov r8, qword [rbx + 0x5f8]
test r8, r8
jne 0x1401229bb
mov r8, qword [rcx + 0x508]
test r8, r8
jne 0x14012299e
cmp byte [rcx + 0x4a5], 0
lea rax, str.NLST
lea r8, str.LIST
cmovne r8, rax
lea rcx, [rbx + 0x578]
lea rdx, str.PRET__s
call fcn.14013f110
test eax, eax
je 0x1401229f1
add rsp, 0x20
pop rbx
ret
cmp byte [rcx + 0x4b0], 0
lea rcx, [rbx + 0x578]
je 0x1401229e1
lea rdx, str.PRET_STOR__s
call fcn.14013f110
test eax, eax
je 0x1401229f1
add rsp, 0x20
pop rbx
ret
lea rdx, str.PRET_RETR__s
call fcn.14013f110
test eax, eax
jne 0x140122a0e
mov dword [rbx + 0x620], 0x1d
add rsp, 0x20
pop rbx
ret
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp fcn.1401234c0
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 - 0x8f0]
sub rsp, 0x9f0
mov rax, qword [0x1402274c0]
xor rax, rsp
mov qword [rbp + 0x8e0], rax
mov r13, qword [rcx]
mov rdi, rcx
mov esi, edx
lea rcx, [rbp - 0x2f]
xor edx, edx
mov r8d, 0xff
mov qword [rsp + 0x38], 0xffffffffffffffff
mov byte [rbp - 0x30], 0
call fcn.140152f60
mov rbx, qword [r13 + 0x538]
xor eax, eax
mov byte [rsp + 0x30], 1
mov qword [rsp + 0x48], rax
mov rcx, qword [r13 + 0x538]
movzx r14d, ax
mov dword [rsp + 0x40], r14d
movzx r12d, ax
mov r15d, eax
test rcx, rcx
je 0x14012376e
or rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp byte [rcx + rax], r15b
jne 0x1401235f0
cmp rax, 1
jbe 0x14012376e
or rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], r15b
jne 0x140123607
cmp rax, 0x16
jae 0x14012361d
mov ecx, reloc.WS2_32.dll_shutdown
jmp 0x14012362a
or rcx, 0xffffffffffffffff
inc rcx
cmp byte [rbx + rcx], r15b
jne 0x140123621
inc rcx
mov edx, 1
call qword [fcn.140150b60]
mov r15, rax
test rax, rax
jne 0x140123649
lea eax, [r15 + 0x1b]
jmp 0x140123c84
cmp byte [rbx], 0x3a
jne 0x140123653
mov r14, rbx
jmp 0x14012367d
mov edx, Ordinal_60
mov rcx, rbx
call fcn.140150dd0
mov rcx, r15
mov r14, rax
test rax, rax
je 0x140123700
mov r8, rax
mov rdx, rbx
sub r8, rbx
call fcn.140150f10
test r14, r14
je 0x14012371f
mov edx, Ordinal_60
mov rcx, r14
call fcn.140150dd0
mov rbx, rax
test rax, rax
je 0x14012371f
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.140151a08
mov ecx, eax
call fcn.140100b30
mov edx, Ordinal_46
mov rcx, rbx
movzx r14d, ax
mov dword [rsp + 0x40], r14d
call fcn.140150dd0
test rax, rax
je 0x1401236fa
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.140151a08
mov ecx, eax
call fcn.140100b30
movzx r12d, ax
cmp r14w, ax
jbe 0x14012371f
xor r12d, r12d
mov dword [rsp + 0x40], r12d
jmp 0x14012371f
movzx r12d, r14w
jmp 0x14012371f
sub rcx, rbx
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 1]
mov byte [rcx + rbx - 1], al
test al, al
jne 0x140123710
cmp byte [r15], 0
je 0x14012376e
mov rcx, qword [rdi + 0x58]
mov rcx, qword [rcx + 0x20]
call fcn.1400f49b0
mov r8d, dword [rdi + 0xa0]
lea rcx, [rbp + 0xd0]
mov edx, eax
mov rax, qword [rdi + 0x58]
mov dword [rsp + 0x28], 0x401
mov qword [rsp + 0x20], rcx
mov ecx, dword [rax + 4]
mov r9, r15
call fcn.1400f49b0
test eax, eax
je 0x1401237b0
dec eax
je 0x140123c7f
dec eax
je 0x1401237d6
mov rcx, qword [rdi + 0x1d0]
lea r8, [rsp + 0x34]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x34], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x1401237b5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.140116660
lea rdx, str.getsockname___failed:__s
mov r8, rax
jmp 0x140123c6e
mov rbx, r15
jmp 0x1401237dd
movzx ecx, word [rsp + 0x50]
lea r8, [rbp + 0xd0]
lea rdx, [rsp + 0x54]
mov r9d, 0x401
call fcn.140117040
mov byte [rsp + 0x30], 0
lea rbx, [rbp + 0xd0]
lea r9, [rsp + 0x48]
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call fcn.1400f5680
cmp eax, 1
jne 0x140123802
lea rdx, [rsp + 0x48]
mov rcx, rdi
call fcn.1400f4ae0
mov rdx, qword [rsp + 0x48]
test rdx, rdx
je 0x140123c64
mov r14, qword [rdx]
mov rcx, r13
call fcn.1400f5820
test r14, r14
je 0x140123c64
mov rcx, r15
call qword [fcn.140150b20]
mov qword [rsp + 0x38], 0xffffffffffffffff
xor ebx, ebx
nop dword [rax + rax]
lea r9, [rsp + 0x38]
xor r8d, r8d
mov rdx, r14
mov rcx, rdi
call fcn.1400ffab0
mov r15d, eax
test eax, eax
je 0x14012386d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14, qword [r14 + 0x28]
mov ebx, eax
test r14, r14
jne 0x140123840
jmp 0x140123872
test r14, r14
jne 0x140123893
mov edx, ebx
mov rcx, rdi
call fcn.140116660
lea rdx, str.socket_failure:__s
mov rcx, r13
mov r8, rax
call fcn.1400fe7c0
jmp 0x140123c7f
movsxd r8, dword [r14 + 0x10]
mov rdx, qword [r14 + 0x20]
lea rcx, [rsp + 0x50]
call fcn.140152980
mov eax, dword [r14 + 0x10]
mov dword [rsp + 0x34], eax
mov eax, dword [rsp + 0x40]
movzx ebx, ax
cmp ax, r12w
ja 0x14012396e
nop
cmp word [rsp + 0x50], 2
jne 0x1401238d6
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x52], ax
mov r8d, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x38]
lea rdx, [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x1401239f5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp byte [rsp + 0x30], 0
je 0x140123955
cmp eax, 0x2741
jne 0x140123955
mov edx, eax
mov rcx, rdi
call fcn.140116660
lea rdx, str.bind_port_hu__on_non_local_address_failed:__s_n
movzx r8d, bx
mov r9, rax
mov rcx, r13
call fcn.1400fe880
mov rcx, qword [rdi + 0x1d0]
lea r8, [rsp + 0x34]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x34], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x14012398f
movzx ebx, word [rsp + 0x40]
mov byte [rsp + 0x30], al
jmp 0x140123964
cmp eax, 0x2740
je 0x140123961
cmp eax, 0xd
jne 0x1401239c3
inc bx
cmp bx, r12w
jbe 0x1401238c0
lea rdx, str.bind___failed__we_ran_out_of_ports_
mov rcx, r13
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
jmp 0x140123c7f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.140116660
lea rdx, str.getsockname___failed:__s
mov rcx, r13
mov r8, rax
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
jmp 0x140123c7f
mov edx, eax
mov rcx, rdi
call fcn.140116660
lea rdx, str.bind_port_hu__failed:__s
movzx r8d, bx
mov r9, rax
mov rcx, r13
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
jmp 0x140123c7f
cmp bx, r12w
ja 0x14012396e
mov rcx, qword [rsp + 0x38]
lea r8, [rsp + 0x34]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x34], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x14012398f
mov rcx, qword [rsp + 0x38]
lea edx, [rax + 1]
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x140123a6a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rdi
mov edx, eax
call fcn.140116660
lea rdx, str.socket_failure:__s
mov rcx, r13
mov r8, rax
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
jmp 0x140123c7f
lea rdx, [rbp - 0x30]
mov r8d, 0x100
mov rcx, r14
call fcn.1400f5650
cmp esi, 2
je 0x140123ac1
movzx eax, word [rsp + 0x50]
cmp byte [rdi + 0x32c], 0
jne 0x140123a93
test esi, esi
je 0x140123aba
cmp ax, 2
jne 0x140123aba
movzx ecx, word [rsp + 0x52]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
test esi, esi
je 0x140123bdc
cmp esi, 1
je 0x140123b1d
movzx eax, word [rsp + 0x50]
inc esi
cmp esi, 2
jne 0x140123a86
lea rbx, [rdi + 0x578]
mov dword [rbx + 0x9c], esi
mov rdx, qword [rdi + 0x1d8]
cmp rdx, 0xffffffffffffffff
je 0x140123aee
mov rcx, rdi
call fcn.1400ff190
mov qword [rdi + 0x1d8], 0xffffffffffffffff
mov rax, qword [rsp + 0x38]
mov dword [rdi + 0x674], 0
mov byte [rdi + 0x325], 1
mov qword [rdi + 0x1d8], rax
mov dword [rdi + 0x620], 0x1c
mov eax, r15d
jmp 0x140123c84
lea r10, [rbp + 0x4e0]
lea rdx, [rbp - 0x30]
mov r9d, Ordinal_46
nop
movzx ecx, byte [rdx]
test cl, cl
je 0x140123b4d
cmp cl, 0x2e
movzx eax, cl
cmove eax, r9d
inc r10
mov byte [r10 - 1], al
inc rdx
jne 0x140123b30
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.140100cf0
lea rbx, [rdi + 0x578]
lea r9, [rbp + 0x4e0]
lea r8, str.PORT
lea rdx, [0x1401bdee0]
mov rcx, rbx
call fcn.14013f110
mov r15d, eax
test eax, eax
je 0x140123ac8
mov ecx, eax
call fcn.140116780
lea rdx, str.Failure_sending_PORT_command:__s
mov rcx, r13
mov r8, rax
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
mov dword [rdi + 0x620], 0
mov eax, r15d
jmp 0x140123c84
xor r9d, r9d
cmp word [rsp + 0x50], 2
movzx eax, r8w
mov dword [rsp + 0x28], eax
setne r9b
lea rax, [rbp - 0x30]
lea rbx, [rdi + 0x578]
lea r8, str.EPRT
lea rdx, str._s__d_s_hu
inc r9d
mov rcx, rbx
mov qword [rsp + 0x20], rax
call fcn.14013f110
mov r15d, eax
test eax, eax
je 0x140123ac8
mov ecx, eax
call fcn.140116780
lea rdx, str.Failure_sending_EPRT_command:__s
mov rcx, r13
mov r8, rax
call fcn.1400fe7c0
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
call fcn.1400ff190
mov dword [rbx + 0x9c], 1
mov dword [rdi + 0x620], 0
mov eax, r15d
jmp 0x140123c84
mov r8, rbx
lea rdx, str.failed_to_resolve_the_address_provided_to_PORT:__s
mov rcx, r13
call fcn.1400fe7c0
mov rcx, r15
call qword [fcn.140150b20]
mov eax, reloc.WLDAP32.dll_Ordinal_30
mov rcx, qword [rbp + 0x8e0]
xor rcx, rsp
call fcn.140150a60
mov rbx, qword [rsp + 0xa40]
add rsp, 0x9f0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret