Function at 0x408968
Capabilities:
Check if file exists
Enumerate files on windows
Get common file path
Get comspec environment variable
Query environment variable

Disassembly:
ret
xchg edx, esi
call fcn.0040c2e4
xchg edx, esi
cmp al, 0xd
je 0x408967
cmp al, 0x7c
je 0x408967
cmp al, 0x2f
je 0x4089db
cmp al, 0x2a
je 0x4089db
cmp al, 0x2e
je 0x4089d5
xchg edx, esi
mov ebx, 0x408f8b
lodsb al, byte [esi]
call fcn.0040c32d
cmp al, byte [ebx]
je 0x4089a5
dec esi
jb 0x4089ce
inc ebx
test byte [ebx - 1], 0x80
je 0x408999
add ebx, 4
jmp 0x40898c
push esi
inc ebx
lodsb al, byte [esi]
call fcn.0040c32d
cmp al, 0x2e
je 0x4089bd
xor al, byte [ebx]
je 0x4089a6
cmp al, 0x80
je 0x4089bd
pop esi
dec esi
jmp 0x408999
pop eax
inc ebx
test byte [ebx - 1], 0x80
je 0x4089be
call fcn.0040c2e4
xchg edx, esi
jmp dword [ebx]
xchg edx, esi
jmp 0x40bd77
inc edx
jmp 0x40be71
inc edx
jmp 0x40bd77
mov edi, dword [0x4131b0]
push edx
xchg dword [0x413444], esp
push 0x7f
push edi
push 0x412888
call sub.KERNEL32.dll_GetEnvironmentVariableA
xchg dword [0x413444], esp
pop edx
add edi, eax
mov eax, 0x20432f20
stosd dword es:[edi], eax
mov ebx, edi
mov al, byte [edx]
inc edx
mov byte [ebx], al
inc bl
je 0x40bdbe
cmp al, 0xd
jne 0x40bda2
dec bl
mov al, byte [ebx - 1]
cmp al, 0x20
je 0x40bdaf
cmp al, 0x3b
je 0x40bdbe
inc bl
dec bl
mov byte [ebx], 0
mov edx, edi
sub esp, 0x10
mov ebp, esp
push eax
sub esp, 0x44
mov ebx, esp
mov edi, esp
mov ecx, 0x11
xor eax, eax
rep stosd dword es:[edi], eax
mov byte [ebx], 0x44
mov byte [ebx + 0x30], 1
call fcn.0040be45
jne 0x40bdfa
mov edx, dword [0x4131b0]
call fcn.0040be45
je 0x40b2af
add esp, 0x44
pop eax
cmp al, 0x3b
je 0x40be27
call fcn.004079fe
jne 0x40be27
mov eax, dword [esp]
xchg dword [0x413444], esp
push 0x64
push eax
call sub.KERNEL32.dll_WaitForSingleObject
xchg dword [0x413444], esp
cmp eax, 0x102
je 0x40be02
pop eax
pop ebx
add esp, 8
xchg dword [0x413444], esp
push eax
push ebx
call sub.KERNEL32.dll_CloseHandle
call sub.KERNEL32.dll_CloseHandle
xchg dword [0x413444], esp
ret
jmp 0x40bd24
call fcn.004055b5
mov ebx, dword [0x4131b0]
call fcn.0040bcab
test ch, 0x40
jne 0x40be8f
cmp bl, 0xff
jae 0x40be6c
mov byte [ebx], 0x2a
inc ebx
test ch, 0x80
jne 0x40bea2
cmp bl, 0xfc
jae 0x40be6c
mov dword [ebx], 0x4342422e
add ebx, 4
mov byte [ebx], 0
call fcn.00402eb8
inc esp
imul esi, dword [edx + 0x65], 0x726f7463
jns 0x40bed4
outsd dx, dword [esi]
and byte [eax], al
or cl, cl
jne 0x40bf05
mov edx, dword [0x413158]
pushal
xchg dword [0x413444], esp
push edx
push 0xff
call sub.KERNEL32.dll_GetCurrentDirectoryA
xchg dword [0x413444], esp
popal
xor ah, ah
mov ebx, dword [0x4131b0]
cmp byte [ebx], 0x5c
jne 0x40beea
mov ah, 0x3a
mov al, byte [edx]
inc edx
or al, al
je 0x40befe
push eax
call fcn.00402dfe
pop eax
cmp al, ah
je 0x40bf05
jmp 0x40beea
mov al, 0x5c
call fcn.00402dfe
mov ebx, dword [0x4131b0]
call fcn.00402ea9
call fcn.00402df5
mov ebx, dword [0x4131b0]
mov edx, dword [0x413158]
push esi
xchg dword [0x413444], esp
push edx
push ebx
call sub.KERNEL32.dll_FindFirstFileA
xchg dword [0x413444], esp
cmp eax, 0xffffffff
mov ebx, eax
pop esi
je 0x40bfa7
call fcn.004079fe
jne 0x40bfa7
mov edx, dword [0x413158]
test byte [edx], 1
mov al, 0x20
je 0x40bf53
mov al, 0x2a
call fcn.00402dfe
mov al, 0x20
call fcn.00402dfe
push ebx
lea ebx, [edx + 0x2c]
call fcn.00402ea9
pop ebx
mov al, 0x20
call fcn.00402dfe
mov al, byte [0x413188]
or al, al
je 0x40bf8c
cmp al, 0x14
je 0x40bf8c
cmp al, 0x28
je 0x40bf8c
cmp al, 0x3c
je 0x40bf8c
jb 0x40bf69
call fcn.00402df5
push ebx
push esi
xchg dword [0x413444], esp
push edx
push ebx
call sub.KERNEL32.dll_FindNextFileA
xchg dword [0x413444], esp
pop esi
pop ebx
or al, al
jne 0x40bf3d
call fcn.00402df5
pushal
xchg dword [0x413444], esp
push ebx
call sub.KERNEL32.dll_FindClose
xchg dword [0x413444], esp
popal
ret