Function at 0x40b080
Capabilities:
Read file on windows

Disassembly:
push ebp
mov eax, 0x3084
mov ebp, esp
push edi
push esi
push ebx
call fcn.00401064
sub esp, eax
mov edi, dword [ebp + 8]
mov ecx, dword [edi + 0xc]
test ecx, ecx
jne 0x40b7d3
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 - 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 [esi + 0xb4]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtReadFile]
mov dword [ebp - 0x3050], eax
sub esp, 0x24
cmp eax, 0x103
je 0x40b5e1
mov edx, dword [ebp - 0x3050]
test edx, edx
jne 0x40b906
mov dword [esp], 0x414160
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x1c]
mov edx, dword [ebp - 0x3030]
lea ecx, [ebp - 0x200c]
sub esp, 4
cmp dword [esi + 0xc], 1
mov dword [ebp - 0x3054], eax
sbb eax, eax
and eax, 0xfffffff7
mov dword [esp + 0x10], ecx
lea ecx, [ebp - 0x300c]
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 - 0x3040], eax
sub esp, 0x18
test byte [0x413024], 8
jne 0x40b504
mov eax, dword [ebp - 0x3040]
xor edi, edi
test eax, eax
je 0x40b228
lea esi, cs:[esi]
nop
movzx edx, word [ebp + edi*2 - 0x200c]
cmp dx, 0x1c
ja 0x40b438
cmp dx, 2
jbe case.0x40b204.1
lea eax, [edx - 3]
cmp ax, 0x19
ja case.0x40b204.1
movzx eax, ax
jmp dword [eax*4 + 0x4152dc]
xor ecx, ecx
mov eax, esi
inc edi
call sym._char_key_press
lea esi, [esi]
cmp dword [ebp - 0x3040], edi
ja 0x40b1e0
mov eax, esi
call sym._process_console_input
mov eax, dword [ebp - 0x3054]
test eax, eax
jne 0x40b265
mov ebx, dword [esi + 0x1c]
test ebx, ebx
je 0x40b265
mov ecx, dword [esi + 0x34]
test ecx, ecx
jne 0x40b9ea
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 0x40b0df
mov eax, dword [esi + 0xc]
inc edi
test eax, eax
je 0x40b4a0
mov dword [esp], 8
mov ecx, 3
xor edx, edx
mov eax, esi
call sym._key_press
jmp 0x40b220
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
dec eax
je 0x40b4e8
mov ebx, dword [ebp - 0x3044]
movzx edx, word [ebx]
cmp dx, 0x4f
je 0x40b4b8
cmp dx, 0x5b
jne 0x40b3a0
cmp eax, 1
je 0x40b3a0
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]
xor edx, edx
cmp esi, ebx
ja 0x40b33c
jmp 0x40b34a
lea edx, [edx + edx*4]
inc ebx
lea edx, [eax + edx*2 - 0x30]
cmp esi, ebx
jbe 0x40b34a
movzx eax, word [edi + ebx*2 + 2]
lea ecx, [eax - 0x30]
cmp cx, 9
jbe 0x40b330
mov eax, dword [ebp - 0x3048]
cmp eax, 7
ja 0x40b460
mov dword [ebp + eax*4 - 0x302c], edx
inc eax
mov dword [ebp - 0x3048], eax
cmp esi, ebx
je 0x40b386
mov eax, dword [ebp - 0x304c]
lea edx, [eax + ebx*2]
movzx eax, word [edx]
cmp ax, 0x3b
jne 0x40b622
inc ebx
cmp esi, ebx
jne 0x40b328
mov edi, dword [ebp - 0x305c]
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 0x3044]
movzx edx, word [eax]
lea esi, cs:[esi]
mov ecx, 2
mov eax, esi
add edi, 2
call sym._char_key_press
jmp 0x40b220
mov dword [esp], 8
mov ecx, 0x48
mov eax, esi
inc edi
mov edx, 8
call sym._key_press
jmp 0x40b220
mov dword [esp], 8
mov ecx, 0xd
mov eax, esi
inc edi
mov edx, 0xa
call sym._key_press
jmp 0x40b220
mov eax, dword [esi + 0xc]
test eax, eax
je 0x40b573
test byte [esi + 4], 1
je 0x40b573
mov dword [esp], 8
mov ecx, 0x43
mov eax, esi
inc edi
mov edx, 3
call sym._key_press
jmp 0x40b220
cmp dx, 0x7f
jne case.0x40b204.1
mov dword [esp], 0
mov ecx, 8
mov eax, esi
inc edi
mov edx, 8
call sym._key_press
jmp 0x40b220
test byte [0x413024], 1
je 0x40b367
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 0x40b367
xor ecx, ecx
mov edx, 0x1c
mov eax, esi
call sym._char_key_press
jmp 0x40b220
cmp eax, 1
je 0x40b3a0
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 0x40b8ec
movzx edx, word [ebx]
jmp 0x40b3a0
mov dword [esp], 0
mov ecx, 0x1b
xor edx, edx
mov eax, esi
mov edi, ebx
call sym._key_press
jmp 0x40b220
mov eax, dword [ebp - 0x3060]
test eax, eax
je 0x40b6e2
mov edi, dword [ebp - 0x3040]
lea eax, [ebp - 0x200c]
mov dword [esp], eax
mov dword [esp + 4], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, 0x415068
test edx, edx
jne 0x40b546
mov edx, edi
lea eax, [ebp - 0x200c]
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 0x40b1ca
mov dword [esp], 0x414160
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov edi, esi
call ebx
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 0x40b7b0
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x40b70a
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], 0x414160
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 0x40b906
mov eax, dword [ebp - 0x3034]
mov dword [ebp - 0x3050], eax
jmp 0x40b148
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 0x40b87b
mov eax, dword [ebp - 0x3068]
cmp word [eax], 0x7e
je 0x40b94e
test byte [0x413024], 1
je 0x40b38f
mov eax, dword [ebp - 0x304c]
shr eax, 0x10
je 0x40b9ce
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, 0x415068
test edx, edx
jne 0x40b6ac
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], 0x413024
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
mov eax, dword [ebp - 0x3044]
movzx edx, word [eax]
jmp 0x40b3a0
lea eax, [ebp - 0x200c]
mov dword [esp], 0x415072
mov dword [ebp - 0x3044], eax
movzx eax, word [ebp - 0x3044]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x40b546
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 0x40b5ad
test byte [0x413024], 2
je 0x40b5ad
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 0x40b5ad
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 0x40b5a2
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 0x40b0a0
test byte [0x413024], 2
je 0x40b0a0
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 0x40b0a0
cmp dword [ebp - 0x3048], 1
je 0x40b994
mov eax, dword [ebp - 0x3028]
lea edx, [eax - 1]
xor eax, eax
cmp edx, 0xf
ja 0x40b8c9
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
inc ebx
call sym._key_press
test ebx, ebx
je 0x40b38f
lea edi, [ebx + edi + 2]
jmp 0x40b220
mov dword [esp], 0
mov ecx, eax
xor edx, edx
mov eax, esi
add edi, 3
call sym._key_press
jmp 0x40b220
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov edi, esi
test byte [0x413024], 8
je 0x40b587
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], 0x413024
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40b587
mov dword [ebp - 0x304c], 0
mov eax, dword [ebp - 0x302c]
lea edx, [eax - 2]
cmp edx, 0x16
ja 0x40b973
mov eax, dword [edx*4 + 0x415f80]
mov dword [ebp - 0x304c], eax
cmp dword [ebp - 0x3048], 2
je 0x40b99f
mov dword [esp], ecx
mov ecx, dword [ebp - 0x304c]
xor edx, edx
mov eax, esi
inc ebx
call sym._key_press
jmp 0x40b8db
mov eax, dword [ebp - 0x3038]
jmp 0x40b8c9
mov eax, dword [ebp - 0x3028]
dec eax
cmp eax, 0xf
ja 0x40b97c
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 0x40b97c
movzx eax, word [ebp - 0x304c]
mov dword [esp], 0x415072
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf
jmp 0x40b6ac
mov dword [esp + 8], 0x709
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]
nop
nop
nop
nop
nop
nop
nop
nop
nop