Function at 0x4012ce
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x407004]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x3c], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x40], ecx
xor ecx, ecx
push ecx
push ecx
push 3
push ecx
push 3
push 0x80100000
mov edi, ecx
mov dword [ebp - 0x38], edx
push eax
mov dword [ebp - 0x24], ecx
mov ebx, ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x28], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401339
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_openning_source_file
mov ebx, eax
call fcn.0040302d
jmp 0x4014d4
lea eax, [ebp - 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40135f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_query_source_file_size
mov ebx, eax
call fcn.0040302d
jmp 0x4014cd
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
add ecx, 0xfffffff4
adc eax, 0xffffffff
test eax, eax
ja 0x4014bd
jb 0x401381
cmp ecx, 0x7ffffff4
ja 0x4014bd
push dword [ebp - 0x1c]
push 8
push dword [0x409acc]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x4013a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Cannot_allocate_memory_for_this_operation
jmp 0x401353
push 0
lea ecx, [ebp - 0xc]
push ecx
push dword [ebp - 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4013d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Error_reading_source_file
mov ebx, eax
call fcn.0040302d
jmp 0x401499
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x30]
lea esi, [ebp - 0x4c]
mov dword [ebp - 0x58], eax
xor ecx, ecx
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x34]
add eax, 0xc
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x38]
add eax, 0xfffffff4
or dword [ebp - 0x2c], 0xffffffff
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x14]
push eax
sub esp, 0xc
mov dword [ebp - 0x50], 1
mov edi, esp
mov dword [ebp - 0x14], ecx
sub esp, 0xc
mov dword [ebp - 0x10], ecx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov edi, esp
lea esi, [ebp - 0x58]
push ecx
push ecx
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, dword [0x409b04]
mov ecx, esi
call dword [0x4040b8]
call esi
mov dword [ebp - 0x24], eax
test eax, eax
je 0x40148b
push dword [ebp - 0x10]
push 8
push dword [0x409acc]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x40146e
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push edi
call fcn.004033a0
mov eax, dword [ebp - 0x10]
add esp, 0xc
mov dword [ebp - 0x20], eax
jmp 0x401476
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push dword [ebp - 0x14]
mov esi, dword [0x409b08]
mov ecx, esi
call dword [0x4040b8]
call esi
jmp 0x401496
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [ebp - 0x28]
mov ebx, eax
mov esi, dword [ebp - 0x2c]
push dword [ebp - 0x30]
mov eax, dword [ebp - 0x20]
push 0
push dword [0x409acc]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp esi, 0xffffffff
je 0x4014d4
jmp 0x4014cd
push 0xd
pop ebx
push 1
mov edx, str.Invalid_file_size
call fcn.00402f89
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x20]
push ebx
mov dword [eax], edi
mov eax, dword [ebp - 0x40]
mov dword [eax], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x24]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004031bd
leave
ret