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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4136bb
mov eax, dword fs:[0]
push eax
mov eax, 0x1048
call fcn.00411f30
mov eax, dword [0x41b00c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x101c], edi
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x1024], esi
call fcn.004015d8
push eax
lea ecx, [ebp - 0x1018]
call fcn.00401b64
mov dword [ebp - 4], ebx
call fcn.004015d8
push eax
lea ecx, [ebp - 0x103c]
call fcn.00401b64
lea eax, [ebp - 0x1048]
mov byte [ebp - 4], 1
push eax
push dword [edi + 0x13c]
lea ecx, [edi + 8]
mov dword [ebp - 0x1040], ebx
mov dword [ebp - 0x1044], ebx
call fcn.00406439
mov ecx, eax
call fcn.004049c4
push ebx
push ebx
push 3
push ebx
push 3
lea eax, [esi + 4]
mov byte [ebp - 4], 2
push 0x80000000
push dword [eax]
mov dword [ebp - 0x102c], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x1038], edi
cmp edi, 0xffffffff
jne 0x40d006
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402e17
push eax
lea ecx, [esi + 0x14]
mov byte [ebp - 4], 3
call fcn.00403888
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.004015b2
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Error_opening_file__s.
push eax
call fcn.00403c3f
mov esi, dword [ebp - 0x1018]
add esp, 0xc
push ebx
push ebx
push ecx
mov edi, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x1030], edi
call fcn.00401bdc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.004040b4
jmp 0x40d36d
cmp dword [esi + 0xc], ebx
je 0x40d33f
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Copying_file__s.
push eax
call fcn.00403c3f
mov esi, dword [ebp - 0x1018]
add esp, 0xc
push ebx
push ebx
push ecx
mov edi, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x1030], edi
call fcn.00401bdc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
add ecx, 0x148
mov dword [edi], eax
call fcn.004040b4
mov edi, dword [ebp - 0x1038]
lea eax, [ebp - 0x1054]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d0ff
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1028]
call fcn.00402e17
mov ecx, dword [ebp - 0x1024]
push eax
add ecx, 0x14
mov byte [ebp - 4], 4
call fcn.00403888
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1028]
add ecx, 0xfffffff0
call fcn.004015b2
mov eax, dword [ebp - 0x102c]
push dword [eax]
push str.Couldnt_get_file_size_of__s
lea eax, [ebp - 0x1018]
push eax
call fcn.00403c3f
mov esi, dword [ebp - 0x1018]
add esp, 0xc
push ebx
push ebx
push ecx
mov edi, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x1030], edi
call fcn.00401bdc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.004040b4
push dword [ebp - 0x1038]
jmp 0x40d367
push 0x414be8
lea edx, [ebp - 0x1048]
lea ecx, [ebp - 0x1020]
call fcn.0040343f
mov ecx, dword [ebp - 0x1024]
mov edx, eax
push ecx
lea ecx, [ebp - 0x1028]
mov byte [ebp - 4], 5
call fcn.0040705b
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 6
call fcn.00403888
mov ecx, dword [ebp - 0x1028]
lea ecx, [ecx - 0x10]
call fcn.004015b2
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1020]
lea ecx, [ecx - 0x10]
call fcn.004015b2
push ebx
push ebx
push 2
push ebx
push 1
push 0x40000000
push dword [ebp - 0x103c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1020], eax
cmp eax, 0xffffffff
jne 0x40d1ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402e17
mov ecx, dword [ebp - 0x1024]
push eax
mov byte [ebp - 4], 7
lea ecx, [ecx + 0x14]
call fcn.00403888
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.004015b2
push dword [ebp - 0x103c]
push str.Error_creating_file__s.
jmp 0x40d0b6
mov ecx, dword [ebp - 0x101c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1034], xmm0
lea ecx, [ecx + 0x148]
call fcn.00404169
test al, al
jne 0x40d354
mov eax, dword [ebp - 0x1030]
mov dword [ebp - 0x1028], eax
mov eax, dword [ebp - 0x1034]
mov dword [ebp - 0x1024], eax
push ebx
lea eax, [ebp - 0x1040]
push eax
push 0x400
lea eax, [ebp - 0x1014]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d315
cmp dword [ebp - 0x1040], 0
je 0x40d315
push ebx
lea eax, [ebp - 0x1044]
push eax
push dword [ebp - 0x1040]
lea eax, [ebp - 0x1014]
push eax
push dword [ebp - 0x1020]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d315
mov eax, dword [ebp - 0x1044]
cmp dword [ebp - 0x1040], eax
jne 0x40d315
mov ecx, dword [ebp - 0x1024]
add ecx, eax
mov eax, dword [ebp - 0x1028]
mov dword [ebp - 0x1024], ecx
adc eax, ebx
mov edx, eax
mov dword [ebp - 0x1028], eax
call fcn.004122b0
mov edx, dword [ebp - 0x1050]
mov ecx, dword [ebp - 0x1054]
cvtsd2ss xmm0, xmm0
mulss xmm0, dword [0x416b90]
movss dword [ebp - 0x1030], xmm0
call fcn.004122b0
movss xmm1, dword [ebp - 0x1030]
cvtsd2ss xmm0, xmm0
mov eax, dword [ebp - 0x101c]
add eax, 0x148
push eax
divss xmm1, xmm0
cvttss2si edi, xmm1
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x101c]
add eax, 0x148
push eax
mov dword [eax + 0x28], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x101c]
lea ecx, [ecx + 0x148]
call fcn.00404169
mov edi, dword [ebp - 0x1038]
test al, al
je 0x40d206
jmp 0x40d354
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x1020]
or edi, 0xffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x102c]
lea eax, [ebp - 0x103c]
push eax
call fcn.00403888
jmp 0x40d345
mov esi, dword [ebp - 0x1018]
or dword [ebp - 0x1020], 0xffffffff
xor ebx, ebx
inc ebx
cmp edi, 0xffffffff
je 0x40d36d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1020]
cmp eax, 0xffffffff
je 0x40d36d
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1048]
lea ecx, [ecx - 0x10]
call fcn.004015b2
mov ecx, dword [ebp - 0x103c]
add ecx, 0xfffffff0
call fcn.004015b2
lea ecx, [esi - 0x10]
call fcn.004015b2
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00410c00
leave
ret 4