Function at 0x40b860
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, ecx
push edi
xor edi, edi
mov eax, dword [esi + 0x1acc]
mov ecx, dword [esi + 0x1ac0]
add eax, ecx
mov ecx, esi
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], edi
mov dword [esi + 0x1ab8], 1
mov dword [esp + 0x20], eax
call fcn.00407980
mov ebx, eax
cmp ebx, edi
jne 0x40b8b2
mov dword [esi + 0x1a9c], 7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esi + 0x1ad4]
mov dword [esp + 0x1c], eax
mov eax, dword [esi + 0x1ab8]
dec eax
cmp eax, 3
ja case.default.0x40b8c8
jmp dword [eax*4 + 0x40be08]
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
push ebp
mov ecx, esi
call fcn.0040c020
mov eax, dword [esi + 0x1a9c]
test eax, eax
je 0x40b8fe
cmp eax, 2
jne 0x40bd83
inc edi
cmp edi, 5
jg 0x40bce2
jmp 0x40b8d7
cmp byte [esi + 0x327c], 0x10
jne 0x40b919
cmp byte [esi + 0x3278], 0x5a
jne 0x40b919
cmp byte [esi + 0x3279], 0xa5
je 0x40b925
inc edi
cmp edi, 5
jg 0x40bce2
jmp 0x40b8d7
xor edi, edi
mov ecx, esi
mov dword [esp + 0x10], edi
call fcn.00406870
mov eax, dword [esi + 0x1a9c]
sub eax, edi
je 0x40b96e
sub eax, 4
je 0x40b94d
dec eax
je 0x40bd83
jmp case.default.0x40b8c8
mov eax, dword [esp + 0x14]
mov dword [esi + 0x1ab8], 1
inc eax
cmp eax, 5
mov dword [esp + 0x14], eax
jg 0x40bd2d
jmp case.default.0x40b8c8
mov dword [esi + 0x1ab8], 2
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], edi
jmp case.default.0x40b8c8
mov ecx, dword [esi + 0x1ac0]
push 0
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
mov ebp, eax
add esp, 0x10
test ebp, ebp
jl 0x40bd79
lea edi, [esi + 0x1ae8]
mov ecx, edi
call fcn.0040fa20
push 1
mov ecx, edi
call fcn.0040fd70
mov eax, dword [esi + 0x1b2c]
test eax, eax
jne 0x40bdea
mov edx, dword [esi + 0x1ad8]
mov eax, dword [esp + 0x18]
sub edx, 2
cmp eax, edx
jne 0x40b9ec
mov eax, dword [esp + 0x20]
sub eax, ebp
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x1c]
push ebx
push eax
lea ecx, [esi + 0x1e2f]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
mov edi, eax
mov al, byte [ebx + 0xc]
add esp, 0x10
test al, 0x20
jne 0x40bd11
test edi, edi
je 0x40bade
push 1
push 0
push ebx
call dword [sym.imp.MSVCRT.dll_fseek]
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
mov ebp, eax
add esp, 0x10
test ebp, ebp
jl 0x40bd79
mov edx, dword [esp + 0x18]
mov ecx, esi
push edx
push edi
call fcn.0040c180
mov eax, dword [esi + 0x1a9c]
test eax, eax
je 0x40ba6c
cmp eax, 2
jne 0x40bd83
mov eax, dword [esp + 0x10]
inc eax
cmp eax, 5
mov dword [esp + 0x10], eax
jg 0x40bce2
jmp 0x40ba38
cmp byte [esi + 0x327c], 0x11
jne 0x40ba58
cmp byte [esi + 0x3278], 0x5a
jne 0x40ba58
cmp byte [esi + 0x3279], 0xa5
jne 0x40ba58
mov ecx, esi
mov dword [esp + 0x10], 0
call fcn.00406870
mov eax, dword [esi + 0x1a9c]
test eax, eax
je 0x40babc
cmp eax, 4
jne 0x40ba38
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 5
mov dword [esp + 0x14], eax
jg 0x40bd2d
jmp 0x40ba38
mov eax, dword [esp + 0x18]
mov ecx, dword [esi + 0x1ad8]
inc eax
sub ecx, 2
cmp eax, ecx
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], eax
jle 0x40b9ad
mov dword [esi + 0x1ab8], 3
jmp case.default.0x40b8c8
mov ebp, dword [esi + 0x1ad8]
lea edi, [esi + 0x1ae8]
dec ebp
push 0
mov ecx, edi
mov dword [esp + 0x1c], ebp
call fcn.0040fa60
mov edx, dword [0x41a8dc]
push edx
push edi
call fcn.0040fb70
mov edi, dword [esp + 0x18]
add esp, 8
push ebp
mov ecx, esi
call fcn.0040c250
mov eax, dword [esi + 0x1a9c]
test eax, eax
je 0x40bb42
cmp eax, 2
jne 0x40bd83
inc edi
cmp edi, 5
jg 0x40bce2
jmp 0x40bb1b
cmp byte [esi + 0x327c], 0x12
jne 0x40bb5d
cmp byte [esi + 0x3278], 0x5a
jne 0x40bb5d
cmp byte [esi + 0x3279], 0xa5
je 0x40bb69
inc edi
cmp edi, 5
jg 0x40bce2
jmp 0x40bb1b
mov al, byte [esi + 0x327f]
mov dword [esp + 0x10], 0
cmp al, 0xf0
je 0x40bd5c
cmp al, 0xf1
je 0x40bd95
cmp al, 0xf2
je 0x40bda3
test al, al
jne 0x40bbb4
mov eax, dword [esp + 0x14]
mov dword [esi + 0x1ab8], 3
inc eax
cmp eax, 5
mov dword [esp + 0x14], eax
jg 0x40bdb1
jmp case.default.0x40b8c8
cmp al, 1
je 0x40bcc6
cmp al, 2
jne case.default.0x40b8c8
mov dword [esp + 0x14], 0
mov dword [esi + 0x1ab8], 4
jmp case.default.0x40b8c8
mov ecx, esi
xor edi, edi
call fcn.0040be20
mov eax, dword [esi + 0x1a9c]
test eax, eax
jne 0x40bd83
cmp byte [esi + 0x327c], 0x1f
jne 0x40bd79
lea eax, [esi + 0x327d]
mov ecx, esi
push eax
call fcn.00406150
and eax, 0xffff
mov dword [esi + 0x1ad8], eax
jne 0x40bc24
mov dword [esi + 0x1ad8], 1
mov ecx, dword [esi + 0x1ad8]
lea ebp, [esi + 0x1ae8]
push 1
push ecx
push 0
mov ecx, ebp
call fcn.0040f9c0
cmp edi, dword [esi + 0x1ad8]
jge 0x40bc62
mov ecx, ebp
call fcn.0040fa20
push 1
mov ecx, ebp
call fcn.0040fd70
mov eax, dword [esi + 0x1b2c]
test eax, eax
jne 0x40bdea
mov ecx, esi
call fcn.0040be20
mov eax, dword [esi + 0x1a9c]
test eax, eax
jne 0x40bd83
lea edx, [esi + 0x327f]
mov ecx, esi
push edx
call fcn.00406150
mov di, ax
mov eax, dword [esi + 0x1ad8]
and edi, 0xffff
cmp edi, eax
jle 0x40bc42
mov al, byte [esi + 0x327f]
cmp al, 0xf0
je 0x40bd5c
cmp al, 0xf1
je 0x40bd95
cmp al, 0xf2
je 0x40bda3
test al, al
je 0x40bdb1
cmp al, 1
jne case.default.0x40b8c8
push ebx
mov dword [esi + 0x1a9c], 0
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov ecx, dword [0x41a980]
mov eax, dword [0x41a92c]
push 0x10
push str.KHSimulator_Message
mov edx, dword [ecx + 0x20]
push eax
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esi + 0x1a9c], 5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov ecx, dword [0x41a980]
mov eax, dword [0x41a7bc]
add esp, 4
mov edx, dword [ecx + 0x20]
push 0x10
push str.KHSimulator_Message
push eax
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [0x41a7dc]
push 0x10
push str.KHSimulator_Message
mov ecx, dword [0x41a980]
push eax
mov edx, dword [ecx + 0x20]
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
mov dword [esi + 0x1a9c], 5
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [0x41a7e0]
push 0x10
push str.KHSimulator_Message
jmp 0x40bd68
mov eax, dword [0x41a7e4]
push 0x10
push str.KHSimulator_Message
jmp 0x40bd68
mov ecx, dword [0x41a980]
mov eax, dword [0x41a7d0]
push 0x10
push str.KHSimulator_Message
mov edx, dword [ecx + 0x20]
push eax
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
push ebx
mov dword [esi + 0x1a9c], 4
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esi + 0x1a9c], 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret