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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41344d
mov eax, dword fs:[0]
push eax
mov eax, 0x1048
call fcn.00411f80
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.004015a8
push eax
lea ecx, [ebp - 0x1018]
call fcn.00401b44
mov dword [ebp - 4], ebx
call fcn.004015a8
push eax
lea ecx, [ebp - 0x103c]
call fcn.00401b44
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.00406477
mov ecx, eax
call fcn.00404a02
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 0x40d086
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402d78
push eax
lea ecx, [esi + 0x14]
mov byte [ebp - 4], 3
call fcn.00403827
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401582
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Error_opening_file__s.
push eax
call fcn.00403bde
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.00401bbc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.004040bd
jmp 0x40d3ed
cmp dword [esi + 0xc], ebx
je 0x40d3bf
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Copying_file__s.
push eax
call fcn.00403bde
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.00401bbc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
add ecx, 0x148
mov dword [edi], eax
call fcn.004040bd
mov edi, dword [ebp - 0x1038]
lea eax, [ebp - 0x1054]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d17f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1028]
call fcn.00402d78
mov ecx, dword [ebp - 0x1024]
push eax
add ecx, 0x14
mov byte [ebp - 4], 4
call fcn.00403827
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1028]
add ecx, 0xfffffff0
call fcn.00401582
mov eax, dword [ebp - 0x102c]
push dword [eax]
push str.Couldnt_get_file_size_of__s
lea eax, [ebp - 0x1018]
push eax
call fcn.00403bde
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.00401bbc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.004040bd
push dword [ebp - 0x1038]
jmp 0x40d3e7
push 0x414bd8
lea edx, [ebp - 0x1048]
lea ecx, [ebp - 0x1020]
call fcn.004033de
mov ecx, dword [ebp - 0x1024]
mov edx, eax
push ecx
lea ecx, [ebp - 0x1028]
mov byte [ebp - 4], 5
call fcn.00407099
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 6
call fcn.00403827
mov ecx, dword [ebp - 0x1028]
lea ecx, [ecx - 0x10]
call fcn.00401582
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1020]
lea ecx, [ecx - 0x10]
call fcn.00401582
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 0x40d24a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402d78
mov ecx, dword [ebp - 0x1024]
push eax
mov byte [ebp - 4], 7
lea ecx, [ecx + 0x14]
call fcn.00403827
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401582
push dword [ebp - 0x103c]
push str.Error_creating_file__s.
jmp 0x40d136
mov ecx, dword [ebp - 0x101c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1034], xmm0
lea ecx, [ecx + 0x148]
call fcn.00404172
test al, al
jne 0x40d3d4
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 0x40d395
cmp dword [ebp - 0x1040], 0
je 0x40d395
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 0x40d395
mov eax, dword [ebp - 0x1044]
cmp dword [ebp - 0x1040], eax
jne 0x40d395
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.00412010
mov edx, dword [ebp - 0x1050]
mov ecx, dword [ebp - 0x1054]
cvtsd2ss xmm0, xmm0
mulss xmm0, dword [0x416b80]
movss dword [ebp - 0x1030], xmm0
call fcn.00412010
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.00404172
mov edi, dword [ebp - 0x1038]
test al, al
je 0x40d286
jmp 0x40d3d4
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.00403827
jmp 0x40d3c5
mov esi, dword [ebp - 0x1018]
or dword [ebp - 0x1020], 0xffffffff
xor ebx, ebx
inc ebx
cmp edi, 0xffffffff
je 0x40d3ed
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1020]
cmp eax, 0xffffffff
je 0x40d3ed
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1048]
lea ecx, [ecx - 0x10]
call fcn.00401582
mov ecx, dword [ebp - 0x103c]
add ecx, 0xfffffff0
call fcn.00401582
lea ecx, [esi - 0x10]
call fcn.00401582
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.00410c70
leave
ret 4