Function at 0x405a2f
Capabilities:
Get common file path
Get disk information
Get disk size
Set current directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x330
mov eax, dword [0x408004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
lea eax, [ebp - 0x310]
mov dword [ebp - 0x314], edx
push eax
push 0x104
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
xor ebx, ebx
test eax, eax
jne 0x405a8f
push ebx
push 0x10
push ebx
push ebx
mov edx, 0x4bc
xor ecx, ecx
call fcn.004044e8
call fcn.0040635e
mov dword [0x409a48], eax
xor eax, eax
jmp 0x405cc9
push edi
lea eax, [ebp - 0x32c]
mov dword [ebp - 0x320], ebx
push eax
lea eax, [ebp - 0x318]
mov dword [ebp - 0x31c], ebx
push eax
lea eax, [ebp - 0x31c]
mov dword [ebp - 0x318], ebx
push eax
lea eax, [ebp - 0x320]
mov dword [ebp - 0x32c], ebx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
test eax, eax
je 0x405c5c
mov eax, dword [ebp - 0x31c]
imul eax, dword [ebp - 0x320]
push 0x400
push dword [ebp - 0x318]
push eax
mov dword [ebp - 0x324], eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov edi, eax
test edi, edi
je 0x405c5c
push ebx
push ebx
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x330]
push eax
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
jne 0x405b70
push 0x1ff
lea eax, [ebp - 0x20b]
mov byte [ebp - 0x20c], bl
push ebx
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
call fcn.0040635e
push ebx
mov dword [0x409a48], eax
lea eax, [ebp - 0x20c]
push 0x200
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push 0x1000
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, 0x4f9
jmp 0x405ca7
lea eax, [ebp - 0x310]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea ecx, [ebp - 0xc]
push 6
mov eax, ecx
pop edx
sub esi, eax
lea eax, [edx - 4]
test eax, eax
je 0x405b9d
mov al, byte [esi + ecx]
test al, al
je 0x405b9d
mov byte [ecx], al
inc ecx
sub edx, 1
jne 0x405b87
test edx, edx
jne 0x405ba2
dec ecx
mov edx, dword [ebp - 0x324]
mov eax, ebx
push 8
mov byte [ecx], bl
mov ecx, 0x200
pop esi
cmp edx, ecx
je 0x405bc0
add ecx, ecx
inc eax
cmp ax, si
jb 0x405bb4
cmp ax, si
jne 0x405bdb
push ebx
push 0x10
push ebx
push ebx
mov edx, 0x4c5
xor ecx, ecx
call fcn.004044e8
jmp 0x405cc6
test byte [0x409a34], 8
je 0x405c0d
test dword [ebp - 0x328], 0x8000
je 0x405c0d
mov ecx, dword [0x409a38]
movzx eax, ax
shr ecx, 2
mov edx, dword [eax*4 + 0x4088c0]
add edx, edx
add ecx, dword [0x409a38]
jmp 0x405c1d
mov ecx, dword [0x409a38]
movzx eax, ax
mov edx, dword [eax*4 + 0x4088c0]
mov eax, dword [ebp - 0x314]
and eax, 3
cmp al, 3
jne 0x405c31
lea eax, [ecx + edx]
cmp eax, edi
jmp 0x405c40
test byte [ebp - 0x314], 1
je 0x405c3e
cmp edx, edi
jmp 0x405c40
cmp ecx, edi
jbe 0x405c51
lea eax, [ebp - 0xc]
push eax
push ecx
mov ecx, dword [ebp + 8]
call fcn.004026a4
jmp 0x405cc8
xor eax, eax
mov dword [0x409a48], ebx
inc eax
jmp 0x405cc8
push 0x1ff
lea eax, [ebp - 0x20b]
mov byte [ebp - 0x20c], bl
push ebx
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
call fcn.0040635e
push ebx
mov dword [0x409a48], eax
lea eax, [ebp - 0x20c]
push 0x200
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push 0x1000
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, 0x4b0
push ebx
push 0x10
lea eax, [ebp - 0x20c]
xor ecx, ecx
push eax
push esi
call fcn.004044e8
lea eax, [ebp - 0x310]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00406e50
mov esp, ebp
pop ebp
ret 4