Function at 0x18001c170
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
mov esi, dword [0x18001ec30]
mov qword [rbp + 0x50], rcx
cmp esi, 0xffffffff
je 0x18001c240
dec esi
js 0x18001c1f7
mov rax, qword [rbp + 0x50]
mov r13, qword [0x18001ea60]
xor r15d, r15d
mov rdi, qword [sym.imp.ucrtbase.dll_strcmp]
lea r12, [rax + 1]
jmp 0x18001c1c9
lea r15d, [rbx + 1]
cmp r15d, esi
jg 0x18001c1f7
lea eax, [rsi + r15]
mov rcx, r12
mov ebx, eax
shr ebx, 0x1f
add ebx, eax
sar ebx, 1
movsxd r14, ebx
shl r14, 4
add r14, r13
lea rdx, [r14 + 1]
call rdi
test eax, eax
je 0x18001c230
jns 0x18001c1c0
lea esi, [rbx - 1]
cmp r15d, esi
jle 0x18001c1c9
mov rdi, qword [rbp + 0x50]
movzx eax, byte [0x18001ea70]
cmp byte [rdi], 0
js 0x18001c220
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov rdi, qword [rbp + 0x50]
mov byte [rdi], al
jmp 0x18001c207
movzx eax, byte [r14]
jmp 0x18001c207
lea rcx, str.WINEDEBUG
call qword [sym.imp.ucrtbase.dll_getenv]
mov dword [0x18001ec30], 0
mov rcx, rax
test rax, rax
je 0x18001c1f7
call qword [sym.imp.ucrtbase.dll__strdup]
mov qword [rbp - 8], rax
test rax, rax
je 0x18001c3aa
mov r12, qword [rbp - 8]
nop word cs:[rax + rax]
mov edx, 0x2c
mov rcx, r12
xor r13d, r13d
call qword [sym.imp.ucrtbase.dll_strchr]
test rax, rax
je 0x18001c29d
mov byte [rax], 0
lea r13, [rax + 1]
lea rdx, [0x180021280]
mov rcx, r12
call qword [sym.imp.ucrtbase.dll_strcspn]
lea r15, [r12 + rax]
mov rbx, rax
movzx esi, byte [r15]
test sil, sil
je 0x18001c348
cmp r15, r12
jbe 0x18001c3d0
xor edi, edi
lea r14, [0x180021270]
mov eax, 5
mov qword [rbp - 0x10], r15
cdqe
mov r15, r14
mov r14, rdi
mov edi, r14d
cmp rax, rbx
jne 0x18001c302
mov r8, rbx
mov rdx, r15
mov rcx, r12
call sym.memcmp
test eax, eax
je 0x18001c520
inc r14
cmp r14, 4
je 0x18001c338
lea rax, [0x180033e20]
mov edi, r14d
mov r15, qword [rax + r14*8]
mov rcx, r15
call qword [sym.imp.ucrtbase.dll_strlen]
cdqe
cmp rax, rbx
je 0x18001c2ec
inc r14
cmp r14, 4
jne 0x18001c30b
nop word [rax + rax]
test r13, r13
je 0x18001c3a0
mov r12, r13
jmp 0x18001c280
movzx esi, byte [r12]
cmp sil, 0x2d
je 0x18001c3b8
lea ebx, [rsi - 0x2b]
and ebx, 0xfd
je 0x18001c478
mov r14d, 0xffffffff
xor ebx, ebx
test sil, sil
je 0x18001c338
mov ecx, 4
mov rsi, r12
lea rdi, [0x180021283]
repe cmpsb byte [rsi], byte [rdi]
seta al
sbb al, 0
test al, al
jne 0x18001c3e0
not ebx
and bl, byte [0x18001ea70]
or r14d, ebx
mov byte [0x18001ea70], r14b
test r13, r13
jne 0x18001c33d
mov rcx, qword [rbp - 8]
call qword [sym.imp.ucrtbase.dll_free]
mov esi, dword [0x18001ec30]
jmp 0x18001c198
mov ebx, 0xffffffff
xor r14d, r14d
mov r15, r12
movzx esi, byte [r15 + 1]
lea r12, [r15 + 1]
jmp 0x18001c36a
mov r12, r15
jmp 0x18001c34d
mov rcx, r12
call qword [sym.imp.ucrtbase.dll_strlen]
mov qword [rbp - 0x18], rax
cmp rax, 0xe
ja 0x18001c338
mov eax, dword [0x18001ec30]
mov rcx, qword [0x18001ea60]
mov dword [rbp - 0x10], eax
dec eax
mov qword [rbp - 0x20], rcx
mov edi, eax
js 0x18001c61f
mov rax, qword [sym.imp.ucrtbase.dll_strcmp]
xor r15d, r15d
mov qword [rbp - 0x28], r13
mov byte [rbp - 0x2a], bl
mov r13d, r15d
mov rbx, rcx
mov byte [rbp - 0x29], r14b
mov r15, rax
jmp 0x18001c441
lea r13d, [r14 + 1]
cmp r13d, edi
jg 0x18001c4a2
lea eax, [rdi + r13]
mov rcx, r12
mov r8d, eax
shr r8d, 0x1f
add r8d, eax
sar r8d, 1
movsxd rsi, r8d
mov r14, rsi
shl rsi, 4
add rsi, rbx
lea rdx, [rsi + 1]
call r15
test eax, eax
je 0x18001c486
jns 0x18001c438
lea edi, [r14 - 1]
jmp 0x18001c43c
mov r15, r12
mov r14d, 0xffffffff
jmp 0x18001c3c3
movzx ebx, byte [rbp - 0x2a]
movzx r14d, byte [rbp - 0x29]
mov r13, qword [rbp - 0x28]
not ebx
and bl, byte [rsi]
or r14d, ebx
mov byte [rsi], r14b
jmp 0x18001c338
movsxd rsi, r13d
movzx r14d, byte [rbp - 0x29]
movzx ebx, byte [rbp - 0x2a]
mov r13, qword [rbp - 0x28]
mov r15, rsi
shl rsi, 4
mov eax, dword [0x18001ec40]
cmp dword [rbp - 0x10], eax
jge 0x18001c5b5
add rsi, qword [rbp - 0x20]
cmp r15d, dword [rbp - 0x10]
jl 0x18001c588
mov rax, qword [rbp - 0x18]
lea rcx, [rsi + 1]
inc rax
cmp eax, 8
jae 0x18001c559
test al, 4
jne 0x18001c637
test eax, eax
je 0x18001c502
movzx edx, byte [r12]
mov byte [rsi + 1], dl
test al, 2
jne 0x18001c64e
mov eax, dword [rbp - 0x10]
not ebx
and bl, byte [0x18001ea70]
or r14d, ebx
inc eax
mov byte [rsi], r14b
mov dword [0x18001ec30], eax
jmp 0x18001c338
mov r14d, 1
mov ecx, edi
mov r15, qword [rbp - 0x10]
shl r14d, cl
mov ebx, r14d
cmp sil, 0x2b
je 0x18001c615
sub esi, 0x2b
and esi, 0xfd
mov r14d, esi
je 0x18001c3c3
mov r12, r15
xor r14d, r14d
jmp 0x18001c36f
mov edx, eax
dec eax
mov r8, qword [r12 + rdx - 8]
mov qword [rcx + rdx - 8], r8
cmp eax, 8
jb 0x18001c502
and eax, 0xfffffff8
xor edx, edx
mov r8d, edx
add edx, 8
mov r9, qword [r12 + r8]
mov qword [rcx + r8], r9
cmp edx, eax
jb 0x18001c571
jmp 0x18001c502
mov r8d, dword [rbp - 0x10]
lea eax, [r15 + 1]
mov rcx, qword [rbp - 0x20]
mov rdx, rsi
cdqe
sub r8d, r15d
shl rax, 4
movsxd r8, r8d
add rcx, rax
shl r8, 4
call qword [sym.imp.ucrtbase.dll_memmove]
jmp 0x18001c4d6
add eax, eax
mov edx, 0x10
cmp eax, 0x10
cmovl eax, edx
mov dword [0x18001ec40], eax
cdqe
shl rax, 4
mov r8, rax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
cmp qword [rbp - 0x20], 0
mov rcx, qword [rax + 0x30]
je 0x18001c629
mov r9, r8
xor edx, edx
mov r8, qword [rbp - 0x20]
call qword [sym.imp.kernel32.dll_HeapReAlloc]
mov qword [rbp - 0x20], rax
mov rax, qword [rbp - 0x20]
mov qword [0x18001ea60], rax
mov eax, dword [0x18001ec30]
mov dword [rbp - 0x10], eax
jmp 0x18001c4c8
mov r12, r15
xor ebx, ebx
jmp 0x18001c3c0
xor esi, esi
xor r15d, r15d
jmp 0x18001c4b9
xor edx, edx
call qword [sym.imp.kernel32.dll_HeapAlloc]
mov qword [rbp - 0x20], rax
jmp 0x18001c5fc
mov edx, dword [r12]
mov eax, eax
mov dword [rsi + 1], edx
mov edx, dword [r12 + rax - 4]
mov dword [rcx + rax - 4], edx
jmp 0x18001c502
mov eax, eax
movzx edx, word [r12 + rax - 2]
mov word [rcx + rax - 2], dx
jmp 0x18001c502