Function at 0x405dea
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0xc], 0
jmp 0x40601a
mov word [ebp - 0x1a], 0
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 2
lea eax, [ebp - 0x1a]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 1
setne al
test al, al
je 0x405e39
mov eax, dword [ebp - 0xc]
jmp 0x406035
movzx eax, word [ebp - 0x1a]
test ax, ax
jne 0x405e4d
mov eax, dword [ebp - 0xc]
add eax, 2
jmp 0x406035
mov byte [ebp - 0x1b], 0
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp - 0x1b]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 1
setne al
test al, al
je 0x405e85
mov eax, dword [ebp - 0xc]
jmp 0x406035
movzx eax, byte [ebp - 0x1b]
movzx eax, al
movzx edx, word [ebp - 0x1a]
movzx edx, dx
sub edx, 1
cmp eax, edx
jle 0x405ecc
mov dword [esp], str.ERROR:_bad_record___skipping
call sub.msvcrt.dll_puts
movzx eax, word [ebp - 0x1a]
movzx eax, ax
sub eax, 1
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
jmp 0x40601a
movzx eax, byte [ebp - 0x1b]
movzx eax, al
add eax, 1
mov dword [esp], eax
call fcn.004145d0
mov dword [ebp - 0x10], eax
movzx eax, byte [ebp - 0x1b]
test al, al
je 0x405f1a
movzx eax, byte [ebp - 0x1b]
movzx eax, al
mov edx, dword [ebp + 8]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 1
je 0x405f1a
mov eax, 1
jmp 0x405f1f
mov eax, 0
test al, al
je 0x405f37
mov dword [esp], str.ERROR:_could_not_read_key
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0xc]
jmp 0x406035
movzx eax, byte [ebp - 0x1b]
movzx edx, al
mov eax, dword [ebp - 0x10]
add eax, edx
mov byte [eax], 0
movzx eax, word [ebp - 0x1a]
movzx edx, ax
movzx eax, byte [ebp - 0x1b]
movzx eax, al
sub edx, eax
mov eax, edx
sub eax, 1
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004145d0
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x14], 0
je 0x405f9f
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 1
je 0x405f9f
mov eax, 1
jmp 0x405fa4
mov eax, 0
test al, al
je 0x405fb9
mov dword [esp], str.ERROR:_could_not_read_value
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0xc]
jmp 0x406035
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00414600
test eax, eax
jne 0x405fd7
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00414610
test eax, eax
je 0x405fde
mov eax, 1
jmp 0x405fe3
mov eax, 0
test al, al
je 0x405fec
mov eax, dword [ebp - 0xc]
jmp 0x406035
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x14]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x18]
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x10]
mov dword [esp], edx
mov ecx, eax
call fcn.004057a8
sub esp, 0xc
movzx eax, word [ebp - 0x1a]
movzx eax, ax
add eax, 2
add dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00414600
test eax, eax
sete al
test al, al
jne 0x405dff
mov eax, dword [ebp - 0xc]
leave
ret 4