Function at 0x46b940
Capabilities:
Check mutex on windows
Terminate thread

Disassembly:
push ebp
mov eax, str.:0127.0.0.1:0
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [ebp + 0xc]
mov dword [0x4c0380], 0x10000
mov ebx, dword [esi + 4]
mov edi, dword [esi + 8]
cmp byte [ebx], 0
cmove ebx, eax
cmp byte [edi], 0
jne 0x46bc10
mov eax, dword [esi]
mov dword [0x4758f8], 0x49b4b3
cmp byte [eax], 0
je 0x46b986
mov dword [0x4758f8], eax
xor edx, edx
xor ecx, ecx
mov eax, 0xffffffff
mov dword [0x4c020c], 1
call fcn.00466970
test eax, eax
mov dword [0x4c029c], eax
je 0x46bc40
mov dword [eax + 4], eax
xor edx, edx
xor ecx, ecx
mov dword [eax], eax
mov eax, 0xffffffff
call fcn.00466970
test eax, eax
mov dword [0x4c0280], eax
je 0x46bc56
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [0x4c0278], 0xffffffff
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov dword [sym.brltty.exe_apiConnectionsMutex], eax
je 0x46bcc0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov dword [sym.brltty.exe_apiDriverMutex], eax
je 0x46bd00
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov dword [sym.brltty.exe_apiRawMutex], eax
je 0x46bce0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.kernel32.dll_CreateMutexA
sub esp, 0xc
test eax, eax
mov dword [sym.brltty.exe_apiSuspendMutex], eax
je 0x46bc95
mov eax, dword [ebp + 8]
mov dword [esp], sym.brltty.exe_handleServerFlushEvent
mov dword [ebp - 0x1c], 0
mov dword [esp + 4], eax
call sym.brltty.exe_asyncNewEvent
test eax, eax
mov dword [0x4c037c], eax
je 0x46bbd5
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], sym.brltty.exe_runServer
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4c0368
mov dword [esp], str.server_main
mov dword [0x4c0354], 1
mov dword [0x4c026c], 0x4885a0
call sym.brltty.exe_createThread
mov edx, 1
test eax, eax
jne 0x46bb00
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], eax
xor ebx, ebx
call sub.msvcrt.dll_strerror
mov dword [esp + 4], str.pthread_create:__s
mov dword [esp], 4
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
mov eax, dword [0x4c02bc]
mov dword [0x4c0354], 0
test eax, eax
jle 0x46bbc8
mov eax, dword [ebx*4 + 0x4c0358]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.kernel32.dll_TerminateThread
sub esp, 8
test eax, eax
jne 0x46bb72
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
mov esi, dword [ebx*4 + 0x4c0358]
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x46bbb9
cmp eax, 0x102
je 0x46bb79
test eax, eax
je 0x46bbb9
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
add ebx, 1
cmp dword [0x4c02bc], ebx
jg 0x46bb39
mov eax, dword [0x4c037c]
mov dword [esp], eax
call sym.brltty.exe_asyncDiscardEvent
mov eax, dword [0x4c0280]
call fcn.004666e0
mov eax, dword [0x4c029c]
call fcn.004666e0
mov eax, dword [0x4c01f0]
mov dword [esp], eax
call sym.brltty.exe_authEnd
xor edx, edx
mov dword [0x4c01f0], 0
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x49be64
mov dword [esp + 4], edi
mov dword [esp], eax
call sym.brltty.exe_validateInteger
test eax, eax
je 0x46bc70
mov eax, dword [ebp - 0x1c]
mov dword [0x4c0380], eax
jmp 0x46b970
mov dword [esp + 4], str.Unable_to_create_connections_list
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x46bbe9
mov dword [esp + 4], str.Unable_to_create_ttys_connections_list
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x46bbdf
mov dword [esp + 0xc], edi
mov dword [esp + 8], str.invalid_thread_stack_size
mov dword [esp + 4], str._s:__s
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x46b970
call sub.msvcrt.dll__errno
mov esi, eax
lea esi, [esi]
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
jmp 0x46ba8a
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
jmp 0x46ba06
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
jmp 0x46ba5e
call sub.msvcrt.dll__errno
mov esi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [esi], eax
call sub.msvcrt.dll__errno
jmp 0x46ba32