Function at 0x401700
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov esi, dword [0x404014]
cmp esi, 0xffffffff
je 0x4017b4
sub esi, 1
js 0x401772
mov eax, dword [0x4060a8]
xor edi, edi
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp - 0x24], eax
jmp 0x401739
lea edi, [edx + 1]
cmp edi, esi
jg 0x401772
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
call sym._strcmp
test eax, eax
mov edx, dword [ebp - 0x1c]
je 0x401790
jns 0x401732
lea esi, [edx - 1]
cmp edi, esi
jle 0x401739
mov eax, dword [ebp + 8]
cmp byte [eax], 0
js 0x4017a0
movzx eax, byte [0x404018]
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 [0x404018]
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 [0x404014], 0
je 0x401772
mov dword [esp], eax
call sym.__strdup
mov ecx, dword fs:[0x18]
test eax, eax
mov dword [ebp - 0x3c], eax
mov edi, eax
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x48], ecx
je 0x4018ee
mov dword [esp + 4], 0x2c
mov dword [esp], edi
call sym._strchr
test eax, eax
je 0x401960
lea ecx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x24], ecx
mov dword [esp + 4], 0x405416
mov dword [esp], edi
call sym._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 0x401900
cmp ecx, edi
jbe 0x401909
mov eax, 5
mov edx, str.fixme
xor ebx, ebx
cmp esi, eax
mov dword [ebp - 0x38], edi
mov edi, edx
je 0x40187b
lea esi, [esi]
lea edi, [edi]
add ebx, 1
cmp ebx, 4
je 0x4018d8
mov edi, dword [ebx*4 + 0x40549c]
mov dword [esp], edi
call sym._strlen
cmp esi, eax
jne 0x401860
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], eax
call sym._memcmp
test eax, eax
jne 0x401860
mov eax, 1
mov ecx, ebx
shl eax, cl
cmp byte [ebp - 0x20], 0x2b
je 0x401a66
movzx esi, byte [ebp - 0x20]
xor ebx, ebx
mov dword [ebp - 0x38], eax
sub esi, 0x2b
and esi, 0xfd
jne 0x401927
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 0x401927
mov edi, dword [ebp - 0x24]
test edi, edi
jne 0x4017f0
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sym._free
mov esi, dword [0x404014]
jmp 0x401718
movzx eax, byte [edi]
mov dword [ebp - 0x1c], edi
mov byte [ebp - 0x20], al
movzx eax, byte [ebp - 0x20]
cmp al, 0x2d
je 0x401970
sub eax, 0x2b
mov ebx, 0xffffffff
mov byte [ebp - 0x38], 0
test al, 0xfd
je 0x4018c0
cmp byte [ebp - 0x20], 0
je 0x4018d8
mov esi, dword [ebp - 0x1c]
mov edi, 0x405419
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
jne 0x401980
movzx eax, byte [ebp - 0x38]
mov edi, dword [ebp - 0x24]
not eax
and al, byte [0x404018]
or ebx, eax
test edi, edi
mov byte [0x404018], bl
jne 0x4017f0
jmp 0x4018e3
mov dword [ebp - 0x24], 0
jmp 0x401811
mov byte [ebp - 0x38], 0xff
xor ebx, ebx
jmp 0x4018c0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._strlen
cmp eax, 0xe
ja 0x4018d8
mov eax, dword [0x404014]
mov ecx, dword [0x4060a8]
xor edx, edx
mov dword [ebp - 0x28], ecx
mov ecx, eax
mov dword [ebp - 0x40], eax
sub ecx, 1
js 0x401af7
mov byte [ebp - 0x49], bl
mov ebx, ecx
jmp 0x4019c7
lea edx, [esi + 1]
cmp ebx, edx
jl 0x4019fe
lea eax, [ebx + edx]
mov dword [ebp - 0x20], edx
mov esi, eax
shr esi, 0x1f
add esi, eax
sar esi, 1
mov edi, esi
shl edi, 4
add edi, dword [ebp - 0x28]
lea eax, [edi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._strcmp
test eax, eax
mov edx, dword [ebp - 0x20]
je 0x401a51
jns 0x4019c0
lea ebx, [esi - 1]
jmp 0x4019c3
movzx ebx, byte [ebp - 0x49]
mov esi, edx
mov edi, edx
shl esi, 4
mov eax, dword [0x4060ac]
cmp dword [ebp - 0x40], eax
jge 0x401a98
cmp edx, dword [ebp - 0x40]
jl 0x401a71
add esi, dword [ebp - 0x28]
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
lea eax, [esi + 1]
mov dword [esp], eax
call sym._strcpy
movzx eax, byte [ebp - 0x38]
not eax
and al, byte [0x404018]
or ebx, eax
mov eax, dword [ebp - 0x40]
mov byte [esi], bl
add eax, 1
mov dword [0x404014], eax
jmp 0x4018d8
movzx eax, byte [ebp - 0x38]
movzx ebx, byte [ebp - 0x49]
not eax
and al, byte [edi]
or ebx, eax
mov byte [edi], bl
jmp 0x4018d8
mov ebx, eax
mov byte [ebp - 0x38], 0
jmp 0x4018c0
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x28]
sub eax, edx
add esi, ecx
shl eax, 4
mov dword [esp + 4], esi
mov dword [esp + 8], eax
lea eax, [edi + 1]
shl eax, 4
add eax, ecx
mov dword [esp], eax
call sym._memmove
jmp 0x401a1f
add eax, eax
mov ecx, 0x10
mov dword [ebp - 0x20], edx
cmp eax, 0x10
cmovl eax, ecx
mov ecx, dword [ebp - 0x28]
mov dword [0x4060ac], eax
shl eax, 4
test ecx, ecx
je 0x401b00
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sym._HeapReAlloc_16
mov edx, dword [ebp - 0x20]
sub esp, 0x10
mov ecx, dword [0x404014]
mov dword [0x4060a8], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x40], ecx
jmp 0x401a17
xor esi, esi
xor edi, edi
jmp 0x401a09
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x48]
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sym._HeapAlloc_12
mov edx, dword [ebp - 0x20]
sub esp, 0xc
jmp 0x401ae1