Function at 0x401580
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 esi, dword [0x403010]
mov eax, dword [ecx]
cmp esi, 0xffffffff
mov dword [ebp - 0x2c], eax
je 0x401660
dec esi
js 0x40160d
mov eax, dword [ebp - 0x2c]
mov edx, esi
xor edi, edi
mov ecx, dword [0x4060a8]
inc eax
mov dword [ebp - 0x20], eax
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov esi, ecx
mov dword [ebp - 0x24], eax
jmp 0x4015d7
lea edi, [ebx + 1]
cmp edi, edx
jg 0x40160d
mov dword [ebp - 0x1c], edx
lea ebx, [edx + edi]
sar ebx, 1
mov eax, ebx
shl eax, 4
lea ecx, [esi + eax]
mov dword [ebp - 0x28], ecx
lea eax, [esi + eax + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
mov eax, dword [ebp - 0x24]
call eax
mov edx, dword [ebp - 0x1c]
test eax, eax
je 0x401648
jns 0x4015d0
lea edx, [ebx - 1]
cmp edi, edx
jle 0x4015d7
mov esi, dword [ebp - 0x2c]
movzx eax, byte [0x403014]
cmp byte [esi], 0
js 0x401630
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov esi, dword [ebp - 0x2c]
mov byte [esi], al
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov eax, dword [ebp - 0x28]
movzx eax, byte [eax]
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]
xor edx, edx
mov dword [0x403010], edx
test eax, eax
je 0x40160d
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
mov dword [ebp - 0x3c], eax
test eax, eax
je 0x401877
mov ebx, dword [ebp - 0x3c]
mov dword [esp], ebx
mov edi, 0x2c
mov dword [esp + 4], edi
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x4017b0
mov byte [eax], 0
lea ecx, [eax + 1]
mov dword [ebp - 0x1c], ecx
mov dword [esp], ebx
mov esi, 0x404254
mov dword [esp + 4], esi
call dword [sym.imp.ucrtbase.dll_strcspn]
lea edi, [ebx + eax]
mov esi, eax
movzx edx, byte [edi]
test dl, dl
je 0x401758
cmp edi, ebx
jbe 0x4017d8
mov byte [ebp - 0x24], dl
mov eax, 5
xor ecx, ecx
cmp esi, eax
jne 0x401710
mov dword [esp + 8], esi
mov eax, dword [ecx*4 + 0x4042e0]
mov dword [esp], ebx
mov dword [ebp - 0x20], ecx
mov dword [esp + 4], eax
call sym._memcmp
mov ecx, dword [ebp - 0x20]
test eax, eax
je 0x4018fb
inc ecx
cmp ecx, 4
je 0x401740
mov dword [ebp - 0x20], ecx
mov eax, dword [ecx*4 + 0x4042e0]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strlen]
mov ecx, dword [ebp - 0x20]
cmp esi, eax
je 0x4016eb
inc ecx
cmp ecx, 4
jne 0x401716
lea esi, [esi]
lea edi, [edi]
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x40186b
mov ebx, dword [ebp - 0x1c]
jmp 0x401690
movzx edx, byte [ebx]
cmp dl, 0x2d
je 0x4017c0
mov al, dl
sub al, 0x2b
and al, 0xfd
mov byte [ebp - 0x20], al
je 0x4017e0
mov byte [ebp - 0x28], 0xff
mov byte [ebp - 0x20], 0
test dl, dl
je 0x401740
mov edi, 0x404257
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x4017f0
movzx eax, byte [ebp - 0x20]
movzx edx, byte [0x403014]
movzx ecx, byte [ebp - 0x28]
not al
and al, dl
or al, cl
mov byte [0x403014], al
jmp 0x401740
mov dword [ebp - 0x1c], 0
jmp 0x4016b3
mov byte [ebp - 0x20], 0xff
mov byte [ebp - 0x28], 0
mov edi, ebx
movzx edx, byte [edi + 1]
lea ebx, [edi + 1]
jmp 0x401773
mov ebx, edi
jmp 0x40175b
mov byte [ebp - 0x28], 0xff
mov edi, ebx
jmp 0x4017ca
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
cmp eax, 0xe
ja 0x401740
mov eax, dword [0x403010]
mov edi, dword [0x4060a8]
mov dword [ebp - 0x40], eax
mov ecx, eax
dec ecx
js 0x4019c3
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov edx, edi
xor esi, esi
mov dword [ebp - 0x30], ebx
mov edi, ecx
mov dword [ebp - 0x34], eax
jmp 0x401837
lea esi, [ebx + 1]
cmp esi, edi
jg 0x40189d
mov dword [ebp - 0x24], edx
lea ebx, [edi + esi]
sar ebx, 1
mov eax, ebx
shl eax, 4
lea ecx, [edx + eax]
mov dword [ebp - 0x38], ecx
lea eax, [edx + eax + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [ebp - 0x34]
call eax
mov edx, dword [ebp - 0x24]
test eax, eax
je 0x401882
jns 0x401830
lea edi, [ebx - 1]
jmp 0x401833
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
mov esi, dword [0x403010]
jmp 0x4015a8
mov esi, dword [ebp - 0x38]
movzx eax, byte [ebp - 0x20]
movzx ebx, byte [ebp - 0x28]
movzx ecx, byte [esi]
not al
and al, cl
or al, bl
mov byte [esi], al
jmp 0x401740
mov ebx, dword [ebp - 0x30]
mov ecx, esi
mov edi, edx
mov dword [ebp - 0x24], esi
shl ecx, 4
mov eax, dword [0x4060ac]
cmp dword [ebp - 0x40], eax
jge 0x401959
cmp esi, dword [ebp - 0x40]
lea edx, [edi + ecx]
jl 0x40192c
mov dword [esp + 4], ebx
lea eax, [edx + 1]
mov dword [esp], eax
mov dword [ebp - 0x24], edx
call dword [sym.imp.ucrtbase.dll_strcpy]
movzx eax, byte [ebp - 0x20]
movzx edx, byte [0x403014]
movzx ecx, byte [ebp - 0x28]
not al
and al, dl
mov edx, dword [ebp - 0x24]
or al, cl
mov byte [edx], al
mov eax, dword [ebp - 0x40]
inc eax
mov dword [0x403010], eax
jmp 0x401740
movzx edx, byte [ebp - 0x24]
mov eax, 1
shl eax, cl
mov byte [ebp - 0x20], al
cmp dl, 0x2b
je 0x4019b5
sub dl, 0x2b
and dl, 0xfd
mov byte [ebp - 0x28], dl
je 0x4017ca
mov byte [ebp - 0x28], 0
mov ebx, edi
jmp 0x401777
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x30], edx
sub eax, esi
shl eax, 4
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x24]
inc eax
shl eax, 4
add eax, edi
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memmove]
mov edx, dword [ebp - 0x30]
jmp 0x4018c0
mov dword [ebp - 0x30], ecx
add eax, eax
mov edx, 0x10
cmp eax, 0x10
cmovl eax, edx
mov dword [0x4060ac], eax
shl eax, 4
mov edx, eax
mov eax, dword fs:[0x18]
test edi, edi
je 0x4019d3
mov dword [esp + 8], edi
xor edi, edi
mov dword [esp + 4], edi
mov dword [esp + 0xc], edx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov ecx, dword [ebp - 0x30]
sub esp, 0x10
mov edi, eax
mov dword [0x4060a8], edi
mov eax, dword [0x403010]
mov dword [ebp - 0x40], eax
jmp 0x4018b8
mov byte [ebp - 0x28], al
mov ebx, edi
mov byte [ebp - 0x20], 0
jmp 0x4017c8
mov dword [ebp - 0x24], 0
xor ecx, ecx
xor esi, esi
jmp 0x4018aa
mov dword [esp + 8], edx
xor edx, edx
mov dword [esp + 4], edx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x30]
sub esp, 0xc
mov edi, eax
jmp 0x4019a2