Function at 0x58bd64
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push 0x224
mov eax, 0x6d6f1a
call fcn.00432a44
mov ebx, dword [ebp + 0x14]
mov esi, 0x105
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
and dword [ebx], 0
and dword [ecx], 0
mov dword [ebp - 0x22c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x230], eax
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x228], ecx
test eax, eax
je 0x58bdbe
push esi
lea ecx, [ebp - 0x21c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
call edi
test eax, eax
je 0x58be14
push esi
lea eax, [ebp - 0x21c]
push eax
push dword [0x70f7d0]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x58bf9e
cmp eax, esi
jae 0x58bf9e
lea eax, [ebp - 0x21c]
push eax
call fcn.00432a7b
cmp eax, 0xffffffff
je 0x58bf9e
push dword [ebp + 0xc]
sub esi, eax
lea ecx, [ebp - 0x21c]
push esi
lea eax, [ecx + eax*2]
push eax
call fcn.00437d78
test eax, eax
jne 0x58bf9e
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x58be30
mov eax, 0x80040154
jmp 0x58bfa3
cmp byte [ebp + 0x1c], 0
je 0x58bf03
xor edi, edi
mov dword [ebp - 0x220], edi
xor ecx, ecx
inc ecx
mov dword [ebp - 4], ecx
lea eax, [ebp - 0x220]
push eax
push 0x441e70
push ecx
push edi
push 0x58bfac
call dword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jns 0x58be6c
mov esi, 0x80050200
jmp 0x58bee8
mov dword [ebp - 0x224], edi
mov byte [ebp - 4], 4
lea eax, [ebp - 0x21c]
mov esi, dword [ebp - 0x220]
lea ecx, [ebp - 0x228]
push eax
call fcn.0048cc22
mov byte [ebp - 4], 5
lea edx, [ebp - 0x224]
mov ecx, dword [esi]
push edx
push 1
push edi
push dword [ebp - 0x22c]
push dword [eax]
push esi
call dword [ecx + 0x1c]
mov esi, eax
mov byte [ebp - 4], 4
push dword [ebp - 0x228]
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
test esi, esi
js 0x58bed4
mov eax, dword [ebp - 0x224]
push ebx
push dword [ebp - 0x230]
mov ecx, dword [eax]
push eax
call dword [ecx]
mov esi, eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x224]
test ecx, ecx
je 0x58bee8
mov edx, dword [ecx]
push ecx
call dword [edx + 8]
or dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x220]
test eax, eax
je 0x58befc
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov eax, esi
jmp 0x58bfa3
push 8
push 0
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov esi, eax
test esi, esi
jne 0x58bf24
call edi
push eax
call fcn.00435aec
jmp 0x58bfa3
push 0x47de60
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
and dword [ebp - 0x220], 0
mov dword [ebp - 4], 0xb
lea ecx, [ebp - 0x220]
push ecx
push 0x47de74
push dword [ebp - 0x22c]
call eax
mov edi, eax
test edi, edi
js 0x58bf73
mov eax, dword [ebp - 0x220]
push ebx
push dword [ebp - 0x230]
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0xc]
mov edi, eax
test edi, edi
jns 0x58bf7c
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x58bf86
mov eax, dword [ebp - 0x228]
xor edi, edi
mov dword [eax], esi
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x220]
test ecx, ecx
je 0x58bf9a
mov edx, dword [ecx]
push ecx
call dword [edx + 8]
mov eax, edi
jmp 0x58bfa3
mov eax, 0x8000ffff
call fcn.00402698
ret 0x1c