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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x88c
push 0
push pe_nt_image_headers32
push 3
push 0
push 3
push 0x80000000
push dword [ebp + 8]
call sub.KERNEL32.DLL_CreateFileA
cmp eax, 0xffffffff
mov ebx, eax
sete dl
test eax, eax
sete al
or dl, al
jne 0x40581e
push 0
push pe_nt_image_headers32
push 2
push 0
push 3
push 0x40000000
push dword [ebp + 0xc]
call sub.KERNEL32.DLL_CreateFileA
cmp eax, 0xffffffff
mov esi, eax
sete dl
test eax, eax
sete al
or al, dl
jne 0x405818
cld
mov ecx, 0x1e
lea edi, [ebp - 0x2c]
rep stosb byte es:[edi], al
mov dword [ebp - 0x2c], 0x4034b50
lea edi, [ebp - 0x7c]
mov cl, 0x2e
rep stosb byte es:[edi], al
mov word [ebp - 0x28], 0xa
lea edi, [ebp - 0x4c]
mov cl, 0x16
rep stosb byte es:[edi], al
mov word [ebp - 0x76], 0xa
lea eax, [ebp - 0x48c]
push eax
mov word [ebp - 0x26], 0
mov word [ebp - 0x74], 0
mov word [ebp - 0x24], 0
mov word [ebp - 0x72], 0
call sub.KERNEL32.DLL_GetSystemTime
mov eax, dword [ebp - 0x48c]
sub eax, 0x7cf
cmp ax, 0xb
jbe 0x4055b4
mov word [ebp - 0x48c], 0x7d4
movzx eax, word [ebp - 0x48a]
dec eax
cmp ax, 0xb
jbe 0x4055cb
mov word [ebp - 0x48a], 1
movzx eax, word [ebp - 0x486]
dec eax
cmp ax, 0x1e
jbe 0x4055e2
mov word [ebp - 0x486], 0xa
movzx ecx, word [ebp - 0x48c]
push 0
xor edi, edi
movzx eax, word [ebp - 0x48a]
movzx edx, word [ebp - 0x484]
sub ecx, 0x7bc
shl ecx, 9
push 0
shl eax, 5
or ecx, eax
movzx eax, word [ebp - 0x486]
shl edx, 0xb
push 0
push ebx
or ecx, eax
movzx eax, word [ebp - 0x482]
mov word [ebp - 0x20], cx
mov word [ebp - 0x6e], cx
shl eax, 5
or edx, eax
movzx eax, word [ebp - 0x480]
shr eax, 1
or edx, eax
mov word [ebp - 0x22], dx
mov word [ebp - 0x70], dx
call sub.KERNEL32.DLL_SetFilePointer
push 0
lea eax, [ebp - 0x890]
push eax
lea eax, [ebp - 0x88c]
push 0x400
push eax
push ebx
mov dword [ebp - 0x890], 0
call sub.KERNEL32.DLL_ReadFile
test eax, eax
je 0x40568e
mov eax, dword [ebp - 0x890]
test eax, eax
je 0x40568e
push eax
lea eax, [ebp - 0x88c]
push eax
push edi
call fcn.004053fc
mov edi, eax
add esp, 0xc
jmp 0x405646
push 0
push 0
push 0
push ebx
call sub.KERNEL32.DLL_SetFilePointer
push 0
push ebx
mov dword [ebp - 0x1e], edi
mov dword [ebp - 0x6c], edi
call sub.KERNEL32.DLL_GetFileSize
push 0
push ebx
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x68], eax
call sub.KERNEL32.DLL_GetFileSize
push dword [ebp + 0x10]
mov dword [ebp - 0x16], eax
mov dword [ebp - 0x64], eax
call sub.KERNEL32.DLL_lstrlenA
push 0
mov word [ebp - 0x12], ax
mov word [ebp - 0x60], ax
lea eax, [ebp - 0x894]
push eax
lea eax, [ebp - 0x2c]
push 0x1e
push eax
push esi
mov word [ebp - 0x10], 0
mov word [ebp - 0x5e], 0
mov dword [ebp - 0x52], 0
call sub.KERNEL32.DLL_WriteFile
push 0
lea eax, [ebp - 0x894]
push eax
push dword [ebp + 0x10]
call sub.KERNEL32.DLL_lstrlenA
push eax
push dword [ebp + 0x10]
push esi
call sub.KERNEL32.DLL_WriteFile
push dword [ebp + 0x10]
call sub.KERNEL32.DLL_lstrlenA
push 0
lea edi, [eax + 0x1e]
push 0
push 0
push ebx
call sub.KERNEL32.DLL_SetFilePointer
push 0
lea eax, [ebp - 0x894]
push eax
lea eax, [ebp - 0x47c]
push 0x400
push eax
push ebx
mov dword [ebp - 0x894], 0
call sub.KERNEL32.DLL_ReadFile
test eax, eax
je 0x405778
mov edx, dword [ebp - 0x894]
test edx, edx
je 0x405778
push 0
lea eax, [ebp - 0x898]
push eax
lea eax, [ebp - 0x47c]
push edx
push eax
push esi
call sub.KERNEL32.DLL_WriteFile
add edi, dword [ebp - 0x894]
jmp 0x405726
push 0
lea eax, [ebp - 0x894]
push eax
lea eax, [ebp - 0x7c]
push 0x2e
push eax
push esi
mov dword [ebp - 0x3c], edi
add edi, 0x2e
mov dword [ebp - 0x7c], 0x2014b50
mov word [ebp - 0x78], 0x14
mov word [ebp - 0x58], 0
mov dword [ebp - 0x56], 0x20
call sub.KERNEL32.DLL_WriteFile
push 0
lea eax, [ebp - 0x894]
push eax
push dword [ebp + 0x10]
call sub.KERNEL32.DLL_lstrlenA
push eax
push dword [ebp + 0x10]
push esi
call sub.KERNEL32.DLL_WriteFile
push dword [ebp + 0x10]
call sub.KERNEL32.DLL_lstrlenA
push 0
add edi, eax
lea eax, [ebp - 0x894]
push eax
lea eax, [ebp - 0x4c]
sub edi, dword [ebp - 0x3c]
push 0x16
push eax
push esi
mov dword [ebp - 0x4c], 0x6054b50
mov word [ebp - 0x48], 0
mov word [ebp - 0x46], 0
mov word [ebp - 0x44], 1
mov word [ebp - 0x42], 1
mov dword [ebp - 0x40], edi
mov word [ebp - 0x38], 0
call sub.KERNEL32.DLL_WriteFile
push esi
call sub.KERNEL32.DLL_CloseHandle
push ebx
call sub.KERNEL32.DLL_CloseHandle
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret