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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x414dd4
mov eax, dword fs:[0]
push eax
mov eax, 0x1048
call fcn.004138f0
mov eax, dword [0x41d00c]
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.00401b54
mov dword [ebp - 4], ebx
call fcn.004015a8
push eax
lea ecx, [ebp - 0x103c]
call fcn.00401b54
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.0040635a
mov ecx, eax
call fcn.00404a08
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 0x40ce9e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402d58
push eax
lea ecx, [esi + 0x14]
mov byte [ebp - 4], 3
call fcn.00403895
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.00403c4c
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.00401bcc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.0040412b
jmp 0x40d205
cmp dword [esi + 0xc], ebx
je 0x40d1d7
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Copying_file__s.
push eax
call fcn.00403c4c
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.00401bcc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
add ecx, 0x148
mov dword [edi], eax
call fcn.0040412b
mov edi, dword [ebp - 0x1038]
lea eax, [ebp - 0x1054]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40cf97
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1028]
call fcn.00402d58
mov ecx, dword [ebp - 0x1024]
push eax
add ecx, 0x14
mov byte [ebp - 4], 4
call fcn.00403895
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.00403c4c
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.00401bcc
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x148]
call fcn.0040412b
push dword [ebp - 0x1038]
jmp 0x40d1ff
push 0x416c08
lea edx, [ebp - 0x1048]
lea ecx, [ebp - 0x1020]
call fcn.0040344c
mov ecx, dword [ebp - 0x1024]
mov edx, eax
push ecx
lea ecx, [ebp - 0x1028]
mov byte [ebp - 4], 5
call fcn.00406f7c
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 6
call fcn.00403895
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 0x40d062
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402d58
mov ecx, dword [ebp - 0x1024]
push eax
mov byte [ebp - 4], 7
lea ecx, [ecx + 0x14]
call fcn.00403895
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 0x40cf4e
mov ecx, dword [ebp - 0x101c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1034], xmm0
lea ecx, [ecx + 0x148]
call fcn.004041e0
test al, al
jne 0x40d1ec
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 0x40d1ad
cmp dword [ebp - 0x1040], 0
je 0x40d1ad
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 0x40d1ad
mov eax, dword [ebp - 0x1044]
cmp dword [ebp - 0x1040], eax
jne 0x40d1ad
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.00413980
mov edx, dword [ebp - 0x1050]
mov ecx, dword [ebp - 0x1054]
cvtsd2ss xmm0, xmm0
mulss xmm0, dword [0x418b78]
movss dword [ebp - 0x1030], xmm0
call fcn.00413980
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.004041e0
mov edi, dword [ebp - 0x1038]
test al, al
je 0x40d09e
jmp 0x40d1ec
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.00403895
jmp 0x40d1dd
mov esi, dword [ebp - 0x1018]
or dword [ebp - 0x1020], 0xffffffff
xor ebx, ebx
inc ebx
cmp edi, 0xffffffff
je 0x40d205
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1020]
cmp eax, 0xffffffff
je 0x40d205
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.004125d0
leave
ret 4