Function at 0x401d30
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov esi, dword [0x403010]
cmp esi, 0xffffffff
je 0x401df4
sub esi, 1
js 0x401db0
mov eax, dword [0x405088]
xor edi, edi
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp - 0x24], eax
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov dword [ebp - 0x38], eax
jmp 0x401d77
lea edi, [edx + 1]
cmp edi, esi
jg 0x401db0
lea eax, [esi + edi]
mov edx, eax
shr edx, 0x1f
add edx, eax
sar edx, 1
mov ebx, edx
mov dword [ebp - 0x1c], edx
shl ebx, 4
add ebx, dword [ebp - 0x20]
lea eax, [ebx + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
call eax
test eax, eax
mov edx, dword [ebp - 0x1c]
je 0x401dd0
jns 0x401d70
lea esi, [edx - 1]
cmp edi, esi
jle 0x401d77
mov eax, dword [ebp + 8]
cmp byte [eax], 0
js 0x401de0
movzx eax, byte [0x403014]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [ebx]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [0x403014]
mov ecx, dword [ebp + 8]
mov byte [ecx], al
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.WINEDEBUG
call sym._getenv
test eax, eax
mov dword [0x403010], 0
je 0x401db0
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
test eax, eax
mov dword [ebp - 0x50], eax
mov edi, eax
je 0x401f1e
mov dword [esp + 4], 0x2c
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x401f90
lea ecx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x24], ecx
mov dword [esp + 4], 0x40417a
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strcspn]
mov esi, eax
lea eax, [edi + eax]
mov ecx, eax
mov dword [ebp - 0x1c], eax
movzx eax, byte [eax]
test al, al
mov byte [ebp - 0x20], al
je 0x401f30
cmp ecx, edi
jbe 0x401f39
mov eax, 5
mov edx, str.fixme
xor ebx, ebx
cmp esi, eax
mov dword [ebp - 0x38], edi
mov edi, edx
je 0x401eac
lea esi, [esi]
add ebx, 1
cmp ebx, 4
je 0x401f08
mov edi, dword [ebx*4 + 0x404200]
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strlen]
cmp esi, eax
jne 0x401e90
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memcmp]
test eax, eax
jne 0x401e90
mov eax, 1
mov ecx, ebx
shl eax, cl
cmp byte [ebp - 0x20], 0x2b
je 0x402095
movzx esi, byte [ebp - 0x20]
mov dword [ebp - 0x48], eax
mov byte [ebp - 0x38], 0
sub esi, 0x2b
and esi, 0xfd
jne 0x401f56
lea esi, [esi]
mov ecx, dword [ebp - 0x1c]
movzx eax, byte [ecx + 1]
mov byte [ebp - 0x20], al
mov eax, ecx
add eax, 1
cmp byte [ebp - 0x20], 0
mov dword [ebp - 0x1c], eax
jne 0x401f56
mov edi, dword [ebp - 0x24]
test edi, edi
jne 0x401e24
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call sym._free
mov esi, dword [0x403010]
jmp 0x401d48
movzx eax, byte [edi]
mov dword [ebp - 0x1c], edi
mov byte [ebp - 0x20], al
movzx eax, byte [ebp - 0x20]
cmp al, 0x2d
je 0x401fa0
sub eax, 0x2b
mov byte [ebp - 0x38], 0xff
mov byte [ebp - 0x48], 0
test al, 0xfd
je 0x401ef0
cmp byte [ebp - 0x20], 0
je 0x401f08
mov esi, dword [ebp - 0x1c]
mov edi, 0x40417d
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
jne 0x401fb0
movzx eax, byte [ebp - 0x48]
mov edi, dword [ebp - 0x24]
not eax
and al, byte [0x403014]
or al, byte [ebp - 0x38]
test edi, edi
mov byte [0x403014], al
jne 0x401e24
jmp 0x401f13
mov dword [ebp - 0x24], 0
jmp 0x401e46
mov byte [ebp - 0x48], 0xff
mov byte [ebp - 0x38], 0
jmp 0x401ef0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strlen]
cmp eax, 0xe
ja 0x401f08
mov ecx, dword [0x405088]
mov eax, dword [0x403010]
xor esi, esi
mov dword [ebp - 0x28], ecx
mov ecx, dword [sym.imp.ucrtbase.dll_strcmp]
mov edx, eax
sub edx, 1
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x4c], ecx
js 0x402126
mov ecx, esi
mov esi, edx
jmp 0x401ff9
lea ecx, [edi + 1]
cmp esi, ecx
jl 0x402030
lea eax, [esi + ecx]
mov dword [ebp - 0x20], ecx
mov edi, eax
shr edi, 0x1f
add edi, eax
sar edi, 1
mov ebx, edi
shl ebx, 4
add ebx, dword [ebp - 0x28]
lea eax, [ebx + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [ebp - 0x4c]
call eax
test eax, eax
mov ecx, dword [ebp - 0x20]
je 0x402083
jns 0x401ff2
lea esi, [edi - 1]
jmp 0x401ff5
mov ebx, ecx
mov esi, ecx
mov edi, ecx
shl ebx, 4
mov eax, dword [0x40508c]
cmp dword [ebp - 0x54], eax
jge 0x4020c9
cmp esi, dword [ebp - 0x54]
jl 0x4020a1
add ebx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
lea eax, [ebx + 1]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strcpy]
movzx eax, byte [ebp - 0x48]
not eax
and al, byte [0x403014]
or al, byte [ebp - 0x38]
mov byte [ebx], al
mov eax, dword [ebp - 0x54]
add eax, 1
mov dword [0x403010], eax
jmp 0x401f08
movzx eax, byte [ebp - 0x48]
not eax
and al, byte [ebx]
or al, byte [ebp - 0x38]
mov byte [ebx], al
jmp 0x401f08
mov dword [ebp - 0x38], eax
mov byte [ebp - 0x48], 0
jmp 0x401ef0
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x28]
sub eax, esi
add ebx, ecx
shl eax, 4
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
lea eax, [edi + 1]
shl eax, 4
add eax, ecx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memmove]
jmp 0x40204f
add eax, eax
mov ecx, dword [ebp - 0x28]
mov edx, 0x10
cmp eax, 0x10
cmovl eax, edx
mov dword [0x40508c], eax
shl eax, 4
mov edx, dword fs:[0x18]
test ecx, ecx
je 0x40212f
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sym._HeapReAlloc_16
sub esp, 0x10
mov ecx, dword [0x403010]
mov dword [0x405088], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x54], ecx
jmp 0x402047
xor ebx, ebx
xor edi, edi
jmp 0x402039
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sym._HeapAlloc_12
sub esp, 0xc
jmp 0x402110