Function at 0x439182
Capabilities:
Check if file exists
Create directory
Get file attributes
Query environment variable

Disassembly:
sub esp, 0xc
push ebx
xor ebx, ebx
push edi
xor edi, edi
cmp dword [esp + 0x18], ebx
mov dword [esp + 8], ebx
jne 0x43919c
xor eax, eax
jmp 0x4393b0
push ebp
push esi
push ebx
push ebx
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebp, eax
cmp ebp, ebx
jne 0x4391bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x439387
lea eax, [ebp + 2]
lea esi, [eax + eax]
push esi
push ebx
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebx
push esi
push 0
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
test edi, edi
mov dword [esp + 0x14], eax
je 0x439363
test eax, eax
je 0x439363
push ebp
push edi
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push edi
call fcn.004420ba
pop ecx
push 0x5c
pop ebp
cmp word [edi + eax*2 - 2], bp
je 0x439231
push edi
call fcn.004420ba
and word [edi + eax*2 + 2], 0
push edi
call fcn.004420ba
pop ecx
pop ecx
mov word [edi + eax*2], bp
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x439245
test al, 0x10
jne 0x43936b
movzx eax, word [edi]
cmp ax, bp
jne 0x4392a3
cmp word [edi + 2], bp
jne 0x4392a3
lea esi, [edi + 4]
movzx eax, word [esi]
test ax, ax
je 0x439296
cmp ax, bp
je 0x439273
cmp ax, 0x2f
je 0x439273
inc esi
inc esi
movzx eax, word [esi]
test ax, ax
jne 0x43925e
movzx eax, word [esi]
test ax, ax
je 0x439296
cmp ax, bp
je 0x439286
cmp ax, 0x2f
jne 0x439290
inc esi
inc esi
movzx eax, word [esi]
test ax, ax
jne 0x43927b
cmp word [esi], 0
jne 0x4392d5
mov dword [esp + 0x10], 0x35
jmp 0x43936b
movzx eax, ax
push eax
call fcn.00445ff0
test eax, eax
pop ecx
je 0x43935f
cmp word [edi + 2], 0x3a
jne 0x43935f
lea esi, [edi + 4]
movzx eax, word [esi]
cmp ax, bp
je 0x4392d1
cmp ax, 0x2f
jne 0x4392d5
inc esi
inc esi
jmp 0x4392c3
dec esi
dec esi
cmp word [esi], 0
je 0x43936b
mov ebx, esi
sub ebx, edi
jmp 0x4392ea
push 0x5c
pop ebp
inc esi
inc esi
movzx eax, word [esi]
inc ebx
inc ebx
test ax, ax
mov dword [esp + 0x20], ebx
je 0x439305
cmp ax, bp
je 0x439305
cmp ax, 0x2f
jne 0x43934d
mov ebp, dword [esp + 0x14]
sar ebx, 1
push ebx
push edi
push dword [esp + 0x20]
push ebp
call fcn.0044348b
and word [ebp + ebx*2], 0
add esp, 0x10
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x439345
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x439349
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
jmp 0x43936b
test al, 0x10
je 0x439355
mov ebx, dword [esp + 0x20]
cmp word [esi], 0
jne 0x4392e7
jmp 0x43936b
mov dword [esp + 0x10], 0xa1
jmp 0x43936b
xor eax, eax
jmp 0x4393ae
mov dword [esp + 0x10], 0xe
cmp dword [esp + 0x14], 0
je 0x439385
push dword [esp + 0x14]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor ebx, ebx
cmp dword [esp + 0x10], ebx
je 0x4393a2
cmp edi, ebx
je 0x4393a2
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor edi, edi
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop esi
pop ebp
pop edi
pop ebx
add esp, 0xc
ret