Function at 0x402c40
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov edx, dword [0x405014]
cmp edx, 0xffffffff
je 0x402cf0
sub edx, 1
js 0x402cb9
mov eax, dword [0x4070a8]
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 0x402c87
lea ecx, [ebx + 1]
cmp ecx, edi
jg 0x402cb9
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 0x402ce0
jns 0x402c80
lea edi, [ebx - 1]
cmp ecx, edi
jle 0x402c87
mov edx, dword [ebp + 8]
movzx eax, byte [0x405018]
cmp byte [edx], 0
js 0x402cd0
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 sym._getenv
mov dword [0x405014], 0
test eax, eax
je 0x402cb9
mov dword [esp], eax
call sym.__strdup
mov dword [ebp - 0x38], eax
test eax, eax
je 0x402de9
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], 0x2c
mov dword [esp], eax
call sym._strchr
mov dword [ebp - 0x20], 0
test eax, eax
je 0x402d47
lea edx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x20], edx
mov edi, dword [ebp - 0x1c]
mov dword [esp + 4], 0x406376
mov dword [esp], edi
call sym._strcspn
mov edx, eax
lea esi, [edi + edx]
movzx ebx, byte [esi]
test bl, bl
je 0x402df4
cmp esi, edi
jbe 0x402e70
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 0x402da9
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call sym._memcmp
test eax, eax
je 0x402f5b
add esi, 1
cmp esi, 4
je 0x402dd0
mov edi, dword [esi*4 + 0x4063fc]
mov dword [esp], edi
call sym._strlen
cmp ebx, eax
je 0x402d8e
add esi, 1
cmp esi, 4
jne 0x402db1
lea esi, [esi]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x402d20
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._free
mov edx, dword [0x405014]
jmp 0x402c58
mov eax, dword [ebp - 0x1c]
movzx ebx, byte [eax]
cmp bl, 0x2d
je 0x402e50
lea eax, [ebx - 0x2b]
and eax, 0xfd
mov byte [ebp - 0x24], al
je 0x402e75
mov byte [ebp - 0x29], 0xff
mov byte [ebp - 0x24], 0
test bl, bl
je 0x402dd0
mov esi, dword [ebp - 0x1c]
mov edi, 0x406379
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x402e80
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [0x405018]
or al, byte [ebp - 0x29]
mov byte [0x405018], al
jmp 0x402dd0
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 0x402e14
mov dword [ebp - 0x1c], esi
jmp 0x402dfa
mov esi, dword [ebp - 0x1c]
mov byte [ebp - 0x29], 0xff
jmp 0x402e5b
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._strlen
cmp eax, 0xe
ja 0x402dd0
mov eax, dword [0x405014]
mov edx, dword [0x4070a8]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edx
sub eax, 1
js 0x40302b
xor edi, edi
mov ecx, edi
mov edi, eax
jmp 0x402ec7
lea ecx, [ebx + 1]
cmp ecx, edi
jg 0x402f09
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 0x402ef7
jns 0x402ec0
lea edi, [ebx - 1]
jmp 0x402ec3
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [esi]
or al, byte [ebp - 0x29]
mov byte [esi], al
jmp 0x402dd0
mov ebx, ecx
mov edi, ecx
mov esi, ecx
shl ebx, 4
mov eax, dword [0x4070ac]
cmp dword [ebp - 0x34], eax
jge 0x402fbd
add ebx, dword [ebp - 0x30]
cmp edi, dword [ebp - 0x34]
jl 0x402f97
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
lea eax, [ebx + 1]
mov dword [esp], eax
call sym._strcpy
movzx eax, byte [ebp - 0x24]
not eax
and al, byte [0x405018]
or al, byte [ebp - 0x29]
mov byte [ebx], al
mov eax, dword [ebp - 0x34]
add eax, 1
mov dword [0x405014], eax
jmp 0x402dd0
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 0x40301c
sub ebx, 0x2b
and ebx, 0xfd
mov byte [ebp - 0x29], bl
je 0x402e5b
mov dword [ebp - 0x1c], esi
mov byte [ebp - 0x29], 0
jmp 0x402e18
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 sym._memmove
jmp 0x402f28
add eax, eax
mov edx, 0x10
mov ecx, dword [ebp - 0x30]
cmp eax, 0x10
cmovl eax, edx
mov edx, dword fs:[0x18]
mov dword [0x4070ac], eax
shl eax, 4
test ecx, ecx
je 0x403036
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 sym._HeapReAlloc_16
mov dword [ebp - 0x30], eax
sub esp, 0x10
mov eax, dword [ebp - 0x30]
mov dword [0x4070a8], eax
mov eax, dword [0x405014]
mov dword [ebp - 0x34], eax
jmp 0x402f20
mov dword [ebp - 0x1c], esi
mov byte [ebp - 0x29], al
mov byte [ebp - 0x24], 0
jmp 0x402e58
xor ebx, ebx
xor esi, esi
xor edi, edi
jmp 0x402f12
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
mov dword [ebp - 0x30], eax
jmp 0x403007