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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42f2f5
mov eax, dword fs:[0]
push eax
mov eax, 0x1048
call fcn.0042ca10
mov eax, dword [0x43d00c]
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.004015b8
push eax
lea ecx, [ebp - 0x1018]
call fcn.00401c55
mov dword [ebp - 4], ebx
call fcn.004015b8
push eax
lea ecx, [ebp - 0x103c]
call fcn.00401c55
lea eax, [ebp - 0x1048]
mov byte [ebp - 4], 1
push eax
push dword [edi + 0x14c]
lea ecx, [edi + 8]
mov dword [ebp - 0x1040], ebx
mov dword [ebp - 0x1044], ebx
call fcn.00406908
mov ecx, eax
call fcn.00404fac
push ebx
push ebx
push 3
push ebx
push 3
lea eax, [esi + 4]
mov byte [ebp - 4], 2
push SysReAllocString
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 0x40d4f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402ef5
push eax
lea ecx, [esi + 0x14]
mov byte [ebp - 4], 3
call fcn.00403de0
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401592
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Error_opening_file__s.
push eax
call fcn.004041d6
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.00401ccd
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x158]
call fcn.004047b2
jmp 0x40d85a
cmp dword [esi + 0xc], ebx
je 0x40d82c
push dword [esi + 4]
lea eax, [ebp - 0x1018]
push str.Copying_file__s.
push eax
call fcn.004041d6
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.00401ccd
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
add ecx, 0x158
mov dword [edi], eax
call fcn.004047b2
mov edi, dword [ebp - 0x1038]
lea eax, [ebp - 0x1054]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d5ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x1028]
call fcn.00402ef5
mov ecx, dword [ebp - 0x1024]
push eax
add ecx, 0x14
mov byte [ebp - 4], 4
call fcn.00403de0
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1028]
add ecx, 0xfffffff0
call fcn.00401592
mov eax, dword [ebp - 0x102c]
push dword [eax]
push str.Couldnt_get_file_size_of__s
lea eax, [ebp - 0x1018]
push eax
call fcn.004041d6
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.00401ccd
mov ecx, dword [ebp - 0x101c]
add eax, 0x10
mov dword [edi], eax
lea ecx, [ecx + 0x158]
call fcn.004047b2
push dword [ebp - 0x1038]
jmp 0x40d854
push 0x436638
lea edx, [ebp - 0x1048]
lea ecx, [ebp - 0x1020]
call fcn.004039c4
mov ecx, dword [ebp - 0x1024]
mov edx, eax
push ecx
lea ecx, [ebp - 0x1028]
mov byte [ebp - 4], 5
call fcn.00403a35
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x103c]
mov byte [ebp - 4], 6
call fcn.00403de0
mov ecx, dword [ebp - 0x1028]
lea ecx, [ecx - 0x10]
call fcn.00401592
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x1020]
lea ecx, [ecx - 0x10]
call fcn.00401592
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 0x40d6b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea ecx, [ebp - 0x102c]
call fcn.00402ef5
mov ecx, dword [ebp - 0x1024]
push eax
mov byte [ebp - 4], 7
lea ecx, [ecx + 0x14]
call fcn.00403de0
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x102c]
add ecx, 0xfffffff0
call fcn.00401592
push dword [ebp - 0x103c]
push str.Error_creating_file__s.
jmp 0x40d5a3
mov ecx, dword [ebp - 0x101c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1034], xmm0
lea ecx, [ecx + 0x158]
call fcn.00404867
test al, al
jne 0x40d841
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 0x40d802
cmp dword [ebp - 0x1040], 0
je 0x40d802
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 0x40d802
mov eax, dword [ebp - 0x1044]
cmp dword [ebp - 0x1040], eax
jne 0x40d802
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.0042dc30
mov edx, dword [ebp - 0x1050]
mov ecx, dword [ebp - 0x1054]
cvtsd2ss xmm0, xmm0
mulss xmm0, dword [0x438638]
movss dword [ebp - 0x1030], xmm0
call fcn.0042dc30
movss xmm1, dword [ebp - 0x1030]
cvtsd2ss xmm0, xmm0
mov eax, dword [ebp - 0x101c]
add eax, 0x158
push eax
divss xmm1, xmm0
cvttss2si edi, xmm1
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x101c]
add eax, 0x158
push eax
mov dword [eax + 0x28], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x101c]
lea ecx, [ecx + 0x158]
call fcn.00404867
mov edi, dword [ebp - 0x1038]
test al, al
je 0x40d6f3
jmp 0x40d841
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.00403de0
jmp 0x40d832
mov esi, dword [ebp - 0x1018]
or dword [ebp - 0x1020], 0xffffffff
xor ebx, ebx
inc ebx
cmp edi, 0xffffffff
je 0x40d85a
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1020]
cmp eax, 0xffffffff
je 0x40d85a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1048]
lea ecx, [ecx - 0x10]
call fcn.00401592
mov ecx, dword [ebp - 0x103c]
add ecx, 0xfffffff0
call fcn.00401592
lea ecx, [esi - 0x10]
call fcn.00401592
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.00412c09
leave
ret 4