Function at 0x413f58
Capabilities:
Get common file path
Get disk information
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0xac]
sub esp, 0x12c
mov eax, dword [0x46a860]
xor eax, ebp
mov dword [ebp + 0xa8], eax
mov eax, dword [ebp + 0xb4]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc0]
xor ebx, ebx
cmp eax, ebx
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x64], edi
je 0x4145c5
cmp edi, ebx
je 0x4145c5
cmp byte [eax], bl
jne 0x413fab
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4145d1
push 4
lea eax, [ebp - 0x80]
push ebx
push eax
mov dword [ebp - 0x74], ebx
call fcn.004377f0
mov eax, dword [ebp - 0x70]
push 2
pop esi
push esi
inc eax
push 0x454774
push eax
call fcn.00437ceb
add esp, 0x18
test eax, eax
jne 0x413fdb
push 3
push dword [ebp - 0x70]
jmp 0x413ff0
lea eax, [ebp - 0x5c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push 3
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x80]
push eax
call fcn.004378f0
add esp, 0xc
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 5
jne 0x414010
mov dword [ebp - 0x74], esi
jmp 0x414020
test byte [ebp + 0xbc], 2
je 0x414020
mov dword [ebp - 0x74], 1
test byte [ebp + 0xbc], 1
je 0x414033
test byte [ebp - 0x74], 2
je 0x4145d1
test byte [ebp + 0xc4], 0x20
je 0x414045
mov dword [ebp - 0x6c], 4
jmp 0x414064
test byte [ebp + 0xc4], 8
je 0x414053
mov dword [ebp - 0x6c], esi
jmp 0x414064
movzx eax, byte [ebp + 0xc4]
and eax, 4
or eax, esi
shr eax, 1
mov dword [ebp - 0x6c], eax
test byte [ebp + 0xc4], 0x10
je 0x41409c
test byte [ebp + 0xc4], 4
jne 0x414080
push 0x8520006c
jmp 0x413fa0
mov eax, 0x8000
test dword [ebp + 0xc4], eax
mov dword [ebp - 0x60], SysReAllocStringLen
je 0x4140ad
xor dword [ebp + 0xc4], eax
jmp 0x4140ad
or dword [ebp + 0xc4], 0x8000
mov dword [ebp - 0x60], 0xc0000000
mov esi, dword [ebp - 0x60]
push ebx
push ebx
push dword [ebp - 0x6c]
shr esi, 0x1e
push ebx
not esi
and esi, 1
push esi
push dword [ebp - 0x60]
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea ecx, [ebp - 0x68]
mov edi, eax
call fcn.0041384c
cmp edi, 0xffffffff
jne 0x414123
push ebx
push ebx
push dword [ebp - 0x70]
call fcn.00413a2d
add esp, 0xc
push eax
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x7c], eax
call fcn.00413f41
push dword [ebp - 0x7c]
mov edi, eax
push edi
push dword [ebp - 0x70]
call fcn.00413a2d
add esp, 0xc
push ebx
push ebx
push dword [ebp - 0x6c]
mov dword [ebp - 0x70], edi
push ebx
push esi
push dword [ebp - 0x60]
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x4145a9
mov eax, dword [0x46d644]
lea eax, [eax*4 + 4]
push eax
call fcn.00413f20
cmp eax, ebx
mov dword [ebp - 0x60], eax
jne 0x414155
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x64]
lea ecx, [ebp - 0x68]
mov dword [eax], ebx
call fcn.00413852
jmp 0x4145d3
mov esi, dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
push edi
call esi
test eax, eax
jne 0x4142c3
test byte [ebp + 0xc4], 0x10
jne 0x4142c3
push 0x174
mov dword [ebp - 0x6c], ebx
call fcn.00413f20
mov esi, eax
cmp esi, ebx
jne 0x414191
push dword [ebp - 0x60]
call fcn.00417ab1
jmp 0x41413c
push 4
push dword [0x468010]
lea eax, [esi + 0x124]
push eax
call fcn.004378f0
mov eax, dword [ebp + 0xcc]
add esp, 0xc
test eax, 0xffff0000
push 0x20
pop ecx
mov dword [esi + 0x128], ecx
mov word [esi + 0x140], bx
je 0x4141d0
mov word [esi + 0x142], 3
jmp 0x4141d7
mov word [esi + 0x142], ax
xor eax, eax
inc eax
cmp dword [ebp + 0xc8], eax
jbe 0x4141ec
add eax, eax
cmp eax, dword [ebp + 0xc8]
jb 0x4141e2
lea edx, [eax + 2]
mov dword [esi + 0x138], eax
shl edx, 4
inc eax
shl eax, 5
push ebx
mov dword [esi + 0x12c], eax
lea eax, [ebp - 0x78]
push eax
push ecx
lea eax, [esi + 0x124]
push eax
push edi
mov dword [esi + 0x13c], ebx
mov dword [esi + 0x130], ecx
mov dword [esi + 0x134], edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x41423a
push dword [ebp - 0x60]
call fcn.00417ab1
push esi
jmp 0x41418a
mov eax, dword [esi + 0x12c]
mov dword [ebp - 0x7c], eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413f20
cmp eax, ebx
mov dword [esi + 0x118], eax
je 0x41422c
mov ecx, dword [esi + 0x138]
shl ecx, 4
push ecx
push 0xff
push eax
call fcn.004377f0
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413d53
add esp, 0x18
push ebx
lea eax, [ebp - 0x78]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x414438
push dword [esi + 0x118]
call fcn.00417ab1
jmp 0x41422c
push edi
call fcn.0041397a
cmp eax, 0xffffffff
mov dword [ebp - 0x6c], eax
jne 0x4142f0
push dword [ebp - 0x60]
call fcn.00417ab1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x85200065
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x414143
push ebx
push edi
call esi
push 0x174
mov dword [ebp - 0x7c], eax
call fcn.00413f20
mov esi, eax
cmp esi, ebx
je 0x414187
push ebx
push ebx
push dword [ebp - 0x6c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea ecx, [ebp - 0x78]
push ecx
push 0x20
lea eax, [esi + 0x124]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x41422c
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413f20
cmp eax, ebx
mov dword [esi + 0x118], eax
je 0x41422c
mov eax, dword [esi + 0x13c]
cmp eax, ebx
je 0x414372
shl eax, 4
push eax
call fcn.00413f20
cmp eax, ebx
mov dword [esi + 0x11c], eax
je 0x4142b3
mov eax, dword [esi + 0x130]
add eax, dword [ebp - 0x6c]
push ebx
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x78]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4143be
mov eax, dword [esi + 0x11c]
cmp eax, ebx
je 0x4142b3
push eax
call fcn.00417ab1
jmp 0x4142b3
cmp dword [esi + 0x13c], ebx
je 0x414438
mov eax, dword [esi + 0x134]
add eax, dword [ebp - 0x6c]
push ebx
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x78]
push eax
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [esi + 0x11c]
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x414438
push dword [esi + 0x11c]
call fcn.00417ab1
push dword [esi + 0x118]
call fcn.00417ab1
push dword [ebp - 0x60]
call fcn.00417ab1
push esi
call fcn.00417ab1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x64]
mov dword [eax], ebx
lea ecx, [ebp - 0x68]
call fcn.00413852
mov eax, ebx
jmp 0x4145d5
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413db6
mov eax, dword [esi + 0x11c]
add esp, 0xc
cmp eax, ebx
je 0x414479
push dword [0x46d524]
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
call fcn.00413db6
add esp, 0xc
push 0x103
push dword [ebp - 0x70]
mov dword [esi + 0x144], esi
push esi
call fcn.00439580
mov eax, dword [0x46d64c]
add esp, 0xc
cmp eax, ebx
je 0x41449f
mov dword [eax + 0x110], esi
mov dword [esi + 0x110], 0x46d648
mov ecx, dword [0x46d64c]
lea eax, [esi + 0x114]
mov dword [eax], ecx
cmp dword [0x46d648], ebx
jne 0x4144cb
mov dword [eax], 0xeafc5e23
mov dword [0x46d648], esi
mov eax, dword [ebp - 0x74]
mov dword [0x46d64c], esi
mov cl, byte [esi + 0x142]
mov dword [esi + 0x148], eax
mov eax, dword [ebp + 0xb8]
mov dword [esi + 0x14c], eax
mov eax, 0x200
shl eax, cl
mov dword [esi + 0x120], edi
mov edi, dword [ebp - 0x60]
mov dword [esi + 0x108], ebx
mov dword [esi + 0x154], eax
mov eax, dword [ebp - 0x6c]
mov dword [esi + 0x15c], eax
lea eax, [esi + 0x124]
mov dword [esi + 0x10c], eax
mov eax, dword [ebp - 0x7c]
mov dword [esi + 0x164], eax
mov eax, dword [ebp + 0xc4]
mov dword [esi + 0x16c], eax
mov dword [esi + 0x150], ebx
mov dword [esi + 0x104], ebx
mov dword [esi + 0x158], ebx
mov dword [esi + 0x168], 1
mov dword [esi + 0x170], ebx
mov eax, dword [0x46d644]
shl eax, 2
push eax
push dword [0x46d640]
push edi
call fcn.004378f0
mov eax, dword [0x46d644]
mov dword [edi + eax*4], esi
mov eax, dword [0x46d640]
add esp, 0xc
cmp eax, ebx
je 0x414583
push eax
call fcn.00417ab1
inc dword [0x46d644]
xor ebx, ebx
inc ebx
cmp dword [0x46d644], ebx
mov dword [0x46d640], edi
jbe 0x41459f
call fcn.00413b52
mov eax, dword [ebp - 0x64]
mov dword [eax], esi
jmp 0x414429
test byte [ebp + 0xc4], 4
je 0x4145ba
push 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x64]
or dword [eax], 0xffffffff
jmp 0x414429
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp edi, ebx
je 0x4145d3
mov dword [edi], ebx
xor eax, eax
mov ecx, dword [ebp + 0xa8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004353a6
add ebp, 0xac
leave
ret 0x1c