Function at 0x40ae3b
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x488
mov rdi, rcx
lea rsi, [rsp + 0x88]
mov rcx, rsi
call fcn.0040c177
mov rax, qword [rsi]
mov qword [rsp + 0x68], rax
test rax, rax
je 0x40af83
mov qword [rsp + 0x60], rdi
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x70]
mov qword [rax], 2
xorps xmm0, xmm0
movups xmmword [rax + 8], xmm0
mov esi, 0x200
mov eax, 2
mov qword [rsp + 0x28], rax
xor eax, eax
mov qword [rsp + 0x30], rax
mov r14d, 0xffffffff
xor ebx, ebx
xor r13d, r13d
cmp rsi, 0x201
jae 0x40aed3
lea r15, [rsp + 0x88]
mov edi, 0x200
mov rbp, rsi
jmp 0x40af03
sub rsi, r13
sub rbx, r13
cmp rbx, rsi
jb 0x40af5a
mov rbx, qword [rsp + 0x30]
cmp rbx, r14
mov r13d, 0xffffffff
cmovb r13, rbx
mov qword [rsp + 0x80], r13
mov r15, qword [rsp + 0x28]
mov rdi, r13
mov rbp, r13
xor ecx, ecx
call sub.KERNEL32.dll_SetLastError
mov rcx, qword [rsp + 0x68]
mov rdx, r15
mov r8d, ebp
call sub.KERNEL32.dll_GetEnvironmentVariableW
mov r12d, eax
test eax, eax
jne 0x40af2e
call sub.KERNEL32.dll_GetLastError
test eax, eax
jne 0x40afbe
mov esi, r12d
cmp rbp, rsi
jne 0x40af52
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x7a
jne 0x40afba
add rbp, rbp
cmp rbp, r14
cmovae rbp, r14
mov rsi, rbp
jmp 0x40aeb8
jb 0x40aeb8
jmp 0x40af95
lea rcx, [rsp + 0x70]
mov rdx, r13
mov r8, rsi
call fcn.0040d57e
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x30], rax
jmp 0x40aede
mov rcx, qword [rsp + 0x90]
call fcn.0040b9d7
jmp 0x40b257
cmp rdi, rsi
jb 0x40afba
test r12d, r12d
je 0x40aff8
mov al, byte [0x0041a0c8]
mov edx, 1
mov rcx, rsi
call fcn.004018e0
mov r14, rax
test rax, rax
jne 0x40affe
ud2
call sub.KERNEL32.dll_GetLastError
mov r14d, eax
shl r14, 0x20
or r14, 2
cmp qword [rsp + 0x30], 0
je 0x40afe9
mov rcx, qword [0x0041a090]
xor edx, edx
mov r8, qword [rsp + 0x28]
call fcn.00412bb4
mov rdi, qword [rsp + 0x60]
mov r15, qword [rsp + 0x58]
jmp 0x40b21e
mov r14d, 1
lea rdi, [rsp + 0x38]
mov qword [rdi], r14
mov qword [rdi + 8], rsi
mov qword [rdi + 0x10], 0
mov byte [rdi + 0x18], 1
lea rbx, [r15 + rsi*2]
xor ebp, ebp
xor r13d, r13d
test r13w, r13w
je 0x40b02a
mov ecx, r12d
jmp 0x40b03b
cmp r15, rbx
je 0x40b1db
movzx ecx, word [r15]
add r15, 2
mov edx, ecx
and edx, 0xf800
movzx eax, cx
cmp edx, 0xd800
jne 0x40b05f
cmp eax, 0xdbff
jbe 0x40b0c7
shl rax, 0x10
or rax, 1
jmp 0x40b063
shl rax, 0x20
xor r13d, r13d
test ax, ax
je 0x40b081
movzx ecx, ax
cmp ecx, 2
je 0x40b1db
shr eax, 0x10
mov byte [rsp + 0x50], 0
jmp 0x40b085
shr rax, 0x20
mov dword [rsp + 0x20], 0
cmp eax, 0x80
jae 0x40b0a2
mov byte [rsp + 0x20], al
mov esi, 1
jmp 0x40b16c
mov ecx, eax
cmp eax, 0x800
jae 0x40b108
shr ecx, 6
or cl, 0xc0
mov byte [rsp + 0x20], cl
and al, 0x3f
or al, 0x80
mov byte [rsp + 0x21], al
mov esi, 2
jmp 0x40b16c
cmp r15, rbx
je 0x40b19f
movzx edx, word [r15]
add r15, 2
mov r8d, edx
add r8d, 0x2000
movzx r8d, r8w
cmp r8d, 0xfbff
ja 0x40b1b2
shl rax, 0x10
or rax, 1
mov r13w, 1
mov r12d, edx
jmp 0x40b066
cmp eax, 0x10000
jae 0x40b137
shr ecx, 0xc
or cl, 0xe0
mov byte [rsp + 0x20], cl
mov ecx, eax
shr ecx, 6
and cl, 0x3f
or cl, 0x80
mov byte [rsp + 0x21], cl
and al, 0x3f
or al, 0x80
mov byte [rsp + 0x22], al
mov esi, 3
jmp 0x40b16c
shr ecx, 0x12
or cl, 0xf0
mov byte [rsp + 0x20], cl
mov ecx, eax
shr ecx, 0xc
and cl, 0x3f
or cl, 0x80
mov byte [rsp + 0x21], cl
mov ecx, eax
shr ecx, 6
and cl, 0x3f
or cl, 0x80
mov byte [rsp + 0x22], cl
and al, 0x3f
or al, 0x80
mov byte [rsp + 0x23], al
mov esi, 4
mov rcx, rdi
mov rdx, rsi
call fcn.00401bf2
mov r14, qword [rsp + 0x38]
mov rbp, qword [rsp + 0x48]
lea rcx, [r14 + rbp]
lea rdx, [rsp + 0x20]
mov r8, rsi
call sub.ntdll.dll_memcpy
add rbp, rsi
mov qword [rsp + 0x48], rbp
jmp 0x40b01f
shl rax, 0x10
or rax, 1
xor r13d, r13d
mov r15, rbx
jmp 0x40b066
movzx eax, dx
mov edx, 0x3ff
and ecx, edx
and eax, edx
shl rcx, 0x2a
shl rax, 0x20
or rax, rcx
movabs rcx, 0x1000000000000
add rax, rcx
jmp 0x40b063
mov rsi, qword [rsp + 0x40]
mov bl, byte [rsp + 0x50]
mov eax, dword [rsp + 0x51]
mov dword [rsp + 0x20], eax
mov eax, dword [rsp + 0x54]
mov dword [rsp + 0x23], eax
cmp qword [rsp + 0x30], 0
je 0x40b20f
mov rcx, qword [0x0041a090]
xor edx, edx
mov r8, qword [rsp + 0x28]
call fcn.00412bb4
cmp bl, 2
mov rdi, qword [rsp + 0x60]
mov r15, qword [rsp + 0x58]
jne 0x40b22a
mov rcx, r14
call fcn.0040b9d7
mov bl, 2
jmp 0x40b23a
mov eax, dword [rsp + 0x20]
mov ecx, dword [rsp + 0x23]
mov dword [rsp + 0x3b], ecx
mov dword [rsp + 0x38], eax
test r15, r15
je 0x40b252
mov rcx, qword [0x0041a090]
xor edx, edx
mov r8, qword [rsp + 0x68]
call fcn.00412bb4
cmp bl, 2
jne 0x40b260
mov byte [rdi + 0x18], 2
jmp 0x40b2f0
test bl, bl
jne 0x40b2e1
test rbp, rbp
je 0x40b2e1
lea rax, [r14 + rbp]
mov rdx, r14
lea rcx, [rdx + 1]
mov r8b, byte [rdx]
test r8b, r8b
jns 0x40b2d9
cmp r8b, 0xe0
jae 0x40b28f
add rdx, 2
cmp rcx, rax
cmovne rcx, rdx
jmp 0x40b2d9
cmp r8b, 0xed
jne 0x40b2b2
cmp rcx, rax
je 0x40b2e1
lea rcx, [rdx + 2]
cmp rcx, rax
je 0x40b2e1
cmp byte [rdx + 1], 0x9f
ja 0x40b304
add rdx, 3
mov rcx, rdx
jmp 0x40b2d9
add rdx, 2
cmp rcx, rax
cmove rdx, rcx
xor ecx, ecx
cmp rdx, rax
setne cl
add rcx, rdx
cmp r8b, 0xf0
jb 0x40b2d9
xor edx, edx
cmp rcx, rax
setne dl
add rcx, rdx
mov rdx, rcx
cmp rcx, rax
jne 0x40b270
mov qword [rdi], r14
mov qword [rdi + 8], rsi
mov qword [rdi + 0x10], rbp
mov byte [rdi + 0x18], 3
add rsp, 0x488
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov eax, dword [rsp + 0x38]
mov ecx, dword [rsp + 0x3b]
mov dword [rsp + 0x8b], ecx
mov dword [rsp + 0x88], eax
mov eax, dword [rsp + 0x88]
mov ecx, dword [rsp + 0x8b]
mov dword [rdi + 0x1c], ecx
mov dword [rdi + 0x19], eax
mov qword [rdi], r14
mov qword [rdi + 8], rsi
mov qword [rdi + 0x10], rbp
mov byte [rdi + 0x18], 0
jmp 0x40b2f0