Function at 0x405230
Capabilities:
Get file size
Move file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x220
push ebx
push esi
push edi
mov esi, ecx
mov edi, eax
push esi
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ecx, dword [ebp + 8]
push ecx
lea edx, [ebp - 0x220]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 9
lea eax, [ebp - 0x220]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x405484
xor ebx, ebx
push ebx
push 0x80
push 4
push ebx
push ebx
push 0xc0000000
lea ecx, [ebp - 0x220]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x405484
push ebx
push esi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
cmp edi, ebx
jle 0x4052c8
mov ecx, edi
shl ecx, 0xa
cmp eax, ecx
jbe 0x4052c8
mov eax, ecx
mov dword [ebp - 8], eax
jmp 0x4052cf
mov dword [ebp - 4], 1
push eax
push 8
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 0x14], edi
cmp edi, ebx
je 0x40546b
mov eax, dword [ebp - 8]
push ebx
lea edx, [ebp - 0x18]
push edx
push eax
push edi
push esi
mov dword [ebp - 0x18], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, dword [ebp + 0xc]
lea ecx, [ebp - 0xc]
mov dword [ebp - 0xc], edi
push ecx
lea edi, [ebp - 8]
call fcn.004040f0
add esp, 4
xor ebx, ebx
test eax, eax
jne 0x405321
mov dword [ebp - 0xc], ebx
mov edx, dword [ebp - 0x14]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [ebp - 0xc]
cmp edi, ebx
je 0x40546b
cmp dword [ebp - 4], ebx
je 0x405397
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 4]
push eax
push 4
lea ecx, [ebp + 0x14]
push ecx
mov dword [ebp - 4], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call ebx
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
push 0
lea edx, [ebp - 4]
push edx
push eax
push ecx
push esi
call ebx
push 0
lea edx, [ebp - 4]
push edx
push 4
lea eax, [ebp - 8]
push eax
push esi
call ebx
mov edx, dword [ebp - 8]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push edi
push esi
call ebx
jmp 0x405458
mov eax, dword [ebp - 8]
sub eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x14]
lea edi, [eax + ecx + 8]
push edi
push 8
mov dword [ebp - 4], ebx
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x405458
push 0
lea edx, [ebp - 0x10]
push edx
push edi
push ebx
push esi
mov dword [ebp - 0x10], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 4]
push eax
push 4
lea ecx, [ebp + 0x14]
push ecx
push esi
call edi
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
push 0
lea edx, [ebp - 4]
push edx
push eax
push ecx
push esi
call edi
push 0
lea edx, [ebp - 4]
push edx
push 4
lea eax, [ebp - 8]
push eax
push esi
call edi
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push eax
push esi
call edi
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp - 0x14]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push ebx
push esi
call edi
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 0xc]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret