Function at 0x405920
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
mov eax, 0x3084
mov ebp, esp
push edi
push esi
push ebx
call fcn.004125b8
sub esp, eax
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0xc]
test ecx, ecx
jne 0x40608b
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
mov dword [ebp - 0x3058], eax
lea eax, [ebp - 0x200c]
sub esp, 0x10
shr eax, 0x10
mov dword [ebp - 0x3060], eax
lea eax, [ebp - 0x300c]
mov dword [esp + 0x20], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x3034]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x3058]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0x1000
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [edi + 0xb4]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtReadFile]
mov dword [ebp - 0x3050], eax
sub esp, 0x24
cmp eax, 0x103
je 0x405e99
mov edx, dword [ebp - 0x3050]
test edx, edx
jne 0x4061c0
mov dword [esp], 0x413040
lea esi, [ebp - 0x200c]
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x1c]
mov edx, dword [ebp - 0x3030]
sub esp, 4
cmp dword [edi + 0xc], 1
mov dword [ebp - 0x3054], eax
sbb eax, eax
and eax, 0xfffffff7
mov dword [esp + 0x10], esi
lea esi, [ebp - 0x300c]
add eax, 0xfdf2
mov dword [esp + 0x14], 0x1000
mov dword [esp + 0xc], edx
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [ebp - 0x3040], eax
sub esp, 0x18
test byte [0x413058], 8
jne 0x405dbc
mov eax, dword [ebp - 0x3040]
xor esi, esi
test eax, eax
je 0x405aca
mov dword [ebp + 8], edi
mov edi, esi
mov esi, dword [ebp + 8]
lea esi, [esi]
movzx edx, word [ebp + edi*2 - 0x200c]
cmp dx, 0x1c
ja 0x405ce8
cmp dx, 2
jbe case.0x405aa4.1
lea eax, [edx - 3]
cmp ax, 0x19
ja case.0x405aa4.1
movzx eax, ax
jmp dword [eax*4 + 0x4142d0]
xor ecx, ecx
mov eax, esi
add edi, 1
call sym._char_key_press
lea esi, [esi]
cmp dword [ebp - 0x3040], edi
ja 0x405a80
mov edi, esi
mov eax, edi
call sym._process_console_input
mov eax, dword [ebp - 0x3054]
test eax, eax
jne 0x405b07
mov ebx, dword [edi + 0x1c]
test ebx, ebx
je 0x405b07
mov ecx, dword [edi + 0x34]
test ecx, ecx
jne 0x4062a6
mov dword [esp + 4], 1
xor ecx, ecx
xor edx, edx
mov eax, edi
mov dword [esp], 0
call sym._read_complete
mov dword [esp], 0x413040
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
jmp 0x40597d
mov eax, dword [esi + 0xc]
add edi, 1
test eax, eax
je 0x405d58
mov dword [esp], 8
mov ecx, 3
xor edx, edx
mov eax, esi
call sym._key_press
jmp 0x405ac0
mov ecx, dword [ebp - 0x3040]
lea ebx, [edi + 1]
lea eax, [ebp + ebx*2 - 0x200c]
sub ecx, edi
mov dword [ebp - 0x3044], eax
mov eax, ecx
sub eax, 1
je 0x405da0
mov ebx, dword [ebp - 0x3044]
movzx edx, word [ebx]
cmp dx, 0x4f
je 0x405d70
cmp dx, 0x5b
jne 0x405c50
cmp eax, 1
je 0x405c50
sub ecx, 2
mov eax, ebx
lea ebx, [ebx + 2]
mov dword [ebp + 8], esi
mov dword [ebp - 0x3064], ecx
mov esi, ecx
mov dword [ebp - 0x3048], 0
mov dword [ebp - 0x304c], ebx
xor ebx, ebx
mov dword [ebp - 0x305c], edi
mov edi, eax
lea esi, [esi]
lea esi, [esi]
xor edx, edx
cmp esi, ebx
ja 0x405bee
jmp 0x405bfc
lea edx, [edx + edx*4]
add ebx, 1
lea edx, [eax + edx*2 - 0x30]
cmp esi, ebx
jbe 0x405bfc
movzx eax, word [edi + ebx*2 + 2]
lea ecx, [eax - 0x30]
cmp cx, 9
jbe 0x405be0
mov eax, dword [ebp - 0x3048]
cmp eax, 7
ja 0x405d18
mov dword [ebp + eax*4 - 0x302c], edx
add eax, 1
mov dword [ebp - 0x3048], eax
cmp esi, ebx
je 0x405c3c
mov eax, dword [ebp - 0x304c]
lea edx, [eax + ebx*2]
movzx eax, word [edx]
cmp ax, 0x3b
jne 0x405eda
add ebx, 1
cmp esi, ebx
jne 0x405bd0
mov edi, dword [ebp - 0x305c]
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 0x3044]
movzx edx, word [eax]
nop
mov ecx, 2
mov eax, esi
add edi, 2
call sym._char_key_press
jmp 0x405ac0
mov ecx, 0x48
mov edx, 8
mov eax, esi
add edi, 1
mov dword [esp], 8
call sym._key_press
jmp 0x405ac0
mov ecx, 0xd
mov edx, 0xa
mov eax, esi
add edi, 1
mov dword [esp], 8
call sym._key_press
jmp 0x405ac0
mov eax, dword [esi + 0xc]
test eax, eax
je 0x405e2b
test byte [esi + 4], 1
je 0x405e2b
mov ecx, 0x43
mov edx, 3
mov eax, esi
add edi, 1
mov dword [esp], 8
call sym._key_press
jmp 0x405ac0
cmp dx, 0x7f
jne case.0x405aa4.1
mov ecx, 8
mov edx, 8
mov eax, esi
add edi, 1
mov dword [esp], 0
call sym._key_press
jmp 0x405ac0
test byte [0x413058], 1
je 0x405c1b
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.too_many_params__skipping__u_n
mov dword [esp + 8], str.process_csi_sequence
mov dword [esp + 4], 0x413058
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x405c1b
xor ecx, ecx
mov edx, 0x1c
mov eax, esi
call sym._char_key_press
jmp 0x405ac0
cmp eax, 1
je 0x405c50
mov ebx, dword [ebp - 0x3044]
xor ecx, ecx
xor edx, edx
movzx eax, word [ebx + 2]
call sym._escape_char_to_vk
test eax, eax
jne 0x4061a6
movzx edx, word [ebx]
jmp 0x405c50
mov dword [esp], 0
mov ecx, 0x1b
xor edx, edx
mov eax, esi
mov edi, ebx
call sym._key_press
jmp 0x405ac0
mov eax, dword [ebp - 0x3060]
test eax, eax
je 0x405f9a
mov esi, dword [ebp - 0x3040]
lea eax, [ebp - 0x200c]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, 0x414068
test edx, edx
jne 0x405dfe
mov edx, esi
lea eax, [ebp - 0x200c]
call sym._wine_dbgstr_wn.part.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4140aa
mov dword [esp + 8], str.tty_input
mov dword [esp + 4], 0x413058
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x405a68
mov dword [esp], 0x413040
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov edi, esi
call ebx
sub esp, 4
mov dword [esp], 0x413040
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov edx, dword [edi + 0x34]
sub esp, 4
test edx, edx
jne 0x406068
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x405fc2
mov eax, dword [edi + 0xb0]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [edi + 0xb0], 0
sub esp, 4
mov dword [esp], 0x413040
call ebx
xor eax, eax
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov eax, dword [ebp - 0x3058]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov dword [ebp - 0x3050], eax
sub esp, 0xc
test eax, eax
jne 0x4061c0
mov eax, dword [ebp - 0x3034]
mov dword [ebp - 0x3050], eax
jmp 0x4059e6
mov dword [ebp - 0x3068], edx
lea ecx, [ebp - 0x303a]
lea edx, [ebp - 0x3038]
mov esi, dword [ebp + 8]
mov edi, dword [ebp - 0x305c]
call sym._escape_char_to_vk
mov ecx, eax
test eax, eax
jne 0x406133
mov eax, dword [ebp - 0x3068]
cmp word [eax], 0x7e
je 0x406206
test byte [0x413058], 1
je 0x405c45
mov eax, dword [ebp - 0x304c]
shr eax, 0x10
je 0x40628a
mov ebx, dword [ebp - 0x3064]
mov eax, dword [ebp - 0x304c]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, 0x414068
test edx, edx
jne 0x405f64
mov eax, dword [ebp - 0x304c]
mov edx, ebx
call sym._wine_dbgstr_wn.part.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unhandled_sequence__s_n
mov dword [esp + 8], str.process_csi_sequence
mov dword [esp + 4], 0x413058
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
mov eax, dword [ebp - 0x3044]
movzx edx, word [eax]
jmp 0x405c50
lea eax, [ebp - 0x200c]
mov dword [esp], 0x414072
mov dword [ebp - 0x3044], eax
movzx eax, word [ebp - 0x3044]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x405dfe
lea eax, [ebp - 0x302c]
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3034]
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 4
mov dword [esp + 0x14], 0x5000f0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [edi]
mov dword [ebp - 0x302c], 0
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
sub esp, 0x28
test eax, eax
je 0x405e65
test byte [0x413058], 2
je 0x405e65
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.input_restore_failed:__lx_n
mov dword [esp + 8], str.tty_input
mov dword [esp + 4], 0x413058
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x405e65
mov dword [esp + 4], 0
mov edx, dword [ebp - 0x3050]
xor ecx, ecx
mov eax, edi
mov dword [esp], 0
call sym._read_complete
jmp 0x405e5a
mov eax, dword [edi + 0xb4]
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
mov dword [ebp - 0x200c], eax
lea eax, [ebp - 0x200c]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3034]
mov dword [esp + 0x1c], 4
mov dword [esp + 0x14], 0x5000f0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [edi]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
sub esp, 0x28
test eax, eax
je 0x405940
test byte [0x413058], 2
je 0x405940
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.input_setup_failed:__lx_n
mov dword [esp + 8], str.tty_input
mov dword [esp + 4], 0x413058
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x405940
cmp dword [ebp - 0x3048], 1
je 0x40624e
mov eax, dword [ebp - 0x3028]
lea edx, [eax - 1]
xor eax, eax
cmp edx, 0xf
ja 0x406181
mov eax, edx
mov dword [ebp - 0x3048], edx
mov edx, 0x10
and eax, 1
cmovne eax, edx
mov edx, eax
or edx, 2
test byte [ebp - 0x3048], 2
cmovne eax, edx
mov edx, eax
or edx, 8
test byte [ebp - 0x3048], 4
cmovne eax, edx
mov dword [esp], eax
movzx edx, word [ebp - 0x303a]
mov eax, esi
add ebx, 1
call sym._key_press
test ebx, ebx
je 0x405c45
lea edi, [ebx + edi + 2]
jmp 0x405ac0
mov dword [esp], 0
mov ecx, eax
xor edx, edx
mov eax, esi
add edi, 3
call sym._key_press
jmp 0x405ac0
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
test byte [0x413058], 8
je 0x405e3f
mov eax, dword [ebp - 0x3050]
mov dword [esp + 0xc], str.NtReadFile_failed:__lx_n
mov dword [esp + 8], str.tty_input
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x413058
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x405e3f
mov dword [ebp - 0x304c], 0
mov eax, dword [ebp - 0x302c]
sub eax, 2
cmp eax, 0x16
ja 0x40622b
mov eax, dword [eax*4 + 0x414720]
mov dword [ebp - 0x304c], eax
cmp dword [ebp - 0x3048], 2
je 0x406259
mov dword [esp], ecx
mov ecx, dword [ebp - 0x304c]
xor edx, edx
mov eax, esi
add ebx, 1
call sym._key_press
jmp 0x406195
mov eax, dword [ebp - 0x3038]
jmp 0x406181
mov eax, dword [ebp - 0x3028]
sub eax, 1
cmp eax, 0xf
ja 0x406234
mov ecx, eax
mov edx, 0x10
and ecx, 1
cmovne ecx, edx
mov edx, ecx
or edx, 2
test al, 2
cmovne ecx, edx
mov edx, ecx
or edx, 8
test al, 4
cmovne ecx, edx
jmp 0x406234
movzx eax, word [ebp - 0x304c]
mov dword [esp], 0x414072
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x405f64
mov dword [esp + 8], 0x709
mov dword [esp + 4], str..._programs_conhost_conhost.c
mov dword [esp], str._console__read_ioctl
call dword [sym.imp.ucrtbase.dll__assert]
lea esi, [esi]
lea esi, [esi]