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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x1000405e
xor eax, eax
jmp 0x100042b6
push 0
push 0x208
call fcn.100042d0
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x1000407d
xor eax, eax
jmp 0x100042b6
push 0x104
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x100040ac
mov edx, dword [ebp - 8]
push edx
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
lea eax, [ebp - 0x28]
push eax
push 0
push 1
push 1
push 0
push 0x10006024
mov ecx, dword [ebp - 8]
push ecx
call fcn.100044d0
add esp, 0x1c
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x100040d8
cmp dword [ebp - 0x28], 0
jne 0x100040fd
cmp dword [ebp - 0x10], 0
je 0x100040ea
mov edx, dword [ebp - 0x10]
push edx
call fcn.10004380
add esp, 4
mov eax, dword [ebp - 8]
push eax
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
push 1
mov ecx, 4
imul edx, ecx, 0
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + edx]
push ecx
push 0
mov edx, dword [ebp - 8]
push edx
call fcn.10004760
add esp, 0x10
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
push eax
call fcn.10004380
add esp, 4
cmp dword [ebp - 0x20], 0
jne 0x10004144
mov ecx, dword [ebp - 8]
push ecx
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
push 1
push 0x10006028
mov edx, dword [ebp - 0x20]
push edx
call fcn.10004410
add esp, 0xc
mov byte [ebp - 1], al
mov eax, dword [ebp - 0x20]
push eax
call fcn.10004380
add esp, 4
movzx ecx, byte [ebp - 1]
test ecx, ecx
jne 0x10004181
mov edx, dword [ebp - 8]
push edx
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
push 0x104
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x100041b0
mov edx, dword [ebp - 8]
push edx
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.10004380
add esp, 4
cmp dword [ebp - 0xc], 0xffffffff
jne 0x100041e8
xor eax, eax
jmp 0x100042b6
push 0
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x10004203
cmp dword [ebp - 0x14], 0xffffffff
jne 0x10004214
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x100042b6
push 0
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.100042d0
add esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x10004239
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x100042b6
push 0
lea eax, [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x18]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x2c], 0
je 0x1000426c
mov edx, dword [ebp - 0x30]
cmp edx, dword [ebp - 0x14]
je 0x1000427c
mov eax, dword [ebp - 0x18]
push eax
call fcn.10004380
add esp, 4
xor eax, eax
jmp 0x100042b6
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.10001450
add esp, 4
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x18]
push edx
call fcn.10004380
add esp, 4
cmp dword [ebp - 0x1c], 0
jne 0x100042a1
xor eax, eax
jmp 0x100042b6
push 0
push 4
mov eax, dword [ebp - 0x1c]
push eax
call fcn.10001400
add esp, 0xc
mov dword [ebp - 0x34], eax
xor eax, eax
mov esp, ebp
pop ebp
ret