Function at 0x40b1f0
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.0040106c
sub esp, eax
mov edi, dword [ecx]
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x40b660
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 0x40b7e8
mov eax, dword [ebp - 0x3054]
test eax, eax
jne 0x40b8e8
mov dword [esp], 0x414160
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 [0x413024], 8
jne 0x40b5e8
mov eax, dword [ebp - 0x304c]
xor edi, edi
test eax, eax
je 0x40b3ae
mov dword [ebp - 0x3050], esi
movzx edx, word [ebp + edi*2 - 0x2018]
cmp dx, 0xa
je 0x40b438
ja 0x40b400
cmp dx, 3
je 0x40b4c0
cmp dx, 8
jne 0x40b4aa
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 0x40b356
mov esi, dword [ebp - 0x3050]
mov eax, esi
call sym._process_console_input
mov edi, dword [ebp - 0x3060]
test edi, edi
jne 0x40b3eb
mov ebx, dword [esi + 0x1c]
test ebx, ebx
je 0x40b3eb
mov ecx, dword [esi + 0x34]
test ecx, ecx
jne 0x40b9e1
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], 0x414160
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
jmp 0x40b259
cmp dx, 0x1b
je 0x40b460
cmp dx, 0x7f
jne 0x40b4aa
mov dword [esp], 0
mov ecx, 8
mov edx, 8
inc edi
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x40b3a0
mov dword [esp], 8
mov ecx, 0xd
mov edx, 0xa
inc edi
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x40b3a0
mov ecx, dword [ebp - 0x304c]
lea ebx, [edi + 1]
lea esi, [ebp + ebx*2 - 0x2018]
sub ecx, edi
mov eax, ecx
dec eax
je 0x40b8a0
movzx edx, word [esi]
cmp dx, 0x4f
je 0x40b830
cmp dx, 0x5b
je 0x40b540
mov eax, dword [ebp - 0x3050]
mov ecx, 2
add edi, 2
call sym._char_key_press
jmp 0x40b3a0
mov eax, dword [ebp - 0x3050]
xor ecx, ecx
inc edi
call sym._char_key_press
jmp 0x40b3a0
mov dword [esp], 0x414160
mov edi, dword [ebp - 0x3050]
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
sub esp, 4
mov dword [esp], 0x414160
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov edx, dword [edi + 0x34]
sub esp, 4
test edx, edx
jne 0x40b7c0
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x40b710
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], 0x414160
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 0x40b492
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 0x40b58c
jmp 0x40b59a
lea edx, [edx + edx*4]
inc ebx
lea edx, [eax + edx*2 - 0x30]
cmp edi, ebx
jbe 0x40b59a
movzx eax, word [esi + ebx*2 + 2]
lea ecx, [eax - 0x30]
cmp cx, 9
jbe 0x40b580
mov eax, dword [ebp - 0x305c]
cmp eax, 7
ja 0x40b860
mov dword [ebp + eax*4 - 0x3038], edx
inc eax
mov dword [ebp - 0x305c], eax
cmp edi, ebx
je 0x40b5d6
mov eax, dword [ebp - 0x3068]
lea edx, [eax + ebx*2]
movzx eax, word [edx]
cmp ax, 0x3b
jne 0x40b92a
inc ebx
cmp edi, ebx
jne 0x40b570
mov edi, dword [ebp - 0x306c]
jmp 0x40b84e
mov eax, dword [ebp - 0x3064]
test eax, eax
je 0x40b8c0
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, 0x415068
test edx, edx
jne 0x40b62a
mov edx, ebx
lea eax, [ebp - 0x2018]
call sym._wine_dbgstr_wn.part.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4150aa
mov dword [esp + 8], str.tty_input
mov dword [esp + 4], 0x413024
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40b344
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 0x40b21a
test byte [0x413024], 2
je 0x40b21a
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], 0x413024
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40b21a
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 0x40b4fc
test byte [0x413024], 2
je 0x40b4fc
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], 0x413024
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40b4fc
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 0x40b4f1
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 0x40b8e8
mov eax, dword [ebp - 0x3040]
mov dword [ebp - 0x3054], eax
jmp 0x40b2c2
cmp eax, 1
je 0x40b492
movzx eax, word [esi + 2]
xor ecx, ecx
xor edx, edx
call sym._escape_char_to_vk
test eax, eax
jne 0x40ba03
movzx edx, word [esi]
jmp 0x40b492
test byte [0x413024], 1
je 0x40b5b7
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], 0x413024
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x40b5b7
mov dword [esp], 0
mov ecx, 0x1b
xor edx, edx
mov edi, ebx
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x40b3a0
lea eax, [ebp - 0x2018]
mov dword [esp], 0x415072
mov dword [ebp - 0x3050], eax
movzx eax, word [ebp - 0x3050]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x40b62a
mov edi, esi
test byte [0x413024], 8
je 0x40b4d6
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], 0x413024
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40b4d6
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 0x40ba21
mov eax, dword [ebp - 0x3074]
cmp word [eax], 0x7e
je 0x40ba96
test byte [0x413024], 1
je 0x40b84e
mov eax, dword [ebp - 0x3068]
shr eax, 0x10
je 0x40bb14
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, 0x415068
test edx, edx
jne 0x40b9b1
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], 0x413024
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
movzx edx, word [esi]
jmp 0x40b492
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 0x40b3d1
mov dword [esp], 0
mov ecx, eax
xor edx, edx
add edi, 3
mov eax, dword [ebp - 0x3050]
call sym._key_press
jmp 0x40b3a0
cmp dword [ebp - 0x305c], 1
je 0x40badd
mov eax, dword [ebp - 0x3034]
lea edx, [eax - 1]
xor eax, eax
cmp edx, 0xf
ja 0x40ba6f
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 0x40b84e
lea edi, [ebx + edi + 2]
jmp 0x40b3a0
mov dword [ebp - 0x3068], 0
mov eax, dword [ebp - 0x3038]
lea edx, [eax - 2]
cmp edx, 0x16
ja 0x40babb
mov eax, dword [edx*4 + 0x415f20]
mov dword [ebp - 0x3068], eax
cmp dword [ebp - 0x305c], 2
je 0x40bae5
mov dword [esp], ecx
mov eax, dword [ebp - 0x3050]
xor edx, edx
inc ebx
mov ecx, dword [ebp - 0x3068]
call sym._key_press
jmp 0x40ba85
mov eax, dword [ebp - 0x3044]
jmp 0x40ba6f
mov eax, dword [ebp - 0x3034]
dec eax
cmp eax, 0xf
ja 0x40bac4
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 0x40bac4
movzx eax, word [ebp - 0x3068]
mov dword [esp], 0x415072
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x40b9b1