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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41367b
mov eax, dword fs:[0]
push eax
mov eax, 0x1048
call fcn.00411ef0
mov eax, dword [0x41a00c]
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.00401598
push eax
lea ecx, [ebp - 0x1018]
call fcn.00401b24
mov dword [ebp - 4], ebx
call fcn.00401598
push eax
lea ecx, [ebp - 0x103c]
call fcn.00401b24
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.004063fc
mov ecx, eax
call fcn.00404984
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 0x40cfc6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402dd7
push eax
lea ecx, [esi + 0x14]
mov byte [ebp - 4], 3
call fcn.00403848
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401572
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Error_opening_file__s.
push eax
call fcn.00403bff
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.00401b9c
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.00404074
jmp 0x40d32d
cmp dword [esi + 0xc], ebx
je 0x40d2ff
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Copying_file__s.
push eax
call fcn.00403bff
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.00401b9c
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
add ecx, 0x148
mov dword [edi], eax
call fcn.00404074
mov edi, dword [ebp - 0x1038]
lea eax, [ebp - 0x1054]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d0bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1028]
call fcn.00402dd7
mov ecx, dword [ebp - 0x1024]
push eax
add ecx, 0x14
mov byte [ebp - 4], 4
call fcn.00403848
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1028]
add ecx, 0xfffffff0
call fcn.00401572
mov eax, dword [ebp - 0x102c]
push dword [eax]
push str.Couldnt_get_file_size_of__s
lea eax, [ebp - 0x1018]
push eax
call fcn.00403bff
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.00401b9c
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.00404074
push dword [ebp - 0x1038]
jmp 0x40d327
push 0x414bd8
lea edx, [ebp - 0x1048]
lea ecx, [ebp - 0x1020]
call fcn.004033ff
mov ecx, dword [ebp - 0x1024]
mov edx, eax
push ecx
lea ecx, [ebp - 0x1028]
mov byte [ebp - 4], 5
call fcn.0040701e
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 6
call fcn.00403848
mov ecx, dword [ebp - 0x1028]
lea ecx, [ecx - 0x10]
call fcn.00401572
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1020]
lea ecx, [ecx - 0x10]
call fcn.00401572
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 0x40d18a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402dd7
mov ecx, dword [ebp - 0x1024]
push eax
mov byte [ebp - 4], 7
lea ecx, [ecx + 0x14]
call fcn.00403848
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401572
push dword [ebp - 0x103c]
push str.Error_creating_file__s.
jmp 0x40d076
mov ecx, dword [ebp - 0x101c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1034], xmm0
lea ecx, [ecx + 0x148]
call fcn.00404129
test al, al
jne 0x40d314
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 0x40d2d5
cmp dword [ebp - 0x1040], 0
je 0x40d2d5
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 0x40d2d5
mov eax, dword [ebp - 0x1044]
cmp dword [ebp - 0x1040], eax
jne 0x40d2d5
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.00412270
mov edx, dword [ebp - 0x1050]
mov ecx, dword [ebp - 0x1054]
cvtsd2ss xmm0, xmm0
mulss xmm0, dword [0x416b80]
movss dword [ebp - 0x1030], xmm0
call fcn.00412270
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.00404129
mov edi, dword [ebp - 0x1038]
test al, al
je 0x40d1c6
jmp 0x40d314
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.00403848
jmp 0x40d305
mov esi, dword [ebp - 0x1018]
or dword [ebp - 0x1020], 0xffffffff
xor ebx, ebx
inc ebx
cmp edi, 0xffffffff
je 0x40d32d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1020]
cmp eax, 0xffffffff
je 0x40d32d
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1048]
lea ecx, [ecx - 0x10]
call fcn.00401572
mov ecx, dword [ebp - 0x103c]
add ecx, 0xfffffff0
call fcn.00401572
lea ecx, [esi - 0x10]
call fcn.00401572
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.00410bc0
leave
ret 4