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

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x204a
push 0
push 0
dec ecx
jne 0x408eb0
push ecx
push ebx
push esi
push edi
xor eax, eax
push ebp
push 0x4091cb
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x10]
call fcn.0040a220
xor eax, eax
push ebp
push 0x409189
push dword fs:[eax]
mov dword fs:[eax], esp
lea edx, [ebp - 0x10134]
xor eax, eax
call fcn.004027ac
mov eax, dword [ebp - 0x10134]
mov edx, 0x20
call fcn.0040a2ac
mov esi, eax
cmp esi, 0xffffffff
jne 0x408f14
call fcn.00403a5c
jmp 0x409190
xor eax, eax
push ebp
push 0x409174
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0x4091dc
push 0
push esi
call sub.kernel32.dll_GetFileSize_1
sub eax, 0x118
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x10138]
call fcn.004062b0
mov eax, dword [ebp - 0x10138]
call fcn.00404458
push eax
push 0
call sub.user32.dll_MessageBoxA_1
push 0
push 0
push 0
push esi
call sub.kernel32.dll_GetFileSize_1
sub eax, 0x118
push eax
push esi
call sub.kernel32.dll_SetFilePointer_1
push 0
lea eax, [ebp - 8]
push eax
push 0x118
lea eax, [ebp - 0x10130]
push eax
push esi
call sub.kernel32.dll_ReadFile_1
push 0
push 0x4091e0
lea eax, [ebp - 0x1013c]
lea edx, [ebp - 0x1011f]
mov ecx, 0x105
call fcn.00404234
mov eax, dword [ebp - 0x1013c]
call fcn.00404458
push eax
push 0
call sub.user32.dll_MessageBoxA_1
push 0
push 0x4091e4
mov eax, dword [ebp - 0x10130]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x10140]
call fcn.004062b0
mov eax, dword [ebp - 0x10140]
call fcn.00404458
push eax
push 0
call sub.user32.dll_MessageBoxA_1
cmp dword [ebp - 0x10130], 0xfeedbeef
jne 0x408ffc
cmp dword [ebp - 8], 0x118
je 0x409019
call fcn.00403a5c
call fcn.00403a5c
jmp 0x409190
lea eax, [ebp - 0x14]
lea edx, [ebp - 0x1011f]
mov ecx, 0x105
call fcn.00404234
call sub.kernel32.dll_GetTickCount
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x10240]
call fcn.00404aa0
lea edx, [ebp - 0x10240]
lea eax, [ebp - 0x18]
call fcn.00404228
lea edx, [ebp - 0x10244]
mov eax, 0x4091f8
call fcn.00408c60
push dword [ebp - 0x10244]
push dword [ebp - 0x18]
lea edx, [ebp - 0x10248]
mov eax, 0x409204
call fcn.00408c60
push dword [ebp - 0x10248]
lea eax, [ebp - 0x14]
mov edx, 3
call fcn.00404320
push 0
call sub.kernel32.dll_Sleep_1
lea eax, [ebp - 0x1024c]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
call fcn.004042ac
mov eax, dword [ebp - 0x1024c]
call fcn.0040a278
test al, al
jne 0x40902c
lea eax, [ebp - 0x10250]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
call fcn.004042ac
mov eax, dword [ebp - 0x10250]
call fcn.0040a2ec
mov dword [ebp - 4], eax
mov ebx, dword [ebp - 0x10128]
cmp ebx, 0x10000
jbe 0x4090e9
mov edi, 0x10000
jmp 0x4090eb
mov edi, ebx
push 0
lea eax, [ebp - 8]
push eax
push edi
lea eax, [ebp - 0x10018]
push eax
push esi
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
lea eax, [ebp - 0x10018]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_WriteFile_1
sub ebx, dword [ebp - 8]
cmp edi, dword [ebp - 8]
jne 0x409125
test ebx, ebx
jne 0x4090da
mov eax, dword [ebp - 4]
call fcn.0040a310
test ebx, ebx
jne 0x409151
lea eax, [ebp - 0x10254]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
call fcn.004042ac
mov eax, dword [ebp - 0x10254]
call fcn.0040a184
test al, al
jne 0x40915f
mov eax, esi
call fcn.0040a310
xor eax, eax
call fcn.00403f38
mov eax, esi
call fcn.0040a310
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40917b
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4091d2
lea eax, [ebp - 0x10254]
mov edx, 5
call fcn.00403ff0
lea eax, [ebp - 0x10140]
mov edx, 4
call fcn.00403ff0
lea eax, [ebp - 0x18]
mov edx, 3
call fcn.00403ff0
ret