Function at 0x406290
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push ebp
push 0x20
mov esi, eax
push 0x8000
lea eax, [esp + 0x24]
push esi
push eax
call fcn.0050b93b
add esp, 0x14
test eax, eax
je 0x4062d5
push esi
push str.Cant_open_file__s_n
mov edi, 0x59e710
call fcn.0040b3d0
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8
mov ecx, dword [esp + 0x18]
push 2
push ebp
push ecx
call fcn.0050b9d0
mov ebx, eax
add esp, 0xc
mov dword [esp + 0x28], ebx
cmp ebx, 0xffffffff
jne 0x40630f
push str._nFileLength___1_____n
mov edi, 0x59e710
call fcn.0040b3d0
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8
mov edx, dword [esp + 0x18]
push ebp
push ebp
push edx
call fcn.0050b9d0
add esp, 0xc
push ebx
call fcn.0050bafb
mov edi, eax
add esp, 4
cmp edi, ebp
jne 0x406334
push str._nCouldnt_allocate_enough_memory_for_file._n
jmp 0x4062f5
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x18]
mov eax, dword [esi + 0x58]
push ebx
push edi
push ecx
mov dword [esp + 0x30], ebp
mov dword [esp + 0x28], eax
call fcn.0050c187
mov edx, dword [esp + 0x24]
add esp, 0xc
push edx
call fcn.0050c320
add esp, 4
cmp dword [esp + 0x34], 1
jne 0x406774
xor esi, esi
cmp ebx, ebp
jbe 0x4066f8
mov al, byte [esi + edi]
cmp al, 0xd
jne 0x406381
inc esi
jmp 0x4066f0
cmp al, 0xa
jne 0x40638b
inc esi
jmp 0x4066f0
cmp al, 0x3a
jne 0x406725
mov al, byte [esi + edi + 1]
inc esi
inc esi
call fcn.00406240
mov bl, al
mov al, byte [esi + edi]
shl bl, 4
call fcn.00406240
or bl, al
mov al, byte [esi + edi + 1]
inc esi
mov byte [esp + 0x34], bl
inc esi
call fcn.00406240
movzx ax, al
shl ax, 4
movzx ebx, ax
mov al, byte [esi + edi]
inc esi
call fcn.00406240
movzx cx, al
mov al, byte [esi + edi]
or cx, bx
shl cx, 4
movzx ebx, cx
inc esi
call fcn.00406240
movzx dx, al
mov al, byte [esi + edi]
or dx, bx
shl dx, 4
movzx ebx, dx
inc esi
call fcn.00406240
movzx eax, al
movzx ecx, bx
movzx edx, bp
or eax, ecx
sub eax, edx
add ebp, eax
mov al, byte [esi + edi]
inc esi
call fcn.00406240
mov bl, al
mov al, byte [esi + edi]
shl bl, 4
call fcn.00406240
or bl, al
inc esi
test bl, bl
jne 0x406543
movzx eax, byte [esp + 0x34]
mov ebx, dword [esp + 0x1c]
mov ecx, eax
mov eax, dword [esp + 0x30]
sub ecx, dword [eax + 0x5c]
mov dword [esp + 0x24], 1
add ecx, ebp
cmp ecx, ebx
jbe 0x4064a8
mov edi, edi
test ebx, ebx
jne 0x406463
mov edx, dword [esp + 0x28]
lea ecx, [edx + edx]
mov dword [esp + 0x1c], ecx
mov ebx, ecx
jmp 0x406469
add ebx, ebx
mov dword [esp + 0x1c], ebx
mov edx, dword [eax + 0x54]
push ebx
push edx
call fcn.0050af35
mov ecx, dword [esp + 0x38]
add esp, 8
mov dword [ecx + 0x54], eax
test eax, eax
je 0x40674a
push ebx
push 0xff
push eax
call fcn.0050e990
movzx eax, byte [esp + 0x40]
mov edx, dword [esp + 0x3c]
sub eax, dword [edx + 0x5c]
add esp, 0xc
add eax, ebp
cmp eax, ebx
mov eax, edx
ja 0x406450
movzx edx, byte [esp + 0x34]
mov ecx, edx
sub ecx, dword [eax + 0x5c]
add ecx, ebp
cmp ecx, dword [eax + 0x58]
jbe 0x4064bc
mov dword [eax + 0x58], ecx
mov dword [esp + 0x14], 0
test edx, edx
jle 0x4066e3
mov dword [esp + 0x20], ebp
mov al, byte [esi + edi]
inc esi
call fcn.00406240
mov bl, al
mov al, byte [esi + edi]
shl bl, 4
call fcn.00406240
or bl, al
mov eax, dword [esp + 0x20]
inc esi
cmp eax, 0x2fc
jne 0x4064f8
mov bl, 0x21
jmp 0x406517
cmp eax, 0x2fd
jne 0x406503
mov bl, 0x43
jmp 0x406517
cmp eax, 0x2fe
jne 0x40650e
mov bl, 0x65
jmp 0x406517
cmp eax, 0x2ff
jne 0x406517
mov bl, 0x87
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
inc dword [esp + 0x20]
mov edx, eax
sub edx, dword [ecx + 0x5c]
mov ecx, dword [ecx + 0x54]
add edx, ebp
mov byte [edx + ecx], bl
movzx ecx, byte [esp + 0x34]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x4064d0
jmp 0x4066e3
cmp bl, 1
je 0x4066f8
cmp bl, 2
jne 0x40658b
movzx eax, byte [esp + 0x34]
add eax, eax
xor ebx, ebx
mov dword [esp + 0x34], eax
test eax, eax
jle 0x406583
mov al, byte [esi + edi]
shl ebp, 4
call fcn.00406240
test ebx, ebx
jne 0x406576
movzx ebp, al
jmp 0x40657b
movzx edx, al
or ebp, edx
inc ebx
inc esi
cmp ebx, dword [esp + 0x34]
jl 0x406562
shl ebp, 4
jmp 0x4066e3
cmp bl, 3
jne 0x4065ea
movzx eax, byte [esp + 0x34]
xor ebx, ebx
add eax, eax
cmp eax, ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x34], eax
jle 0x4065d1
mov al, byte [esi + edi]
shl ebx, 4
call fcn.00406240
cmp dword [esp + 0x14], 0
jne 0x4065bc
movzx ebx, al
jmp 0x4065c1
movzx eax, al
or ebx, eax
mov eax, dword [esp + 0x14]
inc eax
inc esi
cmp eax, dword [esp + 0x34]
mov dword [esp + 0x14], eax
jl 0x4065a5
mov eax, dword [esp + 0x30]
mov ecx, ebx
shr ecx, 0x10
movzx edx, bx
shl ecx, 4
add ecx, edx
mov dword [eax + 0x60], ecx
jmp 0x4066e3
cmp bl, 4
jne 0x406692
movzx eax, byte [esp + 0x34]
add eax, eax
xor ebx, ebx
mov dword [esp + 0x34], eax
test eax, eax
jle 0x406625
mov al, byte [esi + edi]
shl ebp, 4
call fcn.00406240
test ebx, ebx
jne 0x406618
movzx ebp, al
jmp 0x40661d
movzx ecx, al
or ebp, ecx
inc ebx
inc esi
cmp ebx, dword [esp + 0x34]
jl 0x406604
shl ebp, 0x10
cmp dword [esp + 0x24], 0
jne 0x406643
mov eax, dword [esp + 0x30]
mov edx, ebp
and edx, 0xffc00000
mov dword [eax + 0x5c], edx
jmp 0x4066e3
mov ebx, dword [esp + 0x30]
mov ecx, ebp
and ecx, 0xffc00000
cmp ecx, dword [ebx + 0x5c]
je 0x4066e3
push edi
call fcn.0050ab22
add esp, 4
push str.New_Extended_Linear_Address_Record__04__out_of_memory_range_n
mov edi, 0x59e710
call fcn.0040b3d0
mov edx, dword [ebx + 0x5c]
add esp, 4
push ebp
push edx
push str.Current_Memory_starts_at:_0x_08X__new_Address_is:_0x_08X
call fcn.0040b3d0
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8
cmp bl, 5
jne 0x40675d
movzx eax, byte [esp + 0x34]
xor ebx, ebx
add eax, eax
cmp eax, ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x34], eax
jle 0x4066dc
mov al, byte [esi + edi]
shl ebx, 4
call fcn.00406240
cmp dword [esp + 0x14], 0
jne 0x4066c7
movzx ebx, al
jmp 0x4066cc
movzx edx, al
or ebx, edx
mov eax, dword [esp + 0x14]
inc eax
inc esi
cmp eax, dword [esp + 0x34]
mov dword [esp + 0x14], eax
jl 0x4066b0
mov eax, dword [esp + 0x30]
mov dword [eax + 0x60], ebx
mov cl, byte [esi + edi]
inc esi
cmp cl, 0xa
jne 0x4066e3
mov ebx, dword [esp + 0x28]
cmp esi, ebx
jb 0x406374
mov esi, dword [esp + 0x30]
push edi
call fcn.0050ab22
mov eax, dword [esi + 0x58]
add esp, 4
test al, 3
je 0x406719
add eax, 3
shr eax, 2
add eax, eax
add eax, eax
mov dword [esi + 0x58], eax
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8
movzx eax, byte [esi + edi]
push eax
push eax
push str.Missing_start_of_record__:__wrong_byte__c____02X_n
mov edi, 0x59e710
call fcn.0040b3d0
add esp, 0xc
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x1c
ret 8
push edi
call fcn.0050ab22
add esp, 4
push str.LoadFile_realloc_func_failed_n
jmp 0x4062f5
push edi
call fcn.0050ab22
movzx eax, bl
add esp, 4
push eax
push str.Error_RecordType__02X_not_yet_implemented_n
jmp 0x4062bb
mov dword [esi + 0x54], edi
mov dword [esi + 0x58], ebx
jmp 0x4066fc