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

Disassembly:
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 [0x140232230]
xor rax, rsp
mov qword [rbp + 0x8e0], rax
mov r13, qword [rcx]
mov rbx, rcx
mov r14d, edx
xor r15d, r15d
lea rcx, [rbp - 0x2f]
xor edx, edx
mov r8d, 0xff
mov dword [rsp + 0x3c], r15d
mov byte [rbp - 0x30], r15b
call fcn.140171ae0
mov rdi, qword [r13 + 0x4c0]
movzx r12d, r15w
mov qword [rsp + 0x40], r15
mov dword [rsp + 0x38], r12d
mov word [rsp + 0x34], r15w
mov esi, r15d
test rdi, rdi
je 0x140137d6f
or rcx, 0xffffffffffffffff
mov rax, rcx
inc rax
cmp byte [rdi + rax], sil
jne 0x140137c44
cmp rax, 1
jbe 0x140137d6f
mov rax, rcx
nop word [rax + rax]
inc rax
cmp byte [rdi + rax], sil
jne 0x140137c60
cmp rax, 0x16
jae 0x140137c76
mov ecx, socket
jmp 0x140137c7f
inc rcx
cmp byte [rdi + rcx], sil
jne 0x140137c76
inc rcx
mov edx, 1
call qword [fcn.14016f76c]
mov rsi, rax
test rax, rax
jne 0x140137c9d
lea eax, [rsi + 0x1b]
jmp 0x1401382bc
cmp byte [rdi], 0x3a
jne 0x140137ca7
mov r15, rdi
jmp 0x140137cd1
mov edx, 0x3a
mov rcx, rdi
call fcn.14016eefc
mov rcx, rsi
mov r15, rax
test rax, rax
je 0x140137d4c
mov r8, rax
mov rdx, rdi
sub r8, rdi
call fcn.14016fc40
test r15, r15
je 0x140137d5f
mov edx, 0x3a
mov rcx, r15
call fcn.14016eefc
mov rdi, rax
test rax, rax
je 0x140137d5f
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.14016fbfc
mov edx, 0x2d
mov rcx, rdi
mov r12d, eax
mov dword [rsp + 0x38], eax
call fcn.14016eefc
test rax, rax
je 0x140137d44
xor edx, edx
lea rcx, [rax + 1]
lea r8d, [rdx + 0xa]
call fcn.14016fbfc
xor r15d, r15d
mov dword [rsp + 0x34], eax
cmp r12w, ax
jbe 0x140137d62
movzx r12d, r15w
mov word [rsp + 0x34], r15w
mov dword [rsp + 0x38], r12d
jmp 0x140137d62
mov word [rsp + 0x34], r12w
jmp 0x140137d5f
sub rcx, rdi
nop
movzx eax, byte [rdi]
lea rdi, [rdi + 1]
mov byte [rcx + rdi - 1], al
test al, al
jne 0x140137d50
xor r15d, r15d
cmp byte [rsi], 0
je 0x140137d6f
mov rdx, rsi
jmp 0x140137dff
mov rcx, qword [rbx + 0x188]
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x140137dcc
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rbx
mov edx, eax
call fcn.14013f050
lea rdx, str.getsockname___failed:__s
mov rcx, r13
mov r8, rax
call fcn.140125b60
test rsi, rsi
je 0x140137dc2
mov rcx, rsi
call qword [fcn.1401673d0]
mov eax, 0x1e
jmp 0x1401382bc
cmp word [rsp + 0x50], 2
je 0x140137de1
mov ecx, 0x273f
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140137df8
lea rdx, [rbp + 0x4d0]
lea rcx, [rsp + 0x54]
mov r8d, 0x401
call fcn.14013eba0
lea rdx, [rbp + 0x4d0]
lea r9, [rsp + 0x40]
xor r8d, r8d
mov rcx, rbx
call fcn.140124f30
cmp eax, 1
jne 0x140137e21
lea rdx, [rsp + 0x40]
mov rcx, rbx
call fcn.140125660
mov rdx, qword [rsp + 0x40]
test rdx, rdx
je 0x140137e38
mov rdi, qword [rdx]
mov rcx, r13
call fcn.140125110
jmp 0x140137e3b
mov rdi, r15
test rsi, rsi
je 0x140137e49
mov rcx, rsi
call qword [fcn.1401673d0]
test rdi, rdi
jne 0x140137e65
lea rdx, str.Curl_resolv_failed__we_can_not_recover_
mov rcx, r13
call fcn.140125b60
lea eax, [rdi + 0x1e]
jmp 0x1401382bc
cmp dword [rdi + 8], 0
jne 0x140137e74
mov eax, dword [rbx + 0x94]
mov dword [rdi + 8], eax
mov r8d, dword [rdi + 0xc]
mov edx, dword [rdi + 8]
mov ecx, dword [rdi + 4]
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140137ec0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rdi, qword [rdi + 0x28]
test rdi, rdi
jne 0x140137e65
mov edx, eax
mov rcx, rbx
call fcn.14013f050
lea rdx, str.socket_failure:__s
mov rcx, r13
mov r8, rax
call fcn.140125b60
lea eax, [rsi + 0x1f]
jmp 0x1401382bc
movsxd r8, dword [rdi + 0x10]
mov rdx, qword [rdi + 0x20]
lea rcx, [rsp + 0x50]
call fcn.1401669c0
mov eax, dword [rdi + 0x10]
movzx r15d, r12w
mov dword [rsp + 0x30], eax
movzx eax, word [rsp + 0x34]
movzx r12d, r12w
cmp r12d, eax
jg 0x140137f9d
nop
cmp word [rsp + 0x50], 2
jne 0x140137f07
movzx ecx, r15w
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x52], ax
mov r8d, dword [rsp + 0x30]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x140137f9d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2741
jne 0x140137f75
mov edx, eax
mov rcx, rbx
call fcn.14013f050
lea rdx, str.bind_port_hu__failed:__s
mov r8d, r12d
mov r9, rax
mov rcx, r13
call fcn.140125b60
mov rcx, qword [rbx + 0x188]
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x140137fd4
movzx r15d, word [rsp + 0x38]
jmp 0x140137f89
cmp eax, 0x2740
je 0x140137f85
cmp eax, 0xd
jne 0x140138025
inc r15w
mov ecx, dword [rsp + 0x34]
movzx r12d, r15w
movzx eax, cx
cmp r12d, eax
jle 0x140137ef0
cmp r15w, word [rsp + 0x34]
jbe 0x140138061
lea rdx, str.bind___failed__we_ran_out_of_ports_
mov rcx, r13
call fcn.140125b60
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x140138012
mov rcx, qword [rbx + 0x40]
mov rdx, rsi
call rax
mov eax, 0x1e
jmp 0x1401382bc
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rbx
mov edx, eax
call fcn.14013f050
lea rdx, str.getsockname___failed:__s
mov r8, rax
mov rcx, r13
call fcn.140125b60
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x140138012
mov rcx, qword [rbx + 0x40]
mov rdx, rsi
call rax
mov eax, 0x1e
jmp 0x1401382bc
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, 0x1e
jmp 0x1401382bc
mov edx, eax
mov rcx, rbx
call fcn.14013f050
lea rdx, str.bind_port_hu__failed:__s
movzx r8d, r15w
mov r9, rax
mov rcx, r13
call fcn.140125b60
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x140138012
mov rcx, qword [rbx + 0x40]
mov rdx, rsi
call rax
mov eax, 0x1e
jmp 0x1401382bc
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x50]
mov rcx, rsi
mov dword [rsp + 0x30], 0x80
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x140137fd4
lea edx, [rax + 1]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
je 0x1401380b0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rbx
mov edx, eax
call fcn.14013f050
lea rdx, str.socket_failure:__s
jmp 0x140137feb
cmp dword [rdi + 4], 2
jne 0x1401380cd
mov rcx, qword [rdi + 0x20]
lea rdx, [rbp - 0x30]
mov r8d, 0x100
add rcx, 4
call fcn.14013eba0
cmp r14d, 2
je 0x140138120
movzx eax, word [rsp + 0x50]
nop dword [rax + rax]
cmp dword [rbx + 0x278], 0
jne 0x1401380ee
test r14d, r14d
je 0x140138117
cmp ax, 2
jne 0x140138117
movzx ecx, word [rsp + 0x52]
call qword [sym.imp.WS2_32.dll_ntohs]
movzx r8d, ax
test r14d, r14d
je 0x14013821d
cmp r14d, 1
je 0x14013815e
movzx eax, word [rsp + 0x50]
inc r14d
cmp r14d, 2
jne 0x1401380e0
mov edi, dword [rsp + 0x3c]
lea r15, [rbx + 0x4e0]
mov dword [r15 + 0xa4], r14d
mov rcx, qword [rbx + 0x190]
cmp rcx, 0xffffffffffffffff
je 0x14013829f
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x140138299
mov rdx, rcx
mov rcx, qword [rbx + 0x40]
call rax
jmp 0x14013829f
lea r10, [rbp + 0xd0]
lea rdx, [rbp - 0x30]
mov r9d, 0x2c
nop
movzx ecx, byte [rdx]
test cl, cl
je 0x14013818d
cmp cl, 0x2e
movzx eax, cl
cmove eax, r9d
inc r10
mov byte [r10 - 1], al
inc rdx
jne 0x140138170
movzx r9d, r8w
lea r8, str.__d__d
mov edx, setsockopt
movzx eax, r9b
mov rcx, r10
shr r9d, 8
mov dword [rsp + 0x20], eax
mov byte [r10], 0
call fcn.1401320d0
lea r15, [rbx + 0x4e0]
lea r9, [rbp + 0xd0]
lea r8, str.PORT
lea rdx, str._s__s
mov rcx, r15
call fcn.1401430b0
mov edi, eax
test eax, eax
je 0x14013812b
mov r8, qword [rbx + 0x38]
test r8, r8
je 0x140138205
mov rcx, qword [rbx + 0x40]
mov rdx, rsi
call r8
mov dword [rbx + 0x590], 0
jmp 0x1401382ba
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rbx + 0x590], 0
jmp 0x1401382ba
xor r9d, r9d
cmp word [rsp + 0x50], 2
movzx eax, r8w
mov dword [rsp + 0x28], eax
setne r9b
lea rax, [rbp - 0x30]
lea r15, [rbx + 0x4e0]
lea r8, str.EPRT
lea rdx, str._s__d_s_hu
inc r9d
mov rcx, r15
mov qword [rsp + 0x20], rax
call fcn.1401430b0
mov edi, eax
test eax, eax
je 0x14013812b
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x140138279
mov rcx, qword [rbx + 0x40]
mov rdx, rsi
call rax
jmp 0x140138282
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [r15 + 0xa4], 1
mov dword [rbx + 0x590], 0
jmp 0x1401382ba
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rbx + 0x190], rsi
mov dword [rbx + 0x258], 1
mov dword [rbx + 0x590], 0x1c
mov eax, edi
mov rcx, qword [rbp + 0x8e0]
xor rcx, rsp
call fcn.140166980
mov rbx, qword [rsp + 0xa40]
add rsp, 0x9f0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
push rbx
sub rsp, 0x20
mov rbx, rcx
mov rcx, qword [rcx]
mov rax, qword [rcx + 0x8918]
cmp dword [rax + 0x18], 0
je 0x1401383c9
mov edx, 1
mov rcx, rbx
mov dword [rbx + 0x590], 0xd
lea r8d, [rdx + 0xc]
add rsp, 0x20
pop rbx
jmp fcn.140138ac0
cmp dword [rcx + 0x3e8], 0
je 0x1401383e1
xor edx, edx
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp 0x140137bc0
cmp dword [rcx + 0x434], 0
je 0x140138482
mov r8, qword [rbx + 0x560]
test r8, r8
jne 0x14013843c
mov r8, qword [rcx + 0x498]
test r8, r8
jne 0x14013841f
cmp dword [rcx + 0x3e4], 0
lea rax, str.NLST
lea r8, str.LIST
cmovne r8, rax
lea rcx, [rbx + 0x4e0]
lea rdx, str.PRET__s
call fcn.1401430b0
test eax, eax
je 0x140138472
add rsp, 0x20
pop rbx
ret
cmp dword [rcx + 0x414], 0
lea rcx, [rbx + 0x4e0]
je 0x140138462
lea rdx, str.PRET_STOR__s
call fcn.1401430b0
test eax, eax
je 0x140138472
add rsp, 0x20
pop rbx
ret
lea rdx, str.PRET_RETR__s
call fcn.1401430b0
test eax, eax
jne 0x14013848f
mov dword [rbx + 0x590], 0x1d
add rsp, 0x20
pop rbx
ret
mov rcx, rbx
add rsp, 0x20
pop rbx
jmp fcn.1401382f0
add rsp, 0x20
pop rbx
ret