Function at 0x180004130
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
mov r14d, dword [0x1800060e0]
mov rdi, rcx
cmp r14d, 0xffffffff
je 0x1800041e0
sub r14d, 1
js 0x1800041b1
mov r13, qword [0x18000c128]
mov r12, qword [sym.imp.ucrtbase.dll_strcmp]
xor r15d, r15d
lea rbp, [rdi + 1]
jmp 0x180004181
lea r15d, [rbx + 1]
cmp r15d, r14d
jg 0x1800041b1
lea eax, [r15 + r14]
mov rcx, rbp
mov ebx, eax
shr ebx, 0x1f
add ebx, eax
sar ebx, 1
movsxd rsi, ebx
shl rsi, 4
add rsi, r13
lea rdx, [rsi + 1]
call r12
test eax, eax
je 0x1800041d8
jns 0x180004178
lea r14d, [rbx - 1]
cmp r15d, r14d
jle 0x180004181
cmp byte [rdi], 0
movzx eax, byte [0x1800060e4]
js 0x1800041d0
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov byte [rdi], al
jmp 0x1800041bd
movzx eax, byte [rsi]
jmp 0x1800041bd
lea rcx, str.WINEDEBUG
call qword [sym.imp.ucrtbase.dll_getenv]
mov dword [0x1800060e0], 0
test rax, rax
je 0x1800041b1
mov rcx, rax
call qword [sym.imp.ucrtbase.dll__strdup]
test rax, rax
je 0x180004339
mov qword [rsp + 0x30], rax
mov rbx, rax
mov qword [rsp + 0xa0], rdi
nop
mov edx, 0x2c
mov rcx, rbx
xor r12d, r12d
call qword [sym.imp.ucrtbase.dll_strchr]
test rax, rax
je 0x18000423d
mov byte [rax], 0
lea r12, [rax + 1]
lea rdx, [0x1800085ea]
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strcspn]
lea rdi, [rbx + rax]
mov rsi, rax
movzx r13d, byte [rdi]
test r13b, r13b
je 0x1800042d0
cmp rbx, rdi
jae 0x180004410
mov eax, 5
xor r15d, r15d
lea r14, str.fixme
cdqe
cmp rax, rsi
jne 0x180004293
mov rdx, qword [r14 + r15*8]
mov r8, rsi
mov rcx, rbx
call sym.memcmp
test eax, eax
je 0x1800044b5
add r15, 1
cmp r15, 4
je 0x1800042c0
mov rcx, qword [r14 + r15*8]
call qword [sym.imp.ucrtbase.dll_strlen]
cdqe
cmp rax, rsi
je 0x18000427c
add r15, 1
cmp r15, 4
jne 0x18000429d
nop dword [rax + rax]
test r12, r12
je 0x180004323
mov rbx, r12
jmp 0x180004220
movzx r13d, byte [rbx]
cmp r13b, 0x2d
je 0x180004348
lea esi, [r13 - 0x2b]
and esi, 0xfd
je 0x180004400
mov r14d, 0xffffffff
xor esi, esi
test r13b, r13b
je 0x1800042c0
lea rdx, [0x1800085ed]
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strcmp]
test eax, eax
jne 0x180004360
not esi
and sil, byte [0x1800060e4]
or esi, r14d
mov byte [0x1800060e4], sil
test r12, r12
jne 0x1800042c5
mov rbp, qword [rsp + 0x30]
mov rdi, qword [rsp + 0xa0]
mov rcx, rbp
call qword [sym.imp.ucrtbase.dll_free]
mov r14d, dword [0x1800060e0]
jmp 0x180004154
mov esi, 0xffffffff
xor r14d, r14d
mov rdi, rbx
movzx r13d, byte [rdi + 1]
lea rbx, [rdi + 1]
jmp 0x1800042f2
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strlen]
mov r15, rax
cmp rax, 0xe
ja 0x1800042c0
mov r9d, dword [0x1800060e0]
mov rax, qword [0x18000c128]
mov edi, r9d
mov qword [rsp + 0x28], rax
sub edi, 1
js 0x18000457a
xor r13d, r13d
mov qword [rsp + 0x48], r15
mov dword [rsp + 0x40], r9d
mov r15d, r13d
mov r13d, edi
mov rdi, rax
mov byte [rsp + 0x38], sil
jmp 0x1800043c1
lea r15d, [rsi + 1]
cmp r13d, r15d
jl 0x18000442d
lea eax, [r15 + r13]
mov rcx, rbx
mov r8d, eax
shr r8d, 0x1f
add r8d, eax
mov esi, r8d
sar esi, 1
movsxd rbp, esi
shl rbp, 4
add rbp, rdi
lea rdx, [rbp + 1]
call qword [sym.imp.ucrtbase.dll_strcmp]
test eax, eax
je 0x180004418
jns 0x1800043b8
lea r13d, [rsi - 1]
jmp 0x1800043bc
mov rdi, rbx
mov r14d, 0xffffffff
jmp 0x180004353
mov rbx, rdi
jmp 0x1800042d4
movzx edx, byte [rsp + 0x38]
not edx
and dl, byte [rbp]
or edx, r14d
mov byte [rbp], dl
jmp 0x1800042c0
movsxd r11, r15d
mov r9d, dword [rsp + 0x40]
mov eax, dword [0x18000c130]
mov r10, r11
movzx esi, byte [rsp + 0x38]
mov r15, qword [rsp + 0x48]
mov r13, r11
shl r10, 4
cmp r9d, eax
jge 0x18000458e
mov rax, qword [rsp + 0x28]
add r10, rax
cmp r13d, r9d
jl 0x18000453d
add r15, 1
lea rax, [r10 + 1]
cmp r15d, 8
jae 0x1800044ed
test r15b, 4
jne 0x180004626
test r15d, r15d
je 0x180004495
movzx edx, byte [rbx]
mov byte [rax], dl
test r15b, 2
jne 0x18000463c
mov eax, esi
add r9d, 1
not eax
and al, byte [0x1800060e4]
mov dword [0x1800060e0], r9d
or eax, r14d
mov byte [r10], al
jmp 0x1800042c0
mov r14d, 1
mov ecx, r15d
shl r14d, cl
mov esi, r14d
cmp r13b, 0x2b
je 0x180004603
sub r13d, 0x2b
mov r14d, r13d
and r14d, 0xfd
je 0x180004353
mov rbx, rdi
xor r14d, r14d
jmp 0x1800042f7
mov rdx, qword [rbx]
mov qword [r10 + 1], rdx
mov edx, r15d
mov rcx, qword [rbx + rdx - 8]
mov qword [rax + rdx - 8], rcx
lea rdx, [r10 + 9]
and rdx, 0xfffffffffffffff8
sub rax, rdx
add r15d, eax
sub rbx, rax
and r15d, 0xfffffff8
cmp r15d, 8
jb 0x180004495
and r15d, 0xfffffff8
xor eax, eax
mov ecx, eax
add eax, 8
mov r8, qword [rbx + rcx]
mov qword [rdx + rcx], r8
cmp eax, r15d
jb 0x180004526
jmp 0x180004495
mov r8d, r9d
lea rcx, [r11 + 1]
mov dword [rsp + 0x38], r9d
mov rdx, r10
shl rcx, 4
sub r8d, r13d
mov qword [rsp + 0x28], r10
add rax, rcx
movsxd r8, r8d
mov rcx, rax
shl r8, 4
call qword [sym.imp.ucrtbase.dll_memmove]
mov r9d, dword [rsp + 0x38]
mov r10, qword [rsp + 0x28]
jmp 0x180004469
mov eax, dword [0x18000c130]
cmp eax, r9d
jg 0x180004570
xor r10d, r10d
xor r11d, r11d
xor r13d, r13d
mov ecx, 0x10
add eax, eax
mov qword [rsp + 0x40], r10
cmp eax, ecx
mov qword [rsp + 0x38], r11
cmovl eax, ecx
mov dword [0x18000c130], eax
cdqe
shl rax, 4
mov r8, rax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
cmp qword [rsp + 0x28], 0
mov rcx, qword [rax + 0x30]
je 0x18000460d
mov r9, r8
xor edx, edx
mov r8, qword [rsp + 0x28]
call qword [sym.imp.kernel32.dll_HeapReAlloc]
mov r10, qword [rsp + 0x40]
mov r11, qword [rsp + 0x38]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x28]
mov r9d, dword [0x1800060e0]
mov qword [0x18000c128], rax
jmp 0x180004458
mov rbx, rdi
xor esi, esi
jmp 0x180004350
xor edx, edx
call qword [sym.imp.kernel32.dll_HeapAlloc]
mov r11, qword [rsp + 0x38]
mov r10, qword [rsp + 0x40]
mov qword [rsp + 0x28], rax
jmp 0x1800045eb
mov edx, dword [rbx]
mov r15d, r15d
mov dword [rax], edx
mov edx, dword [rbx + r15 - 4]
mov dword [rax + r15 - 4], edx
jmp 0x180004495
mov r15d, r15d
movzx edx, word [rbx + r15 - 2]
mov word [rax + r15 - 2], dx
jmp 0x180004495