Function at 0x4697f0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x4c
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
mov ebx, dword [eax + 4]
cmp ebx, eax
je 0x469886
mov eax, dword [ebx + 4]
mov dword [esp + 4], 0
mov dword [ebp - 0x2c], eax
mov eax, dword [ebx + 0x274]
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
test eax, eax
je 0x4698d3
cmp dword [ebx + 0xc], 1
je 0x469879
mov eax, esi
mov edx, edi
sub eax, dword [ebx + 0x40]
sbb edx, dword [ebx + 0x44]
cmp edx, 0
jle 0x4699b1
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_lockMutex
mov edx, dword [ebx + 4]
mov eax, dword [ebx]
mov dword [eax + 4], edx
mov edx, dword [ebx + 4]
mov dword [edx], eax
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_unlockMutex
mov eax, ebx
call fcn.004666e0
mov eax, dword [ebp + 8]
mov ebx, dword [ebp - 0x2c]
mov eax, dword [eax + 8]
cmp ebx, eax
jne 0x46980d
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
test eax, eax
jne 0x469894
jmp 0x4698aa
mov eax, ebx
mov ebx, dword [eax + 0x14]
mov edx, esi
mov ecx, edi
mov dword [esp], eax
mov eax, dword [ebp - 0x30]
call fcn.004697f0
test ebx, ebx
jne 0x469892
cmp dword [ebp + 8], 0x4c0278
je 0x4698cb
cmp dword [ebp + 8], 0x4c0294
je 0x4698cb
mov eax, dword [ebp + 8]
mov eax, dword [eax + 8]
cmp eax, dword [eax + 4]
je 0x469b20
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebx + 0x254]
test eax, eax
jne 0x4699c5
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x38], eax
lea eax, [ebx + 0x264]
mov dword [ebx + 0x254], 1
mov dword [ebp - 0x34], eax
mov eax, dword [ebx + 0x274]
mov dword [esp], eax
call sub.kernel32.dll_ResetEvent
sub esp, 4
test eax, eax
je 0x469af0
mov eax, dword [ebp - 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x260]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x25c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.kernel32.dll_ReadFile
sub esp, 0x14
test eax, eax
je 0x469a25
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x469cf7
lea ecx, [ebx + 0x50]
mov edx, dword [ebx + 0x254]
mov dword [ebp - 0x3c], ecx
mov ecx, dword [ebx + 0x258]
add ecx, eax
cmp edx, 1
mov dword [ebx + 0x258], ecx
je 0x469b01
cmp edx, 2
je 0x469b94
cmp edx, 3
jne 0x469b0a
mov eax, dword [ebp - 0x3c]
mov dword [ebx + 0x25c], eax
mov eax, dword [ebx + 0x48]
sub eax, ecx
mov ecx, 0x200
cmp eax, 0x200
cmova eax, ecx
mov dword [ebx + 0x260], eax
jmp 0x4698fa
jl 0x469879
cmp eax, 0x1e
jbe 0x469879
jmp 0x46984d
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
mov dword [ebp - 0x38], eax
lea eax, [ebx + 0x264]
mov dword [esp + 0xc], 0
mov dword [ebp - 0x34], eax
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.kernel32.dll_GetOverlappedResult
sub esp, 0x10
test eax, eax
jne 0x46994b
call sub.kernel32.dll_GetLastError
cmp eax, 0x6d
je 0x469cf7
cmp eax, 0x3e5
je 0x469879
cmp eax, 0x26
je 0x469cf7
mov dword [esp], str.GetOverlappedResult
jmp 0x469a4e
call sub.kernel32.dll_GetLastError
cmp eax, 0x6d
je 0x469cf7
cmp eax, 0x3e5
je 0x469879
cmp eax, 0x26
je 0x469cf7
mov dword [esp], str.ReadFile
call sym.brltty.exe_logWindowsSystemError
call sub.msvcrt.dll__errno
mov dword [ebp - 0x34], eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov edx, dword [ebp - 0x34]
mov dword [edx], eax
mov edx, dword [ebx + 8]
mov dword [ebp - 0x34], edx
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov edx, dword [ebp - 0x34]
mov dword [esp + 4], str.read_:__s__connection_on_fd__p_
mov dword [esp], 4
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
mov ecx, dword [ebx + 0x14]
test ecx, ecx
jne 0x469c3e
mov eax, dword [ebx + 0x18]
test eax, eax
jne 0x469f5a
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x46984d
mov eax, dword [eax + 4]
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 8]
mov dword [esp + 4], str.client_on_fd__p_did_not_give_up_control_of_tty__010x_properly
mov dword [esp], 0x8a
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
mov eax, ebx
call fcn.00465c50
jmp 0x46984d
mov dword [esp], str.ResetEvent_in_readPacket
call sym.brltty.exe_logWindowsSystemError
jmp 0x469913
cmp ecx, 8
je 0x469d17
sub dword [ebx + 0x260], eax
add dword [ebx + 0x25c], eax
jmp 0x4698fa
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x18]
test ebx, ebx
jne 0x4698cb
mov eax, dword [eax + 4]
mov dword [esp + 4], str.freeing_tty__010x
mov dword [esp], 0x8a
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_lockMutex
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x469b68
mov edi, dword [ebp + 8]
mov edx, dword [edi + 0x10]
mov dword [eax + 0x10], edx
mov edi, dword [ebp + 8]
mov edx, dword [edi + 0x10]
mov dword [edx], eax
mov eax, dword [edi + 8]
call fcn.004666e0
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_unlockMutex
jmp 0x4698cb
cmp ecx, dword [ebx + 0x48]
jne 0x469b0a
lea eax, [ebx + 0x48]
mov dword [ebx + 0x25c], eax
mov eax, dword [ebx + 0x274]
mov dword [ebx + 0x254], 0
mov dword [ebx + 0x258], 0
mov dword [ebx + 0x260], 8
mov dword [esp], eax
call sub.kernel32.dll_SetEvent
mov eax, dword [ebx + 0x48]
mov ecx, dword [ebx + 0x4c]
mov dword [ebp - 0x34], eax
sub esp, 4
cmp dword [ebx + 0xc], 1
jne 0x469d77
cmp dword [ebp - 0x34], 0x200
jle 0x469da2
cmp ecx, 0x76
mov ebx, dword [ebx + 8]
mov eax, 0x49c120
jne 0x469c0f
jmp 0x469f40
cmp ecx, edx
je 0x469f45
add eax, 8
mov edx, dword [eax]
test edx, edx
jne 0x469c07
mov eax, str.Unknown
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.Discarding_too_large_packet_of_type__s_on_fd__p
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x469879
mov dword [esp], sym.brltty.exe_apiRawMutex
call sym.brltty.exe_lockMutex
mov eax, dword [ebx + 8]
mov dword [ebx + 0x14], 0
mov dword [esp + 4], str.Client_on_fd__p_did_not_give_up_raw_mode_properly
mov dword [esp], 4
mov dword [esp + 8], eax
mov dword [0x4c02b4], 0
call sym.brltty.exe_logMessage
mov dword [esp], sym.brltty.exe_apiDriverMutex
call sym.brltty.exe_lockMutex
mov dword [esp + 4], str.Trying_to_reset_braille_terminal
mov dword [esp], 4
call sym.brltty.exe_logMessage
mov eax, dword [0x4c026c]
mov eax, dword [eax + 0x40]
test eax, eax
je 0x469cd5
mov edx, dword [0x4c0210]
test edx, edx
je 0x469cc1
mov dword [esp], edx
call eax
test eax, eax
jne 0x469cda
mov eax, dword [0x4c026c]
mov edx, dword [eax + 0x40]
test edx, edx
je 0x469cd5
mov dword [esp + 4], str.Reset_failed._Restarting_braille_driver
mov dword [esp], 4
call sym.brltty.exe_logMessage
call sym.brltty.exe_restartBrailleDriver
mov dword [esp], sym.brltty.exe_apiDriverMutex
call sym.brltty.exe_unlockMutex
mov dword [esp], sym.brltty.exe_apiRawMutex
call sym.brltty.exe_unlockMutex
jmp 0x469ab7
mov eax, dword [ebx + 8]
mov dword [esp + 4], str.closing_connection_on_fd__p
mov dword [esp], 0x8a
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
jmp 0x469aa1
mov eax, dword [ebx + 0x48]
mov dword [esp], eax
call sub.ws2_32.dll_ntohl
mov dword [ebx + 0x48], eax
mov eax, dword [ebx + 0x4c]
sub esp, 4
mov dword [esp], eax
call sub.ws2_32.dll_ntohl
mov dword [ebx + 0x4c], eax
mov eax, dword [ebx + 0x48]
sub esp, 4
test eax, eax
je 0x469b9d
cmp eax, 0x200
mov dword [ebx + 0x258], 0
ja 0x46a041
mov dword [ebx + 0x254], 2
mov dword [ebx + 0x260], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebx + 0x25c], eax
jmp 0x4698fa
lea eax, [ebx + 8]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x34]
lea edx, [ebx + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
mov eax, dword [ebp - 0x38]
call fcn.00469210
test eax, eax
je 0x469879
jmp 0x46984d
lea eax, [ecx - 0x23]
cmp eax, 0x54
ja case.0x469db0.36
nop
jmp dword [eax*4 + 0x49b824]
mov eax, dword [0x4758e0]
mov dword [ebp - 0x38], eax
nop
mov eax, dword [ebp - 0x38]
test eax, eax
je case.0x469db0.36
mov eax, dword [ebx + 8]
cmp ecx, 0x76
mov dword [ebp - 0x40], eax
mov eax, 0x49c120
jne 0x469de8
jmp 0x469f4d
cmp ecx, edx
je 0x469f52
add eax, 8
mov edx, dword [eax]
test edx, edx
nop
jne 0x469de0
mov eax, str.Unknown
mov dword [ebp - 0x44], ecx
mov ecx, dword [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], str.received__s_request_on_fd__p
mov dword [esp], 0x8a
mov dword [esp + 0xc], ecx
call sym.brltty.exe_logMessage
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x44]
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x38]
call eax
jmp 0x469879
mov eax, dword [0x4758dc]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758cc]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758c8]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758ec]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758c0]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758d8]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758c4]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758f0]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758f4]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758d4]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758d0]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758e4]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [0x4758e8]
mov dword [ebp - 0x38], eax
jmp 0x469dc0
mov eax, dword [ebx + 8]
mov dword [esp + 8], 4
mov dword [esp + 4], str.writing_exception__d_to__p
mov dword [esp], 3
mov dword [esp + 0xc], eax
mov dword [ebp - 0x38], ecx
call sym.brltty.exe_logMessage
mov dword [esp + 4], str.unknown_packet_type
mov dword [esp], 3
call sym.brltty.exe_logMessage
mov ecx, dword [ebp - 0x34]
mov edx, 4
mov eax, dword [ebx + 8]
mov dword [esp + 4], ecx
mov ecx, dword [ebp - 0x3c]
mov dword [esp], ecx
mov ecx, dword [ebp - 0x38]
call fcn.004681b0
jmp 0x469879
mov eax, 0x49c120
mov eax, dword [eax + 4]
jmp 0x469c1d
mov eax, 0x49c120
mov eax, dword [eax + 4]
jmp 0x469df7
mov dword [esp], sym.brltty.exe_apiRawMutex
call sym.brltty.exe_lockMutex
mov eax, dword [ebx + 8]
mov dword [ebx + 0x18], 0
mov dword [esp + 4], str.Client_on_fd__p_did_not_give_up_suspended_mode_properly
mov dword [esp], 4
mov dword [esp + 8], eax
mov dword [0x4c02b0], 0
call sym.brltty.exe_logMessage
mov dword [esp], sym.brltty.exe_apiDriverMutex
call sym.brltty.exe_lockMutex
mov eax, dword [0x4c0204]
test eax, eax
je 0x469ffc
mov eax, dword [0x4c026c]
mov eax, dword [eax + 0x40]
test eax, eax
je 0x469cda
mov dword [esp + 4], str.trying_to_reset_braille_terminal
mov dword [esp], 0x8a
call sym.brltty.exe_logMessage
mov eax, dword [0x4c0210]
mov dword [esp], eax
mov eax, dword [0x4c026c]
call dword [eax + 0x40]
test eax, eax
jne 0x469cda
mov dword [esp + 4], str.Resetting_braille_terminal_failed__hoping_its_ok
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x469cda
mov eax, dword [0x4c0200]
test eax, eax
jne 0x469cda
mov eax, dword [0x4c0210]
test eax, eax
je 0x46a01b
call fcn.00465bd0
test eax, eax
jne 0x46a02f
mov dword [esp + 4], str.Couldnt_resume_braille_driver
mov dword [esp], 4
call sym.brltty.exe_logMessage
mov eax, dword [0x4c0204]
test eax, eax
je 0x469cda
jmp 0x469fa7
mov dword [ebx + 0x254], 3
mov dword [ebx + 0x260], 0x200
jmp 0x469d69