Function at 0x1403f0360
Capabilities:
Query environment variable

Disassembly:
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x30
mov r14, r8
mov rsi, rdx
mov r15, rcx
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp byte [rdx + rdi], 0
jne 0x1403f0380
xor r12d, r12d
mov qword [rsp + 0x78], r12
test rdi, rdi
je 0x1403f03c3
cmp byte [rdi + rdx - 1], 0x2e
jne 0x1403f03c3
mov rcx, rsi
call fcn.1403f6440
test rax, rax
mov qword [r14], rax
mov ecx, reloc.WS2_32.dll_ntohs
cmovne ecx, r12d
mov eax, ecx
add rsp, 0x30
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret
test byte [rcx], 0x40
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x68], rbp
jne 0x1403f0568
mov edx, 0x2e
mov rcx, rsi
call sub.VCRUNTIME140.dll_strchr
test rax, rax
jne 0x1403f0568
lea rcx, str.HOSTALIASES
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
test rax, rax
je 0x1403f0568
lea rdx, [0x140518a80]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov rbp, rax
test rax, rax
je 0x1403f0550
lea r8, [rsp + 0x20]
mov rcx, rax
lea rdx, [rsp + 0x78]
call fcn.1403f6600
mov ebx, eax
test eax, eax
jne 0x1403f04ae
nop word [rax + rax]
mov rcx, qword [rsp + 0x78]
mov r8, rdi
mov rdx, rsi
call sub.api_ms_win_crt_string_l1_1_0.dll__strnicmp
test eax, eax
jne 0x1403f0496
mov rax, qword [rsp + 0x78]
movzx ecx, byte [rax + rdi]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isspace]
test eax, eax
je 0x1403f0496
mov rbx, qword [rsp + 0x78]
add rbx, rdi
movzx ecx, byte [rbx]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isspace]
test eax, eax
je 0x1403f0491
nop dword [rax]
movzx ecx, byte [rbx + 1]
inc rbx
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isspace]
test eax, eax
jne 0x1403f0480
cmp byte [rbx], r12b
jne 0x1403f04da
lea r8, [rsp + 0x20]
mov rcx, rbp
lea rdx, [rsp + 0x78]
call fcn.1403f6600
mov ebx, eax
test eax, eax
je 0x1403f0440
mov rcx, qword [rsp + 0x78]
call qword [0x14060c6f8]
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
test ebx, ebx
je 0x1403f0568
cmp ebx, 0xd
je 0x1403f0568
mov eax, ebx
jmp 0x1403f0594
movzx eax, byte [rbx + 1]
lea rdi, [rbx + 1]
test al, al
je 0x1403f04fe
movzx ecx, al
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isspace]
test eax, eax
jne 0x1403f04fe
movzx eax, byte [rdi + 1]
inc rdi
test al, al
jne 0x1403f04e6
mov rsi, rdi
sub rsi, rbx
lea rcx, [rsi + 1]
call qword [0x14060c6e8]
mov qword [r14], rax
test rax, rax
je 0x1403f052e
mov r8, rsi
mov rdx, rbx
mov rcx, rax
call sub.VCRUNTIME140.dll_memcpy
mov rax, qword [r14]
sub rax, rbx
mov byte [rax + rdi], r12b
mov rcx, qword [rsp + 0x78]
call qword [0x14060c6f8]
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
cmp qword [r14], r12
mov eax, reloc.WS2_32.dll_ntohs
cmovne eax, r12d
jmp 0x1403f0594
call qword [sym.imp.KERNEL32.dll_GetLastError]
add eax, 0xfffffffe
cmp eax, 1
jbe 0x1403f0568
mov qword [r14], r12
mov eax, select
jmp 0x1403f0594
test byte [r15], 0x20
jne 0x1403f057b
cmp dword [r15 + 0x30], r12d
je 0x1403f057b
mov qword [r14], r12
xor eax, eax
jmp 0x1403f0594
mov rcx, rsi
call fcn.1403f6440
test rax, rax
mov qword [r14], rax
mov ecx, reloc.WS2_32.dll_ntohs
cmovne ecx, r12d
mov eax, ecx
mov rbx, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
add rsp, 0x30
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret