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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10d0
call fcn.0042b680
push ebx
push esi
push edi
push 1
pop ebx
mov edi, ecx
push dword [ebp + 0xc]
xor esi, esi
mov eax, dword [edi + 0x2c]
mov dword [ebp - 4], ebx
push str.Load_model___s_
mov dword [ebp - 8], eax
push dword [edi + 0xf0]
call fcn.0041e63d
add esp, 0xc
lea eax, [ebp - 0xd0]
push 0x20
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_OpenFile]
cmp eax, 0xffffffff
mov dword [ebp - 0x38], eax
jne 0x429792
lea eax, [ebp - 0x10d0]
push 0x1000
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
push str.Failed_to_open_model_file____s
push dword [edi + 0xf0]
call fcn.0041e63d
add esp, 0xc
mov ax, bx
jmp 0x429bfc
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4297b9
push str.Failed_to_read_model_file
push dword [edi + 0xf0]
call fcn.0041e63d
pop ecx
pop ecx
jmp 0x429bc4
cmp ebx, 0x20
ja 0x4297ca
mov dword [ebp - 4], 2
jmp 0x429bc4
push ebx
call fcn.0042b798
mov esi, eax
pop ecx
test esi, esi
jne 0x4297de
push str.Failed_to_allocate_memory_for_model_file
jmp 0x4297a7
lea eax, [ebp - 0x48]
push 0
push eax
push ebx
push esi
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x429b95
cmp ebx, dword [ebp - 0x48]
jne 0x429b95
add ebx, esi
cmp dword [esi], 0x444d4644
mov dword [ebp - 0x28], ebx
jne 0x4297be
mov al, byte [esi + 5]
test al, al
je 0x429835
movzx ecx, byte [esi + 4]
movzx eax, al
push ecx
push eax
push str.Model_file_version_is_incorrect__version__u._u_
push dword [edi + 0xf0]
call fcn.0041e63d
add esp, 0x10
jmp 0x429bc4
movzx ecx, word [esi + 8]
movzx eax, word [esi + 6]
imul ecx, ecx, 0x42
lea eax, [eax + eax*2]
mov ebx, dword [esi + 0x14]
imul ebx, ebx, 0xe
lea eax, [esi + eax*4 + 0x20]
mov dword [ebp - 0x3c], eax
add ecx, eax
movzx eax, word [esi + 0xa]
mov dword [ebp - 0x24], ecx
lea edx, [eax + eax*2]
imul eax, eax, 0x81
lea edx, [ecx + edx*4]
add eax, edx
mov dword [ebp - 0x10], edx
mov dword [ebp + 0xc], eax
mov ax, word [esi + 0xc]
mov dword [ebp - 0x14], eax
movzx eax, ax
imul eax, eax, 0x22
add eax, dword [ebp + 0xc]
mov dword [ebp - 0x44], eax
add ebx, eax
movzx eax, word [esi + 0xe]
lea edx, [ebx + eax*8]
movzx eax, word [esi + 0x10]
shl eax, 4
add eax, edx
cmp word [ebp - 0x14], 0
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x30], eax
je 0x4298aa
movzx edx, word [esi + 6]
add edx, eax
mov dword [ebp - 0x18], edx
jmp 0x4298ad
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x28]
ja 0x4297be
and dword [ebp - 0xc], 0
cmp word [esi + 0x12], 0
mov dword [ebp - 0x2c], eax
jbe 0x42996d
add eax, 4
cmp eax, dword [ebp - 0x28]
ja 0x4297be
mov eax, dword [ebp - 0x2c]
movzx edx, word [eax]
lea edx, [eax + edx*2 + 4]
mov dword [ebp - 0x34], edx
mov edx, dword [ebp - 0x28]
cmp dword [ebp - 0x34], edx
ja 0x4297be
mov dx, word [esi + 0xa]
cmp word [eax + 2], dx
jae 0x4297be
and dword [ebp - 0x20], 0
cmp word [eax], 0
jbe 0x429956
movzx ecx, word [ebp - 0x20]
mov cx, word [eax + ecx*2 + 4]
movzx eax, cx
imul eax, eax, 0x42
add eax, dword [ebp - 0x3c]
cmp cx, word [esi + 8]
jae 0x4297be
and dword [ebp - 0x1c], 0
movzx edx, word [ebp - 0x1c]
mov cx, word [esi + 6]
cmp word [eax + edx*2], cx
jae 0x4297be
inc dword [ebp - 0x1c]
cmp word [ebp - 0x1c], 3
jb 0x429928
inc dword [ebp - 0x20]
mov eax, dword [ebp - 0x2c]
mov cx, word [ebp - 0x20]
cmp cx, word [eax]
jb 0x429908
mov ecx, dword [ebp - 0x24]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0x34]
mov dx, word [ebp - 0xc]
mov dword [ebp - 0x2c], eax
cmp dx, word [esi + 0x12]
jb 0x4298cb
mov eax, dword [ebp - 0x10]
xor edx, edx
cmp word [esi + 0xa], dx
mov dword [ebp - 0xc], eax
jbe 0x42999e
mov eax, dword [ebp - 0xc]
cmp byte [eax], 0
je 0x429990
movzx eax, dx
lea eax, [eax + eax*2]
mov dword [ecx + eax*4], 0xffffff
add dword [ebp - 0xc], 0x81
inc edx
cmp dx, word [esi + 0xa]
jb 0x42997b
movzx eax, word [esi + 0xa]
mov edx, dword [ebp - 8]
add eax, edx
lea edx, [edi + 0x28]
cmp eax, dword [edx]
jbe 0x4299d3
add eax, 0xa
push 0xc
push eax
lea eax, [edi + 0x24]
push edx
push eax
call fcn.00424f40
add esp, 0x10
test ax, ax
je 0x4299d0
push str.Failed_to_allocate_memory_for_colour_list
jmp 0x4297a7
mov ecx, dword [ebp - 0x24]
movzx eax, word [esi + 0xa]
lea eax, [eax + eax*2]
shl eax, 2
push eax
mov eax, dword [ebp - 8]
push ecx
mov ecx, dword [edi + 0x24]
lea eax, [eax + eax*2]
lea eax, [ecx + eax*4]
push eax
call fcn.0042b2e0
movzx eax, word [esi + 0xa]
add dword [edi + 0x2c], eax
mov eax, dword [edi + 0x88]
lea ecx, [edi + 0x88]
add esp, 0xc
cmp dword [edi + 0x84], eax
jne 0x429a32
inc eax
push 0x28
push eax
lea eax, [edi + 0x80]
push ecx
push eax
call fcn.00424f40
add esp, 0x10
test ax, ax
je 0x429a32
push str.Failed_to_allocate_memory_for_model_file_list
jmp 0x4297a7
mov ecx, dword [edi + 0x84]
mov edx, dword [edi + 0x80]
mov dword [ebp - 0x24], ecx
lea eax, [ecx + 1]
mov dword [edi + 0x84], eax
lea eax, [ecx + ecx*4]
lea eax, [edx + eax*8]
mov edx, dword [ebp - 8]
mov dword [eax + 0x24], edx
mov edx, dword [ebp - 0x3c]
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x10]
mov dword [eax + 8], edx
mov edx, dword [ebp + 0xc]
mov dword [eax + 0xc], edx
mov edx, dword [ebp - 0x44]
mov dword [eax + 0x10], edx
mov edx, dword [ebp - 0x40]
mov dword [eax + 0x18], edx
mov edx, dword [ebp - 0x30]
mov dword [eax + 0x1c], edx
mov edx, dword [ebp - 0x18]
mov dword [eax], esi
mov dword [eax + 0x14], ebx
mov ebx, dword [ebp + 8]
mov dword [eax + 0x20], edx
cmp ebx, dword [edi + 0x90]
lea eax, [edi + 0x90]
jb 0x429abe
lea ecx, [ebx + 1]
push 0x24
push ecx
push eax
lea eax, [edi + 0x8c]
push eax
call fcn.00424f40
add esp, 0x10
test ax, ax
je 0x429abb
push str.Failed_to_allocate_memory_for_models_list
jmp 0x4297a7
mov ecx, dword [ebp - 0x24]
mov edx, dword [edi + 0x8c]
lea eax, [ebx + ebx*8]
lea ebx, [edx + eax*4]
mov dword [ebx], ecx
mov eax, dword [edi + 0x38]
mov dword [ebx + 0xc], eax
mov eax, dword [edi + 0x50]
and dword [ebx + 0x20], 0
mov dword [ebx + 0x10], eax
movzx eax, word [esi + 6]
lea eax, [eax + eax*2]
shl eax, 2
push eax
call fcn.0042b798
test eax, eax
pop ecx
mov dword [ebx + 8], eax
jne 0x429afe
push str.Failed_to_allocate_memory_for_vertex_list
jmp 0x4297a7
cmp word [ebp - 0x14], 0
je 0x429b74
movzx eax, word [ebp - 0x14]
mov dword [ebp - 0x30], eax
imul eax, eax, 0x84
push eax
call fcn.0042b798
test eax, eax
pop ecx
mov dword [ebp - 8], eax
jne 0x429b2a
push str.Failed_to_allocate_memory_for_model_transformation_list
jmp 0x4297a7
cmp word [ebp - 0x14], 0
mov dword [ebx + 4], eax
jbe 0x429b74
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x30]
add ecx, 0xc
mov dword [ebp - 0x10], edx
mov dword [ebp + 8], ecx
jmp 0x429b4b
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 8]
mov dl, byte [ecx + 0x14]
push eax
push ecx
mov ecx, edi
push dword [ebp + 0xc]
mov byte [eax + 0x80], dl
call fcn.0042ae1b
add dword [ebp + 0xc], 0x22
add dword [ebp + 8], 0x22
add dword [ebp - 8], 0x84
dec dword [ebp - 0x10]
jne 0x429b45
fld1
push ecx
mov ecx, edi
fstp dword [esp]
push dword [ebp - 0x40]
push ebx
call fcn.00427d0e
push 1
push ebx
mov ecx, edi
call fcn.00427e20
and dword [ebp - 4], 0
jmp 0x429bc4
lea eax, [ebp - 0x10d0]
push 0x1000
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00424a92
add esp, 0xc
push eax
push str.Failed_to_read_model_file____s
push dword [edi + 0xf0]
call fcn.0041e63d
add esp, 0xc
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp word [ebp - 4], 0
je 0x429bdf
test esi, esi
je 0x429bdf
push esi
call fcn.0042b6af
pop ecx
cmp word [ebp - 4], 2
jne 0x429bf8
push str.Model_file_is_corrupt
push dword [edi + 0xf0]
call fcn.0041e63d
pop ecx
pop ecx
mov ax, word [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 8