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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea edx, [ebp - 0x20]
mov dword [esp], edx
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
call fcn.0041c900
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
sub esp, 0x1c
cmp eax, 0xffffffff
mov esi, eax
je 0x418240
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub esp, 8
test eax, eax
mov ebx, eax
jne 0x418120
xor ebx, ebx
xor edi, edi
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 0xc]
mov dword [eax], ebx
sub esp, 4
mov eax, dword [ebp - 0x20]
lea ebx, [eax - 0xc]
cmp ebx, 0x4b0f34
jne 0x418302
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [eax + 1]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edi, eax
je 0x418177
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x41815d
cmp dword [ebp - 0x1c], ebx
je 0x4180f2
test byte [0x4f3060], 0x80
jne 0x418247
mov dword [esp], edi
call fcn.0049f980
jmp 0x4180ee
test byte [0x4f3060], 0x80
je 0x4180ee
mov ecx, dword [sym.imp.msvcrt.dll__errno]
mov dword [ebp - 0x34], ecx
call ecx
mov eax, dword [eax]
mov dword [esp], 0x4f3068
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x30], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x30]
mov dword [esp + 8], str.load_file
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
mov ecx, dword [ebp - 0x34]
mov dword [ebp - 0x30], ecx
call ecx
mov ecx, dword [ebp - 0x2c]
mov dword [eax], ecx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], ebx
xor ebx, ebx
mov dword [esp + 4], str.load_file:_could_not_allocate__ld_bytes_n
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
mov edx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [edx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x30]
sub esp, 4
call ecx
mov ecx, dword [ebp - 0x2c]
mov dword [eax], ecx
jmp 0x4180f2
xor edi, edi
jmp 0x418103
mov ecx, dword [sym.imp.msvcrt.dll__errno]
mov dword [ebp - 0x34], ecx
call ecx
mov eax, dword [eax]
mov dword [esp], 0x4f3068
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x30], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x30]
mov dword [esp + 8], str.load_file
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
mov ecx, dword [ebp - 0x34]
mov dword [ebp - 0x30], ecx
call ecx
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp + 8]
mov dword [eax], ecx
mov dword [esp + 0xc], edx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.load_file:_could_not_read__ld_bytes_from__s_n
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
mov edx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [edx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x30]
sub esp, 4
call ecx
mov ecx, dword [ebp - 0x2c]
mov dword [eax], ecx
jmp 0x41816a
sub eax, 4
call fcn.004ab77c
test eax, eax
jg 0x418115
lea eax, [ebp - 0x1c]
mov ecx, ebx
mov dword [esp], eax
call fcn.004a31a0
push eax
jmp 0x418115