Function at 0x40d710
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov edx, dword [0x4102a8]
cmp edx, 0xffffffff
je 0x40d7c0
sub edx, 1
js 0x40d789
mov eax, dword [0x41a7c8]
xor edi, edi
mov ecx, edi
mov edi, edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp - 0x24], eax
jmp 0x40d757
lea ecx, [ebx + 1]
cmp ecx, edi
jg 0x40d789
lea ebx, [edi + ecx]
mov dword [ebp - 0x1c], ecx
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
call sym._strcmp
mov ecx, dword [ebp - 0x1c]
test eax, eax
je 0x40d7b0
jns 0x40d750
lea edi, [ebx - 1]
cmp ecx, edi
jle 0x40d757
mov edx, dword [ebp + 8]
movzx eax, byte [0x4102ac]
cmp byte [edx], 0
js 0x40d7a0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp + 8]
mov byte [edx], al
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [esi]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.WINEDEBUG
call sub.msvcrt.dll_getenv
mov dword [0x4102a8], 0
test eax, eax
je 0x40d789
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebp - 0x38], eax
test eax, eax
je 0x40d8b9
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], 0x2c
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov dword [ebp - 0x20], 0
test eax, eax
je 0x40d817
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x20], edx
mov edi, dword [ebp - 0x1c]
mov dword [esp + 4], 0x4175ea
mov dword [esp], edi
call sym._strcspn
mov edx, eax
lea esi, [edi + edx]
movzx ebx, byte [esi]
test bl, bl
je 0x40d8c4
cmp esi, edi
jbe 0x40d940
xor edi, edi
mov ecx, str.fixme
mov byte [ebp - 0x28], bl
mov eax, 5
mov ebx, edx
mov dword [ebp - 0x24], esi
mov esi, edi
mov edi, ecx
cmp ebx, eax
jne 0x40d879
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x40da2b
add esi, 1
cmp esi, 4
je 0x40d8a0
mov edi, dword [esi*4 + 0x417670]
mov dword [esp], edi
call sub.msvcrt.dll_strlen
cmp ebx, eax
je 0x40d85e
add esi, 1
cmp esi, 4
jne 0x40d881
lea esi, [esi]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x40d7f0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._free
mov edx, dword [0x4102a8]
jmp 0x40d728
mov eax, dword [ebp - 0x1c]
movzx ebx, byte [eax]
cmp bl, 0x2d
je 0x40d920
lea eax, [ebx - 0x2b]
and eax, 0xfd
mov byte [ebp - 0x24], al
je 0x40d945
mov byte [ebp - 0x29], 0xff
mov byte [ebp - 0x24], 0
test bl, bl
je 0x40d8a0
mov esi, dword [ebp - 0x1c]
mov edi, 0x4175ed
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x40d950
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [0x4102ac]
or al, byte [ebp - 0x29]
mov byte [0x4102ac], al
jmp 0x40d8a0
mov byte [ebp - 0x24], 0xff
mov byte [ebp - 0x29], 0
mov esi, dword [ebp - 0x1c]
lea eax, [esi + 1]
movzx ebx, byte [esi + 1]
mov dword [ebp - 0x1c], eax
jmp 0x40d8e4
mov dword [ebp - 0x1c], esi
jmp 0x40d8ca
mov esi, dword [ebp - 0x1c]
mov byte [ebp - 0x29], 0xff
jmp 0x40d92b
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp eax, 0xe
ja 0x40d8a0
mov eax, dword [0x4102a8]
mov edx, dword [0x41a7c8]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edx
sub eax, 1
js 0x40dafb
xor edi, edi
mov ecx, edi
mov edi, eax
jmp 0x40d997
lea ecx, [ebx + 1]
cmp ecx, edi
jg 0x40d9d9
lea ebx, [edi + ecx]
mov dword [ebp - 0x28], ecx
sar ebx, 1
mov esi, ebx
shl esi, 4
add esi, dword [ebp - 0x30]
lea eax, [esi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._strcmp
mov ecx, dword [ebp - 0x28]
test eax, eax
je 0x40d9c7
jns 0x40d990
lea edi, [ebx - 1]
jmp 0x40d993
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [esi]
or al, byte [ebp - 0x29]
mov byte [esi], al
jmp 0x40d8a0
mov ebx, ecx
mov edi, ecx
mov esi, ecx
shl ebx, 4
mov eax, dword [0x41a7cc]
cmp dword [ebp - 0x34], eax
jge 0x40da8d
add ebx, dword [ebp - 0x30]
cmp edi, dword [ebp - 0x34]
jl 0x40da67
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
lea eax, [ebx + 1]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [0x4102ac]
or al, byte [ebp - 0x29]
mov byte [ebx], al
mov eax, dword [ebp - 0x34]
add eax, 1
mov dword [0x4102a8], eax
jmp 0x40d8a0
mov edi, esi
mov eax, 1
movzx ebx, byte [ebp - 0x28]
mov esi, dword [ebp - 0x24]
mov ecx, edi
shl eax, cl
mov byte [ebp - 0x24], al
cmp bl, 0x2b
je 0x40daec
sub ebx, 0x2b
and ebx, 0xfd
mov byte [ebp - 0x29], bl
je 0x40d92b
mov dword [ebp - 0x1c], esi
mov byte [ebp - 0x29], 0
jmp 0x40d8e8
mov eax, dword [ebp - 0x34]
mov dword [esp + 4], ebx
sub eax, edi
shl eax, 4
mov dword [esp + 8], eax
lea eax, [esi + 1]
shl eax, 4
add eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_memmove
jmp 0x40d9f8
add eax, eax
mov edx, 0x10
mov ecx, dword [ebp - 0x30]
cmp eax, 0x10
cmovl eax, edx
mov edx, dword fs:[0x18]
mov dword [0x41a7cc], eax
shl eax, 4
test ecx, ecx
je 0x40db06
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
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 sub.kernel32.dll_HeapReAlloc
mov dword [ebp - 0x30], eax
sub esp, 0x10
mov eax, dword [ebp - 0x30]
mov dword [0x41a7c8], eax
mov eax, dword [0x4102a8]
mov dword [ebp - 0x34], eax
jmp 0x40d9f0
mov dword [ebp - 0x1c], esi
mov byte [ebp - 0x29], al
mov byte [ebp - 0x24], 0
jmp 0x40d928
xor ebx, ebx
xor esi, esi
xor edi, edi
jmp 0x40d9e2
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 sub.kernel32.dll_HeapAlloc
sub esp, 0xc
mov dword [ebp - 0x30], eax
jmp 0x40dad7