Function at 0x4029f3
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
call sub.kernel32.dll_GetLastError
mov dword [ebp - 0x14], eax
cmp dword [0x405038], 0xffffffff
je 0x402a15
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [0x405038], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.DEBUGCHANNEL
call sub.kernel32.dll_GetEnvironmentVariableA
sub esp, 0xc
mov ebx, eax
test eax, eax
jne 0x402a7d
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.DEBUGFORMAT
call sub.kernel32.dll_GetEnvironmentVariableA
sub esp, 0xc
mov esi, eax
test eax, eax
jne 0x402d73
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sub.kernel32.dll_SetLastError
sub esp, 4
jmp 0x402a0d
mov dword [esp], eax
call fcn.00402909
mov dword [ebp - 0x28], eax
test eax, eax
je 0x402a44
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str.DEBUGCHANNEL
call sub.kernel32.dll_GetEnvironmentVariableA
sub esp, 0xc
cmp eax, ebx
jb 0x402ab7
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.kernel32.dll_LocalFree
sub esp, 4
jmp 0x402a44
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call fcn.004029b1
mov dword [ebp - 0x30], eax
test eax, eax
je 0x402aa7
mov dword [ebp - 0x18], eax
jmp 0x402beb
mov eax, 1
mov ecx, ebx
shl eax, cl
mov dword [ebp - 0x24], eax
cmp ebx, 4
je 0x402bdd
mov dword [ebp - 0x18], esi
mov byte [ebp - 0x20], 0
jmp 0x402ba1
add ebx, 1
cmp ebx, 4
je 0x402bdd
mov edx, dword [ebx*4 + 0x406650]
mov ecx, 0xffffffff
mov edi, edx
mov eax, 0
repne scasb al, byte es:[edi]
not ecx
sub ecx, 1
cmp esi, ecx
jne 0x402af2
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x402af2
mov esi, dword [ebp - 0x24]
cmp byte [ebp - 0x20], 0x2b
je 0x402ad1
mov eax, 1
mov ecx, ebx
shl eax, cl
mov dword [ebp - 0x20], eax
cmp ebx, 4
je 0x402bdd
movzx eax, byte [esi]
sub eax, 0x2b
and eax, 0xfd
mov byte [ebp - 0x24], al
je 0x402c4e
mov dword [ebp - 0x18], esi
mov byte [ebp - 0x24], 0
jmp 0x402bad
mov dword [ebp - 0x18], esi
mov eax, dword [ebp - 0x18]
cmp byte [eax], 0x2d
je 0x402b99
movzx eax, byte [eax]
sub eax, 0x2b
and eax, 0xfd
mov byte [ebp - 0x20], al
je 0x402b93
mov byte [ebp - 0x24], 0xff
mov byte [ebp - 0x20], 0
jmp 0x402ba5
mov byte [ebp - 0x24], 0xff
jmp 0x402ba1
mov byte [ebp - 0x24], 0
mov byte [ebp - 0x20], 0xff
add dword [ebp - 0x18], 1
mov eax, dword [ebp - 0x18]
cmp byte [eax], 0
je 0x402bdd
mov edi, 0x4065c3
mov ecx, 4
mov esi, dword [ebp - 0x18]
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x402c56
movzx eax, byte [ebp - 0x20]
not eax
and al, byte [0x40503c]
or al, byte [ebp - 0x24]
mov byte [0x40503c], al
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x402d60
mov dword [esp + 4], 0x2c
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x402c0e
lea edx, [eax + 1]
mov dword [ebp - 0x1c], edx
mov byte [eax], 0
mov dword [esp + 4], 0x4065c0
mov edi, dword [ebp - 0x18]
mov dword [esp], edi
call sub.msvcrt.dll_strcspn
mov edx, edi
mov esi, edi
mov edi, eax
add esi, eax
movzx eax, byte [esi]
mov byte [ebp - 0x20], al
test al, al
je 0x402b71
cmp esi, edx
jbe 0x402b6e
mov ebx, 0
mov dword [ebp - 0x24], esi
mov esi, edi
jmp 0x402afe
mov dword [ebp - 0x18], esi
jmp 0x402ba1
mov ecx, 0xffffffff
mov edi, dword [ebp - 0x18]
mov eax, 0
repne scasb al, byte es:[edi]
not ecx
sub ecx, 1
cmp ecx, 0xe
ja 0x402bdd
mov eax, dword [0x405038]
mov dword [ebp - 0x34], eax
mov esi, eax
sub esi, 1
js 0x402ce2
mov edi, 0
jmp 0x402caf
mov eax, ebx
shl eax, 4
movzx edx, byte [ebp - 0x20]
not edx
and dl, byte [eax + 0x4070c0]
or dl, byte [ebp - 0x24]
mov byte [eax + 0x4070c0], dl
jmp 0x402bdd
lea esi, [ebx - 1]
cmp esi, edi
jl 0x402ce7
lea eax, [edi + esi]
mov ebx, eax
shr ebx, 0x1f
add ebx, eax
sar ebx, 1
mov dword [ebp - 0x2c], ebx
mov eax, ebx
shl eax, 4
add eax, 0x4070c1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x402c89
js 0x402ca8
lea edi, [ebx + 1]
jmp 0x402cab
mov edi, 0
mov eax, dword [ebp - 0x34]
cmp eax, 0xff
jg 0x402bdd
cmp eax, edi
jg 0x402d36
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
shl edi, 4
lea eax, [edi + 0x4070c1]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
movzx eax, byte [ebp - 0x20]
not eax
and al, byte [0x40503c]
or al, byte [ebp - 0x24]
mov byte [edi + 0x4070c0], al
mov eax, dword [ebp - 0x34]
add eax, 1
mov dword [0x405038], eax
jmp 0x402bdd
mov eax, edi
shl eax, 4
mov edx, dword [ebp - 0x34]
sub edx, edi
shl edx, 4
mov dword [esp + 8], edx
lea edx, [eax + 0x4070c0]
mov dword [esp + 4], edx
add eax, 0x4070d0
mov dword [esp], eax
call sub.msvcrt.dll_memmove
jmp 0x402cf9
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.kernel32.dll_LocalFree
sub esp, 4
jmp 0x402aa7
mov dword [esp], eax
call fcn.00402909
mov ebx, eax
test eax, eax
je 0x402a6d
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], str.DEBUGFORMAT
call sub.kernel32.dll_GetEnvironmentVariableA
sub esp, 0xc
cmp eax, esi
jae 0x402dc1
mov edi, str.wine
mov ecx, 5
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x402dd1
mov dword [0x405034], 0x4030c0
mov dword [esp], ebx
call sub.kernel32.dll_LocalFree
sub esp, 4
jmp 0x402a6d
mov edi, str.extended
mov ecx, 9
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
je 0x402dff
mov edi, 0x4065e1
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x402e0b
mov dword [0x405034], 0x402f67
jmp 0x402dc1
mov dword [0x405034], 0x402e87
jmp 0x402dc1