Function at 0x40b160
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x28
mov edi, dword [0x410250]
cmp edi, 0xffffffff
je 0x40b181
test edi, edi
jg 0x40b4c3
jmp 0x40b51f
push str.WINEDEBUG
call dword [sym.imp.ucrtbase.dll_getenv]
add esp, 4
mov dword [0x410250], 0
test eax, eax
je 0x40b51f
push eax
call dword [sym.imp.ucrtbase.dll__strdup]
add esp, 4
test eax, eax
je 0x40b4b9
mov esi, dword [sym.imp.ucrtbase.dll_strcspn]
mov dword [ebp - 0x2c], eax
mov edi, eax
jmp 0x40b1eb
mov eax, dword [ebp - 0x1c]
not al
and al, byte [0x410254]
or al, byte [ebp - 0x18]
mov byte [0x410254], al
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [ebp - 0x10]
test edi, edi
je 0x40b4ad
push 0x2c
push edi
call dword [sym.imp.ucrtbase.dll_strchr]
add esp, 8
test eax, eax
je 0x40b210
mov ecx, eax
inc ecx
mov dword [ebp - 0x10], ecx
mov byte [eax], 0
jmp 0x40b217
mov dword [ebp - 0x10], 0
push 0x40e23a
push edi
call esi
add esp, 8
cmp byte [edi + eax], 0
mov edx, edi
je 0x40b22e
add eax, edi
mov edx, eax
mov eax, edx
sub eax, edi
jbe 0x40b280
cmp eax, 3
je 0x40b29b
cmp eax, 4
je 0x40b2b9
cmp eax, 5
jne 0x40b1e0
mov eax, dword [edi]
mov ecx, 0x6d786966
xor eax, ecx
movzx ecx, byte [edi + 4]
xor ecx, 0x65
or ecx, eax
je 0x40b2cb
mov eax, dword [edi]
mov ecx, 0x63617274
xor eax, ecx
movzx ecx, byte [edi + 4]
xor ecx, 0x65
or ecx, eax
jne 0x40b1e0
mov edi, edx
mov cl, 3
jmp 0x40b2cf
movzx eax, byte [edx]
cmp al, 0x2d
sete cl
setne bl
neg bl
mov dword [ebp - 0x18], ebx
neg cl
mov dword [ebp - 0x1c], ecx
cmp al, 0x2d
jne 0x40b2fa
jmp 0x40b302
movzx eax, word [edi]
xor eax, 0x7265
movzx ecx, byte [edi + 2]
xor ecx, 0x72
or cx, ax
jne 0x40b1e0
mov edi, edx
mov cl, 1
jmp 0x40b2cf
cmp dword [edi], 0x6e726177
jne 0x40b1e0
mov edi, edx
mov cl, 2
jmp 0x40b2cf
mov edi, edx
xor ecx, ecx
mov dl, 1
shl dl, cl
movzx eax, byte [edi]
cmp al, 0x2b
je 0x40b2e8
mov dword [ebp - 0x18], 0
mov ecx, edx
mov dword [ebp - 0x1c], ecx
jmp 0x40b2f4
mov dword [ebp - 0x1c], 0
mov ecx, edx
mov dword [ebp - 0x18], ecx
mov edx, edi
cmp al, 0x2d
je 0x40b302
movzx ecx, al
cmp ecx, 0x2b
jne 0x40b307
movzx eax, byte [edx + 1]
inc edx
test al, al
je 0x40b1e0
push 0x40e23d
push edx
mov edi, edx
call dword [sym.imp.ucrtbase.dll_strcmp]
add esp, 8
test eax, eax
je 0x40b1c0
mov ebx, dword [0x410250]
push edi
call dword [sym.imp.ucrtbase.dll_strlen]
add esp, 4
cmp eax, 0xe
ja 0x40b1e0
mov edx, edi
mov eax, dword [0x411248]
mov dword [ebp - 0x24], eax
test ebx, ebx
mov dword [ebp - 0x20], ebx
jle 0x40b3a8
dec ebx
xor edi, edi
jmp 0x40b36c
inc ebx
mov edi, ebx
mov edx, esi
mov ebx, dword [ebp - 0x28]
cmp edi, ebx
jg 0x40b3aa
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x28], ebx
lea eax, [ebx + edi]
mov ebx, eax
shr ebx, 0x1f
add ebx, eax
sar ebx, 1
mov edi, ebx
shl edi, 4
mov eax, dword [ebp - 0x24]
add eax, edi
inc eax
push eax
mov esi, edx
push edx
call dword [sym.imp.ucrtbase.dll_strcmp]
add esp, 8
test eax, eax
je 0x40b40b
jns 0x40b360
dec ebx
mov edx, esi
mov edi, dword [ebp - 0x14]
cmp edi, ebx
jle 0x40b36c
jmp 0x40b3aa
xor edi, edi
mov ecx, dword [0x41124c]
cmp dword [ebp - 0x20], ecx
mov dword [ebp - 0x14], edi
jge 0x40b3c9
mov esi, dword [sym.imp.ucrtbase.dll_strcspn]
mov ebx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
jmp 0x40b453
add ecx, ecx
cmp ecx, 0x11
mov esi, dword [sym.imp.ucrtbase.dll_strcspn]
jge 0x40b3db
mov ecx, 0x10
mov edi, edx
mov dword [0x41124c], ecx
shl ecx, 4
mov edx, dword [ebp - 0x24]
test edx, edx
je 0x40b427
mov eax, dword fs:[0x18]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 0x30]
push ecx
push edx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapReAlloc]
jmp 0x40b442
mov eax, dword [ebp - 0x1c]
not al
mov ecx, dword [ebp - 0x24]
and al, byte [ecx + edi]
or al, byte [ebp - 0x18]
mov byte [ecx + edi], al
mov esi, dword [sym.imp.ucrtbase.dll_strcspn]
jmp 0x40b1e0
mov eax, dword fs:[0x18]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov ebx, eax
mov dword [0x411248], eax
mov eax, dword [0x410250]
mov edx, edi
mov edi, dword [ebp - 0x14]
mov dword [ebp - 0x20], eax
sub eax, edi
jle 0x40b47c
mov ecx, edi
shl ecx, 4
mov edi, edx
lea edx, [ebx + ecx]
add edx, 0x10
add ecx, ebx
shl eax, 4
push eax
push ecx
push edx
call sym._memmove
mov edx, edi
mov edi, dword [ebp - 0x14]
add esp, 0xc
shl edi, 4
lea eax, [ebx + edi]
inc eax
push edx
push eax
call dword [sym.imp.ucrtbase.dll_strcpy]
add esp, 8
mov eax, dword [ebp - 0x1c]
not al
and al, byte [0x410254]
or al, byte [ebp - 0x18]
mov byte [ebx + edi], al
mov eax, dword [ebp - 0x20]
inc eax
mov dword [0x410250], eax
jmp 0x40b1e0
push dword [ebp - 0x2c]
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
mov edi, dword [0x410250]
test edi, edi
jle 0x40b51f
dec edi
mov eax, dword [0x411248]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [ebp - 0x28], eax
xor eax, eax
jmp 0x40b4ea
inc edi
mov eax, edi
mov edi, dword [ebp - 0x14]
cmp eax, edi
jg 0x40b51f
mov dword [ebp - 0x14], edi
mov esi, eax
add eax, edi
mov edi, eax
shr edi, 0x1f
add edi, eax
sar edi, 1
mov ebx, edi
shl ebx, 4
mov eax, dword [ebp - 0x10]
add eax, ebx
inc eax
push eax
push dword [ebp - 0x28]
call dword [sym.imp.ucrtbase.dll_strcmp]
add esp, 8
test eax, eax
je 0x40b539
jns 0x40b4e0
dec edi
mov eax, esi
cmp eax, edi
jle 0x40b4ea
mov dword [ebp - 0x10], 0x410254
mov ecx, dword [ebp + 8]
cmp byte [ecx], 0
jns 0x40b53c
movzx eax, byte [0x410254]
mov byte [ecx], al
jmp 0x40b53c
add dword [ebp - 0x10], ebx
mov eax, dword [ebp - 0x10]
movzx eax, byte [eax]
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret