Function at 0x404070
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x18
push esi
push edi
push 0xcf4
xor edi, edi
push edi
push ebx
call fcn.00422b50
lea esi, [ebx + 4]
mov eax, 0x32
mov dword [esi + 0x30], eax
mov dword [esi + 0x2c], eax
mov eax, 0x1388
or ecx, 0xffffffff
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov dword [esi + 0x10], edi
mov edi, dword [sym.imp.PAL.dll_PalSoundSetVolume]
push 1
push eax
mov dword [esi + 0xc], 1
mov dword [esi + 0x24], eax
mov dword [esi + 0x20], eax
mov dword [esi + 0x28], eax
mov dword [esi + 0x14], ecx
mov dword [esi + 0x18], ecx
mov dword [esi + 0x1c], ecx
call edi
mov eax, dword [esi + 0x20]
push 2
push eax
call edi
mov ecx, dword [esi + 0x28]
push 0
push ecx
call edi
lea edx, [esp + 0x38]
push edx
push 0x42d524
call dword [sym.imp.PAL.dll_PalFileCreate]
mov edi, eax
add esp, 0x2c
cmp edi, 0xffffffff
jne 0x40410c
push 0x42d740
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x14]
push 0
push 0
add eax, 4
push 0
push eax
push edi
call dword [sym.imp.PAL.dll_PalFileSetFilePointer]
add esp, 0x14
push 0
lea ecx, [esp + 0x14]
push ecx
push 4
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
lea edx, [esp + 0x14]
push edx
push 0x42d384
call dword [sym.imp.PAL.dll_PalFileCreate]
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
jne 0x40416e
push 0x42d76c
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x14]
push 0
push 0
add eax, 0xc
push 0
push eax
push esi
call dword [sym.imp.PAL.dll_PalFileSetFilePointer]
add esp, 0x14
push 0
lea ecx, [esp + 0x14]
push ecx
push 4
lea edx, [esp + 0x18]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call edi
cmp dword [esp + 0xc], 0x30d40
jbe 0x4041c1
push 0x30
push 0x42d798
push 0x42d7a0
call dword [sym.imp.PAL.dll_PalGetWindowHandle]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
push 1
push 0x61a8
mov dword [ebx + 0xce8], 0x61a8
call dword [sym.imp.PAL.dll_PalMemoryAlloc]
add esp, 8
test eax, eax
mov dword [ebx + 0xce4], eax
jne 0x4041fb
push 0x42d7e8
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x14]
push eax
push 0x42d378
call dword [sym.imp.PAL.dll_PalFileCreate]
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
jne 0x40422b
push 0x42d81c
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x14]
push 0
push 0
add ecx, 0xc
push 0
push ecx
push esi
call dword [sym.imp.PAL.dll_PalFileSetFilePointer]
add esp, 0x14
push 0
lea edx, [esp + 0x14]
push edx
push 4
lea eax, [esp + 0x18]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call edi
cmp dword [esp + 0xc], 0xffff
jb 0x40427e
push 0x30
push 0x42d798
push 0x42d848
call dword [sym.imp.PAL.dll_PalGetWindowHandle]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
push 1
push 0x1fff
mov dword [ebx + 0xcf0], 0x1fff
call dword [sym.imp.PAL.dll_PalMemoryAlloc]
add esp, 8
test eax, eax
mov dword [ebx + 0xcec], eax
jne 0x4042b8
push 0x42d890
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.00403f00
push 0x42d8c4
call dword [sym.imp.PAL.dll_PalErrorLogPrintf]
add esp, 4
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret