Function at 0x403bd5
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
push esi
mov eax, dword [ebp + 8]
movsx ecx, byte [eax]
cmp ecx, 0x2f
je 0x403c08
mov edx, dword [ebp + 8]
movsx eax, byte [edx]
cmp eax, 0x5c
je 0x403c08
mov ecx, dword [ebp + 8]
movsx edx, byte [ecx]
test edx, edx
je 0x403c3f
mov eax, dword [ebp + 8]
movsx ecx, byte [eax + 1]
cmp ecx, 0x3a
jne 0x403c3f
mov edx, dword [ebp + 8]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
add eax, 0x14
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f82
mov eax, dword [ebp + 8]
push eax
call fcn.004047fd
add esp, 4
test eax, eax
je 0x403ce2
mov ecx, dword [ebp + 8]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
add eax, 0x7e4
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.MSVCRT.dll__getcwd]
add esp, 8
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x2c]
movsx ecx, byte [eax - 1]
cmp ecx, 0x2f
je 0x403ccd
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x2c]
movsx eax, byte [edx - 1]
cmp eax, 0x5c
je 0x403ccd
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x2c]
mov dl, byte [0x4065bc]
mov byte [ecx], dl
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x2c]
mov byte [eax + 1], 0
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
jmp 0x403f82
push str.PATH
call dword [sym.imp.MSVCRT.dll_getenv]
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x403d00
mov dword [ebp - 4], 0x40663c
mov eax, dword [ebp - 4]
push eax
call sub.MSVCRT.dll_strlen
add esp, 4
add eax, 0x7d2
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp - 0x30], eax
push 0x7d0
mov ecx, dword [ebp - 0x30]
push ecx
call dword [sym.imp.MSVCRT.dll__getcwd]
add esp, 8
mov edx, dword [ebp - 0x30]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x30]
add eax, dword [ebp - 0x2c]
mov cl, byte [0x4065bd]
mov byte [eax], cl
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
lea edx, [ecx + eax + 1]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
mov eax, dword [ebp - 0x30]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x403d77
xor eax, eax
jmp 0x40405f
mov ecx, dword [ebp - 4]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
mov esi, eax
mov edx, dword [ebp + 8]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
lea eax, [esi + eax + 0x7d0]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp - 0x38], eax
mov edx, dword [ebp - 4]
mov dword [ebp - 0x34], edx
cmp dword [ebp - 0x34], 0
je 0x403f82
mov eax, dword [ebp - 0x34]
movsx ecx, byte [eax]
test ecx, ecx
je 0x403f82
movsx edx, byte [0x4065bd]
push edx
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x403df9
mov ecx, dword [ebp - 0x34]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e29
mov eax, dword [ebp - 0x30]
sub eax, dword [ebp - 0x34]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_strncpy]
add esp, 0xc
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x2c]
mov byte [ecx], 0
mov edx, dword [ebp - 0x30]
add edx, 1
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x34], eax
push 0x22
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
test eax, eax
je 0x403ea5
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x44], 0
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x2c]
jae 0x403e9c
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x40]
mov dl, byte [ecx]
mov byte [ebp - 0x3c], dl
mov eax, dword [ebp - 0x40]
add eax, 1
mov dword [ebp - 0x40], eax
movsx ecx, byte [ebp - 0x3c]
cmp ecx, 0x22
jne 0x403e86
jmp 0x403e5f
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x44]
mov al, byte [ebp - 0x3c]
mov byte [edx], al
mov ecx, dword [ebp - 0x44]
add ecx, 1
mov dword [ebp - 0x44], ecx
jmp 0x403e5f
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x44]
mov byte [edx], 0
mov eax, dword [ebp - 0x38]
movsx ecx, byte [eax]
cmp ecx, 0x2e
jne 0x403efc
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
cmp eax, 1
je 0x403eea
mov eax, dword [ebp - 0x38]
push eax
call sub.MSVCRT.dll_strlen
add esp, 4
cmp eax, 2
jne 0x403efc
mov ecx, dword [ebp - 0x38]
movsx edx, byte [ecx + 1]
cmp edx, 0x2f
je 0x403eea
mov eax, dword [ebp - 0x38]
movsx ecx, byte [eax + 1]
cmp ecx, 0x5c
jne 0x403efc
push 0x7d0
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.MSVCRT.dll__getcwd]
add esp, 8
mov eax, dword [ebp - 0x38]
push eax
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x2c]
movsx edx, byte [ecx - 1]
cmp edx, 0x2f
je 0x403f40
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x2c]
movsx ecx, byte [eax - 1]
cmp ecx, 0x5c
je 0x403f40
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x2c]
mov al, byte [0x4065bc]
mov byte [edx], al
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x2c]
mov byte [ecx + 1], 0
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x38]
push eax
call sub.MSVCRT.dll_strcat
add esp, 8
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
jne 0x403f7d
mov eax, dword [ebp - 0x22]
and eax, 0xffff
and eax, 0x8000
test eax, eax
je 0x403f7d
mov dword [ebp - 0x34], 0
jmp 0x403db1
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
jne 0x403fa8
mov eax, dword [ebp - 0x22]
and eax, 0xffff
and eax, 0x8000
test eax, eax
jne 0x403feb
mov ecx, dword [ebp - 0x38]
push ecx
call sub.MSVCRT.dll_strlen
add esp, 4
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 4
jbe 0x403feb
push 0x406590
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x38]
lea ecx, [eax + edx - 4]
push ecx
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
je 0x403feb
push str..exe
mov edx, dword [ebp - 0x38]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
test eax, eax
jne 0x404013
mov edx, dword [ebp - 0x22]
and edx, 0xffff
and edx, 0x8000
test edx, edx
jne 0x40402c
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov dword [ebp - 0x38], 0
mov eax, dword [ebp - 0x38]
jmp 0x40405f
cmp dword [ebp + 0xc], 0
je 0x40405c
mov ecx, dword [ebp - 0x38]
push ecx
call fcn.0040494f
add esp, 4
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x30]
cmp edx, dword [ebp - 0x38]
je 0x40405c
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x38], ecx
mov eax, dword [ebp - 0x38]
pop esi
mov esp, ebp
pop ebp
ret