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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
push ebx
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
push esi
push edi
mov dword [ebp - 4], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x1c], ebx
je 0x10051c1
lea eax, [ebp - 0x124]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push dword [ebp + 8]
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
call esi
test eax, eax
jne 0x1005015
push ebx
push 0x10
push ebx
push ebx
push 0x4bc
push ebx
call fcn.01003cc5
call fcn.0100574c
mov dword [0x100b704], eax
jmp 0x100514c
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
test eax, eax
jne 0x1005083
push 0x7f
lea edi, [ebp - 0x323]
pop ecx
mov byte [ebp - 0x324], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call fcn.0100574c
mov dword [0x100b704], eax
push ebx
lea eax, [ebp - 0x324]
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]
push ebx
lea eax, [ebp - 0x324]
push 0x10
push eax
push dword [ebp + 8]
push 0x4b0
jmp 0x10050ec
push ebx
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 0x20]
push eax
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
jne 0x10050fd
push 0x7f
lea edi, [ebp - 0x323]
pop ecx
mov byte [ebp - 0x324], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call fcn.0100574c
mov dword [0x100b704], eax
push ebx
lea eax, [ebp - 0x324]
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]
push ebx
lea eax, [ebp - 0x324]
push 0x10
push eax
push dword [ebp + 8]
push 0x4f9
push ebx
call fcn.01003cc5
lea eax, [ebp - 0x124]
push eax
call esi
jmp 0x100514c
lea eax, [ebp - 0x124]
push eax
call esi
push 3
lea eax, [ebp - 0x14]
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov eax, dword [ebp - 0xc]
mov edx, 0x200
imul eax, dword [ebp - 4]
mov esi, eax
imul esi, dword [ebp - 8]
xor ecx, ecx
cmp eax, edx
je 0x1005136
shl edx, 1
inc ecx
cmp cx, 8
jb 0x1005129
cmp cx, 8
jne 0x1005150
push ebx
push 0x10
push ebx
push ebx
push 0x4c5
push ebx
call fcn.01003cc5
xor eax, eax
jmp 0x10051c4
test byte [0x100b6d4], 8
je 0x100517a
test byte [ebp - 0x17], 0x80
je 0x100517a
mov edx, dword [0x100b6d8]
movzx eax, cx
mov ecx, edx
mov eax, dword [eax*4 + 0x100b6e0]
shr ecx, 2
shl eax, 1
add ecx, edx
jmp 0x100518a
movzx eax, cx
mov ecx, dword [0x100b6d8]
mov eax, dword [eax*4 + 0x100b6e0]
mov edi, dword [ebp + 0xc]
and edi, 1
je 0x100519f
test byte [ebp + 0xc], 2
je 0x100519f
lea edx, [ecx + eax]
cmp edx, esi
jmp 0x10051a9
cmp edi, ebx
je 0x10051a7
cmp eax, esi
jmp 0x10051a9
cmp ecx, esi
jbe 0x10051bb
lea edx, [ebp - 0x14]
push edx
push ecx
push eax
push dword [ebp + 0x10]
call fcn.010022cb
jmp 0x10051c4
mov dword [0x100b704], ebx
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret 0xc