Function at 0x4051b0
Capabilities:
Check if file exists
Create directory
Get common file path
Get disk information
Get file attributes
Set file attributes

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x108
mov eax, dword [0x40700c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
push 0x4011f0
call fcn.004042f1
mov edi, eax
lea ecx, [edi + 1]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
jne 0x40520b
push ebx
push 0x10
push ebx
push ebx
push 0x4b5
push ebx
call fcn.004040e2
call fcn.00405de9
mov dword [0x408b68], eax
xor eax, eax
jmp 0x4054aa
push edi
push esi
push 0x4011f0
call fcn.004042f1
test eax, eax
jne 0x40523e
push ebx
push 0x10
push ebx
push ebx
push 0x4b1
push ebx
call fcn.004040e2
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [0x408b68], 0x80070714
jmp 0x405204
push 0x4011c4
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
xor edi, edi
inc edi
test eax, eax
jne 0x405257
mov dword [0x408b50], edi
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov al, byte [0x407b3e]
test al, al
je 0x4052a3
cmp al, 0x5c
jne 0x405275
cmp byte [0x407b3f], al
mov eax, ebx
je 0x405277
mov eax, edi
push eax
push ebx
mov edx, 0x407b3e
call fcn.0040507b
test eax, eax
je 0x40528e
mov eax, edi
jmp 0x4054aa
push ebx
push 0x10
push ebx
push ebx
push 0x4be
push ebx
call fcn.004040e2
jmp 0x405204
cmp dword [0x407a24], ebx
jne 0x405492
cmp dword [0x408b50], ebx
jne 0x405492
mov esi, 0x408304
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x4052f4
push 3
push edi
mov edx, esi
call fcn.0040507b
test eax, eax
jne 0x405287
call fcn.0040236c
test eax, eax
jne 0x4052f4
push edi
push edi
mov edx, esi
call fcn.0040507b
test eax, eax
jne 0x405287
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov edi, dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov edx, 0x4012a8
mov eax, 0x104
lea ecx, [ebp - 0x108]
call fcn.0040148d
cmp byte [ebp - 0x108], 0x5a
jg 0x405463
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
mov esi, eax
cmp esi, 6
je 0x40533b
cmp esi, 3
jne 0x405349
lea eax, [ebp - 0x108]
push eax
call ebx
cmp eax, 0xffffffff
jne 0x405385
cmp esi, 2
jne 0x405372
mov al, byte [ebp - 0x108]
cmp al, 0x41
je 0x405378
cmp al, 0x42
je 0x405378
lea eax, [ebp - 0x108]
call fcn.004064d6
test eax, eax
je 0x405372
cmp eax, 0x19000
jae 0x405385
mov al, byte [ebp - 0x108]
inc al
mov byte [ebp - 0x108], al
jmp 0x40545b
push 0
push 3
lea ecx, [ebp - 0x108]
call fcn.00405580
test eax, eax
jne 0x4053b5
lea esi, [ebp - 0x108]
call fcn.0040236c
test eax, eax
jne 0x405372
push eax
push 1
mov ecx, esi
call fcn.00405580
test eax, eax
je 0x405372
lea esi, [ebp - 0x108]
call fcn.0040236c
test eax, eax
je 0x4053ce
push 0x104
mov eax, esi
push eax
call edi
push 0x104
mov eax, 0x4012ac
lea ecx, [ebp - 0x108]
call fcn.00406177
lea eax, [ebp - 0x108]
push eax
call ebx
cmp eax, 0xffffffff
jne 0x405402
push 0
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
jmp 0x405405
and eax, 0x10
test eax, eax
jne 0x405420
mov al, byte [ebp - 0x108]
inc al
mov byte [ebp - 0x108], al
mov byte [ebp - 0x105], 0
jmp 0x40545b
push 2
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov esi, 0x408304
lea edx, [ebp - 0x108]
mov eax, 0x104
mov ecx, esi
call fcn.0040148d
push 0
push 1
mov edx, esi
call fcn.0040507b
test eax, eax
jne 0x40548d
mov al, byte [ebp - 0x108]
cmp al, 0x5a
jle 0x405322
push 0x104
lea eax, [ebp - 0x108]
push eax
call edi
push 4
push 3
lea ecx, [ebp - 0x108]
call fcn.00405580
test eax, eax
jne 0x405300
jmp 0x405204
xor eax, eax
inc eax
jmp 0x4054aa
push ebx
push ebx
push 0x402f27
push ebx
push 0x7d2
call fcn.0040606f
neg eax
sbb eax, eax
neg eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004068a6
leave
ret