Function at 0x401570
Capabilities:
Query environment variable

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x48
mov edx, dword [0x402010]
mov eax, dword [ecx]
cmp edx, 0xffffffff
mov dword [ebp - 0x2c], eax
je 0x401630
sub edx, 1
js 0x401600
mov eax, dword [0x404088]
xor edi, edi
mov ecx, edi
mov edi, edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x2c]
add eax, 1
mov dword [ebp - 0x24], eax
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov dword [ebp - 0x28], eax
jmp 0x4015c7
lea ecx, [ebx + 1]
cmp edi, ecx
jl 0x401600
lea eax, [edi + ecx]
mov dword [ebp - 0x1c], ecx
mov ebx, eax
shr ebx, 0x1f
add ebx, eax
sar ebx, 1
mov esi, ebx
shl esi, 4
add esi, dword [ebp - 0x20]
lea eax, [esi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
mov eax, dword [ebp - 0x28]
call eax
test eax, eax
mov ecx, dword [ebp - 0x1c]
je 0x401620
jns 0x4015c0
lea edi, [ebx - 1]
cmp edi, ecx
jge 0x4015c7
mov edx, dword [ebp - 0x2c]
movzx eax, byte [0x402014]
cmp byte [edx], 0
js 0x401732
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
movzx eax, byte [esi]
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp], str.WINEDEBUG
call dword [sym.imp.ucrtbase.dll_getenv]
test eax, eax
mov dword [0x402010], 0
je 0x401600
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
test eax, eax
mov dword [ebp - 0x34], eax
mov ebx, dword [ebp - 0x34]
je 0x401727
mov dword [esp + 4], 0x2c
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
mov dword [ebp - 0x1c], 0
je 0x401687
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x1c], edx
mov dword [esp + 4], 0x403060
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strcspn]
lea edi, [ebx + eax]
mov dword [ebp - 0x20], eax
movzx edx, byte [edi]
test dl, dl
je 0x401740
cmp edi, ebx
jbe 0x401820
mov dword [ebp - 0x24], edi
mov edi, dword [ebp - 0x20]
mov eax, 5
mov ecx, str.fixme
xor esi, esi
mov dword [ebp - 0x20], ebx
mov byte [ebp - 0x28], dl
mov ebx, ecx
cmp edi, eax
jne 0x4016ea
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym._memcmp
test eax, eax
je 0x401892
add esi, 1
cmp esi, 4
je 0x401710
mov ebx, dword [esi*4 + 0x4030e4]
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
cmp edi, eax
je 0x4016cf
add esi, 1
cmp esi, 4
jne 0x4016f2
nop
mov ebx, dword [ebp - 0x1c]
test ebx, ebx
jne 0x401662
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
mov edx, dword [0x402010]
jmp 0x401598
mov byte [edx], al
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
movzx edx, byte [ebx]
cmp dl, 0x2d
je 0x401781
lea eax, [edx - 0x2b]
mov byte [ebp - 0x24], 0xff
mov byte [ebp - 0x20], 0
test al, 0xfd
je 0x401789
test dl, dl
je 0x401710
mov edi, 0x403063
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x401794
movzx eax, byte [ebp - 0x20]
not eax
and al, byte [0x402014]
or al, byte [ebp - 0x24]
mov byte [0x402014], al
jmp 0x401710
mov byte [ebp - 0x20], 0xff
mov byte [ebp - 0x24], 0
mov edi, ebx
lea ebx, [edi + 1]
movzx edx, byte [edi + 1]
jmp 0x401757
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
cmp eax, 0xe
mov dword [ebp - 0x40], eax
ja 0x401710
mov eax, dword [0x402010]
mov edx, dword [0x404088]
mov dword [ebp - 0x44], eax
sub eax, 1
mov dword [ebp - 0x30], edx
mov edx, eax
js 0x401827
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
xor edi, edi
mov dword [ebp - 0x38], ebx
mov ecx, edi
mov edi, edx
mov dword [ebp - 0x3c], eax
jmp 0x4017df
lea ecx, [esi + 1]
cmp ecx, edi
jg 0x4018d2
lea eax, [edi + ecx]
mov dword [ebp - 0x28], ecx
mov esi, eax
shr esi, 0x1f
add esi, eax
sar esi, 1
mov ebx, esi
shl ebx, 4
add ebx, dword [ebp - 0x30]
lea eax, [ebx + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
test eax, eax
mov ecx, dword [ebp - 0x28]
je 0x4018c0
jns 0x4017d4
lea edi, [esi - 1]
jmp 0x4017d7
mov ebx, edi
jmp 0x401743
xor esi, esi
mov dword [ebp - 0x28], 0
xor edi, edi
mov eax, dword [0x40408c]
cmp dword [ebp - 0x44], eax
jge 0x401963
add esi, dword [ebp - 0x30]
cmp edi, dword [ebp - 0x44]
jl 0x401939
mov edx, dword [ebp - 0x40]
lea eax, [esi + 1]
add edx, 1
cmp edx, 4
jae 0x4018e4
test edx, edx
je 0x401871
movzx ecx, byte [ebx]
test dl, 2
mov byte [esi + 1], cl
jne 0x4019e7
movzx eax, byte [ebp - 0x20]
not eax
and al, byte [0x402014]
or al, byte [ebp - 0x24]
mov byte [esi], al
mov eax, dword [ebp - 0x44]
add eax, 1
mov dword [0x402010], eax
jmp 0x401710
movzx edx, byte [ebp - 0x28]
mov eax, 1
mov ecx, esi
shl eax, cl
mov edi, dword [ebp - 0x24]
mov byte [ebp - 0x20], al
cmp dl, 0x2b
je 0x401922
lea ebx, [edx - 0x2b]
and ebx, 0xfd
je 0x401930
mov ebx, edi
mov byte [ebp - 0x24], 0
jmp 0x40175b
movzx eax, byte [ebp - 0x20]
not eax
and al, byte [ebx]
or al, byte [ebp - 0x24]
mov byte [ebx], al
jmp 0x401710
mov esi, ecx
mov ebx, dword [ebp - 0x38]
mov edi, ecx
mov dword [ebp - 0x28], ecx
shl esi, 4
jmp 0x401832
mov ecx, dword [ebx]
mov dword [esi + 1], ecx
mov ecx, dword [ebx + edx - 4]
mov dword [eax + edx - 4], ecx
lea ecx, [esi + 5]
and ecx, 0xfffffffc
sub eax, ecx
sub ebx, eax
add eax, edx
and eax, 0xfffffffc
cmp eax, 4
jb 0x401871
and eax, 0xfffffffc
mov edx, eax
xor eax, eax
mov edi, dword [ebx + eax]
mov dword [ecx + eax], edi
add eax, 4
cmp eax, edx
jb 0x401910
jmp 0x401871
mov ebx, edi
mov byte [ebp - 0x24], al
mov byte [ebp - 0x20], 0
jmp 0x401789
mov byte [ebp - 0x24], 0
jmp 0x40178b
mov eax, dword [ebp - 0x44]
mov dword [esp + 4], esi
sub eax, edi
shl eax, 4
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x28]
add eax, 1
shl eax, 4
add eax, dword [ebp - 0x30]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memmove]
jmp 0x40184c
add eax, eax
mov edx, 0x10
mov ecx, dword [ebp - 0x30]
cmp eax, 0x10
cmovl eax, edx
mov dword [0x40408c], eax
shl eax, 4
mov edx, eax
mov eax, dword fs:[0x18]
test ecx, ecx
je 0x4019c4
mov dword [esp + 0xc], edx
mov edx, dword [ebp - 0x30]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
mov dword [0x404088], eax
mov eax, dword [0x402010]
mov dword [ebp - 0x44], eax
jmp 0x401840
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov dword [ebp - 0x30], eax
jmp 0x4019af
movzx ecx, word [ebx + edx - 2]
mov word [eax + edx - 2], cx
jmp 0x401871