Function at 0x405650
Capabilities:
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
mov eax, 0x3098
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
call fcn.00412000
sub esp, eax
mov edi, dword [ecx]
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x405ac0
mov dword [esp + 0xc], 0
mov esi, edi
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 - 0x2018]
sub esp, 0x10
shr eax, 0x10
mov dword [ebp - 0x3064], eax
lea eax, [ebp - 0x3018]
mov dword [esp + 0x20], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x3040]
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 [esi + 0xb0]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtReadFile]
mov dword [ebp - 0x3054], eax
sub esp, 0x24
cmp eax, 0x103
je 0x405c48
mov eax, dword [ebp - 0x3054]
test eax, eax
jne 0x405d48
mov dword [esp], 0x413040
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x1c]
mov edx, dword [ebp - 0x303c]
lea ecx, [ebp - 0x2018]
sub esp, 4
cmp dword [esi + 0xc], 1
mov dword [ebp - 0x3060], eax
sbb eax, eax
and eax, 0xfffffff7
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x3018]
add eax, 0xfdf2
mov dword [esp + 0x14], 0x1000
mov dword [esp + 0xc], edx
mov dword [esp + 8], ecx
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [ebp - 0x304c], eax
sub esp, 0x18
test byte [0x413058], 8
jne 0x405a48
mov eax, dword [ebp - 0x304c]
xor edi, edi
test eax, eax
je 0x40580e
mov dword [ebp - 0x3050], esi
movzx edx, word [ebp + edi*2 - 0x2018]
cmp dx, 0xa
je 0x405898
ja 0x405860
cmp dx, 3
je 0x405920
cmp dx, 8
jne 0x40590a
mov dword [esp], 8
mov ecx, 0x48
mov edx, 8
inc edi
mov eax, dword [ebp - 0x3050]
call sym._key_press
nop
cmp dword [ebp - 0x304c], edi
ja 0x4057b6
mov esi, dword [ebp - 0x3050]
mov eax, esi
call sym._process_console_input
mov edi, dword [ebp - 0x3060]
test edi, edi
jne 0x40584b
mov ebx, dword [esi + 0x1c]
test ebx, ebx
je 0x40584b
mov ecx, dword [esi + 0x34]
test ecx, ecx
jne 0x405e41
mov dword [esp + 4], 1
xor ecx, ecx
xor edx, edx
mov eax, esi
mov dword [esp], 0
call sym._read_complete
mov dword [esp], 0x413040
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
jmp 0x4056b9
cmp dx, 0x1b
je 0x4058c0
cmp dx, 0x7f
jne 0x40590a
mov dword [esp], 0
mov ecx, 8
mov edx, 8
inc edi
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x405800
mov dword [esp], 8
mov ecx, 0xd
mov edx, 0xa
inc edi
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x405800
mov ecx, dword [ebp - 0x304c]
lea ebx, [edi + 1]
lea esi, [ebp + ebx*2 - 0x2018]
sub ecx, edi
mov eax, ecx
dec eax
je 0x405d00
movzx edx, word [esi]
cmp dx, 0x4f
je 0x405c90
cmp dx, 0x5b
je 0x4059a0
mov eax, dword [ebp - 0x3050]
mov ecx, 2
add edi, 2
call sym._char_key_press
jmp 0x405800
mov eax, dword [ebp - 0x3050]
xor ecx, ecx
inc edi
call sym._char_key_press
jmp 0x405800
mov dword [esp], 0x413040
mov edi, dword [ebp - 0x3050]
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
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 0x405c20
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x405b70
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [edi + 0xac], 0
sub esp, 4
mov dword [esp], 0x413040
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
xor eax, eax
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 4
cmp eax, 1
je 0x4058f2
lea eax, [ecx - 2]
lea ecx, [esi + 2]
mov dword [ebp - 0x306c], edi
xor ebx, ebx
mov dword [ebp - 0x3070], eax
mov edi, eax
mov dword [ebp - 0x3068], ecx
mov dword [ebp - 0x305c], 0
nop
xor edx, edx
cmp edi, ebx
ja 0x4059ec
jmp 0x4059fa
lea edx, [edx + edx*4]
inc ebx
lea edx, [eax + edx*2 - 0x30]
cmp edi, ebx
jbe 0x4059fa
movzx eax, word [esi + ebx*2 + 2]
lea ecx, [eax - 0x30]
cmp cx, 9
jbe 0x4059e0
mov eax, dword [ebp - 0x305c]
cmp eax, 7
ja 0x405cc0
mov dword [ebp + eax*4 - 0x3038], edx
inc eax
mov dword [ebp - 0x305c], eax
cmp edi, ebx
je 0x405a36
mov eax, dword [ebp - 0x3068]
lea edx, [eax + ebx*2]
movzx eax, word [edx]
cmp ax, 0x3b
jne 0x405d8a
inc ebx
cmp edi, ebx
jne 0x4059d0
mov edi, dword [ebp - 0x306c]
jmp 0x405cae
mov eax, dword [ebp - 0x3064]
test eax, eax
je 0x405d20
mov ebx, dword [ebp - 0x304c]
lea eax, [ebp - 0x2018]
mov dword [esp], eax
mov dword [esp + 4], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, 0x414068
test edx, edx
jne 0x405a8a
mov edx, ebx
lea eax, [ebp - 0x2018]
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 0x4057a4
mov eax, dword [edi + 0xb0]
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
mov dword [ebp - 0x2018], eax
lea eax, [ebp - 0x2018]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3040]
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 0x40567a
test byte [0x413058], 2
je 0x40567a
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 0x40567a
lea eax, [ebp - 0x3038]
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3040]
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 - 0x3038], 0
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
sub esp, 0x28
test eax, eax
je 0x40595c
test byte [0x413058], 2
je 0x40595c
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 0x40595c
mov dword [esp + 4], 0
mov edx, dword [ebp - 0x3054]
xor ecx, ecx
mov eax, edi
mov dword [esp], 0
call sym._read_complete
jmp 0x405951
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 - 0x3054], eax
sub esp, 0xc
test eax, eax
jne 0x405d48
mov eax, dword [ebp - 0x3040]
mov dword [ebp - 0x3054], eax
jmp 0x405722
cmp eax, 1
je 0x4058f2
movzx eax, word [esi + 2]
xor ecx, ecx
xor edx, edx
call sym._escape_char_to_vk
test eax, eax
jne 0x405e63
movzx edx, word [esi]
jmp 0x4058f2
test byte [0x413058], 1
je 0x405a17
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 0x405a17
mov dword [esp], 0
mov ecx, 0x1b
xor edx, edx
mov edi, ebx
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x405800
lea eax, [ebp - 0x2018]
mov dword [esp], 0x414072
mov dword [ebp - 0x3050], eax
movzx eax, word [ebp - 0x3050]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x405a8a
mov edi, esi
test byte [0x413058], 8
je 0x405936
mov eax, dword [ebp - 0x3054]
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 0x405936
mov dword [ebp - 0x3074], edx
lea ecx, [ebp - 0x3046]
lea edx, [ebp - 0x3044]
mov edi, dword [ebp - 0x306c]
call sym._escape_char_to_vk
mov ecx, eax
test eax, eax
jne 0x405e81
mov eax, dword [ebp - 0x3074]
cmp word [eax], 0x7e
je 0x405ef6
test byte [0x413058], 1
je 0x405cae
mov eax, dword [ebp - 0x3068]
shr eax, 0x10
je 0x405f74
mov ebx, dword [ebp - 0x3070]
mov eax, dword [ebp - 0x3068]
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 0x405e11
mov eax, dword [ebp - 0x3068]
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
movzx edx, word [esi]
jmp 0x4058f2
mov dword [esp + 8], 0x6e9
mov dword [esp + 4], str..._src_wine_programs_conhost_conhost.c
mov dword [esp], str._console__read_ioctl
call dword [sym.imp.ucrtbase.dll__assert]
jmp 0x405831
mov dword [esp], 0
mov ecx, eax
xor edx, edx
add edi, 3
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x405800
cmp dword [ebp - 0x305c], 1
je 0x405f3d
mov eax, dword [ebp - 0x3034]
lea edx, [eax - 1]
xor eax, eax
cmp edx, 0xf
ja 0x405ecf
mov eax, edx
mov dword [ebp - 0x305c], edx
mov edx, 0x10
and eax, 1
cmovne eax, edx
mov edx, eax
or edx, 2
test byte [ebp - 0x305c], 2
cmovne eax, edx
mov edx, eax
or edx, 8
test byte [ebp - 0x305c], 4
cmovne eax, edx
mov dword [esp], eax
movzx edx, word [ebp - 0x3046]
inc ebx
mov eax, dword [ebp - 0x3050]
call sym._key_press
test ebx, ebx
je 0x405cae
lea edi, [ebx + edi + 2]
jmp 0x405800
mov dword [ebp - 0x3068], 0
mov eax, dword [ebp - 0x3038]
lea edx, [eax - 2]
cmp edx, 0x16
ja 0x405f1b
mov eax, dword [edx*4 + 0x4146c0]
mov dword [ebp - 0x3068], eax
cmp dword [ebp - 0x305c], 2
je 0x405f45
mov dword [esp], ecx
mov eax, dword [ebp - 0x3050]
xor edx, edx
inc ebx
mov ecx, dword [ebp - 0x3068]
call sym._key_press
jmp 0x405ee5
mov eax, dword [ebp - 0x3044]
jmp 0x405ecf
mov eax, dword [ebp - 0x3034]
dec eax
cmp eax, 0xf
ja 0x405f24
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 0x405f24
movzx eax, word [ebp - 0x3068]
mov dword [esp], 0x414072
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x405e11