Function at 0x46a060
Capabilities:
Check mutex on windows
Initialize winsock library
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4dc
mov dword [esp + 4], str.server_thread_started
mov dword [esp], 0x8a
mov dword [ebp - 0x4ac], 0
call sym.brltty.exe_logMessage
mov eax, dword [0x4758f8]
test eax, eax
je 0x46a0a3
mov dword [esp], eax
call sym.brltty.exe_isAbsolutePath
test eax, eax
je 0x46a8d1
mov eax, dword [ebp + 8]
mov dword [esp + 8], 0x4c02bc
mov dword [esp + 4], 0x2b
mov dword [esp], eax
call sym.brltty.exe_splitString
mov edx, dword [0x4c02bc]
cmp edx, 4
mov dword [0x4c0350], eax
jg 0x46a920
cmp edx, 0
je 0x46a945
mov dword [ebp - 0x4b0], edx
mov dword [ebp - 0x4bc], 0
jle 0x46a10a
lea edx, [edx + edx*8]
mov eax, 0x4c02c0
lea edx, [edx*4 + 0x4c02c0]
mov dword [eax + 4], 0xffffffff
add eax, 0x24
cmp eax, edx
jne 0x46a0fc
mov eax, dword [sym.brltty.exe_getaddrinfoProc]
test eax, eax
je 0x46a870
mov dword [esp + 4], 0x4c0060
mov dword [esp], 2
call sub.ws2_32.dll_WSAStartup
sub esp, 8
test eax, eax
jne 0x46a88f
mov eax, dword [sym.brltty.exe_getaddrinfoProc]
test eax, eax
je 0x46a870
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_serverSocketsMutex], eax
je 0x46aaba
mov ebx, dword [0x4c02bc]
test ebx, ebx
mov dword [0x4c02b8], ebx
jle 0x46a332
mov edi, 0x4c02c0
xor ebx, ebx
mov dword [ebp - 0x4cc], 0x4c0358
jmp 0x46a2d9
mov dword [esp], edx
mov dword [esp + 4], 0x3a
mov dword [ebp - 0x4d0], edx
call sub.msvcrt.dll_strrchr
mov edx, dword [ebp - 0x4d0]
test eax, eax
mov esi, eax
je 0x46a901
cmp edx, eax
je 0x46a313
lea eax, [eax + 1]
mov dword [esp], eax
mov dword [ebp - 0x4d4], edx
call sub.msvcrt.dll_atoi
mov edx, 0x1005
cmp eax, 0xeffa
lea ecx, [eax + 0x1005]
cmovg ecx, edx
mov edx, dword [ebp - 0x4d4]
mov dword [ebp - 0x4d0], ecx
sub esi, edx
lea eax, [esi + 1]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, dword [ebp - 0x4d4]
mov dword [edi + 8], eax
mov dword [esp + 4], edx
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [ebp - 0x4d4], eax
call sub.msvcrt.dll_memcpy
mov ecx, dword [ebp - 0x4d4]
mov byte [ecx + esi], 0
mov dword [esp], 6
call sub.msvcrt.dll_malloc
mov ecx, dword [ebp - 0x4d0]
mov dword [edi + 0xc], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0x49b9fc
mov dword [esp + 4], 6
mov dword [esp], eax
call fcn.0046e270
lea eax, [ebp - 0x218]
mov dword [edi], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.server_socket_create__d
mov dword [esp + 4], 0x100
mov dword [esp], eax
call fcn.0046e270
lea eax, [ebp - 0x4bc]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x4cc]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], sym.brltty.exe_createServerSocket
mov dword [esp + 4], eax
lea eax, [ebp - 0x218]
mov dword [esp], eax
call sym.brltty.exe_createThread
test eax, eax
jne 0x46a9c8
mov eax, dword [0x4c02bc]
add ebx, 1
add edi, 0x24
add dword [ebp - 0x4cc], 4
cmp eax, ebx
jle 0x46a330
mov eax, dword [0x4c0350]
mov edx, dword [eax + ebx*4]
test edx, edx
je 0x46a2ee
cmp byte [edx], 0
jne 0x46a1a0
mov dword [edi + 8], 0
mov dword [esp], 0x49b9fa
call sub.msvcrt.dll__strdup
mov dword [edi + 0xc], eax
mov dword [edi], 1
mov eax, ebx
call fcn.00466030
jmp 0x46a2c3
add edx, 1
mov dword [edi + 8], 0
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov dword [edi + 0xc], eax
jmp 0x46a304
mov ebx, eax
mov eax, dword [0x4c0354]
mov dword [0x4c0274], 0
mov dword [0x4c0270], 0
test eax, eax
je 0x46a44a
mov eax, dword [ebp - 0x4b0]
shl eax, 2
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test ebx, ebx
mov dword [ebp - 0x4ac], 0
mov dword [ebp - 0x4b4], eax
jle 0x46a3ab
lea edx, [ebx + ebx*8]
mov eax, 0x4c02c0
lea esi, [edx*4 + 0x4c02c0]
xor edx, edx
cmp dword [eax + 4], 0xffffffff
je 0x46a39e
mov ebx, dword [eax + 0x20]
mov ecx, dword [ebp - 0x4b4]
mov dword [ecx + edx*4], ebx
add edx, 1
add eax, 0x24
cmp eax, esi
jne 0x46a389
mov dword [ebp - 0x4ac], edx
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_lockMutex
lea ecx, [ebp - 0x4ac]
lea edx, [ebp - 0x4b0]
lea eax, [ebp - 0x4b4]
mov dword [esp + 4], 0x4c02ac
mov dword [esp], 0x4c029c
call fcn.00466570
lea ecx, [ebp - 0x4ac]
lea edx, [ebp - 0x4b0]
lea eax, [ebp - 0x4b4]
mov dword [esp + 4], 0x4c0290
mov dword [esp], 0x4c0280
call fcn.00466570
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_unlockMutex
mov eax, dword [ebp - 0x4ac]
test eax, eax
jne 0x46a560
mov eax, dword [ebp - 0x4b4]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], 0x3e8
call sym.brltty.exe_approximateDelay
mov eax, dword [0x4c0354]
mov ebx, dword [0x4c02bc]
test eax, eax
jne 0x46a353
test ebx, ebx
jle 0x46a8a0
mov ebx, 0x4c02c0
xor esi, esi
jmp 0x46a4b6
mov eax, dword [ebx + 0x20]
mov dword [ebx + 4], 0xffffffff
test eax, eax
je 0x46a480
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
mov dword [ebx + 0x20], 0
sub esp, 4
mov eax, dword [ebx + 0xc]
add esi, 1
add ebx, 0x24
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebx - 0x1c]
mov dword [ebx - 0x18], 0
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [ebx - 0x1c], 0
cmp esi, dword [0x4c02bc]
jge 0x46a8a0
mov eax, dword [esi*4 + 0x4c0358]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.kernel32.dll_TerminateThread
sub esp, 8
test eax, eax
jne 0x46a4ef
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov edi, dword [esi*4 + 0x4c0358]
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
cmp eax, 0x80
je 0x46a536
cmp eax, 0x102
je 0x46a4f6
test eax, eax
je 0x46a536
call sub.msvcrt.dll__errno
mov edi, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.kernel32.dll_CloseHandle
sub esp, 4
test eax, eax
je 0x46a460
mov dword [esp], str.closing_socket
call sym.brltty.exe_logSystemError
jmp 0x46a460
mov edx, dword [ebp - 0x4b4]
mov dword [esp + 0xc], 0x3e8
mov dword [esp + 8], 0
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.kernel32.dll_WaitForMultipleObjects
sub esp, 0x10
cmp eax, 0x102
je 0x46a437
cmp eax, 0xffffffff
jne 0x46a5a1
mov dword [esp], str.WaitForMultipleObjects
call sym.brltty.exe_logWindowsSystemError
mov eax, dword [ebp - 0x4b4]
xor esi, esi
mov ebx, 0x4c02c4
mov dword [esp], eax
call sub.msvcrt.dll_free
lea eax, [ebp - 0x4a8]
mov dword [esp], eax
call sub.msvcrt.dll__time64
mov eax, dword [0x4c02bc]
test eax, eax
jle 0x46a6f2
cmp dword [ebx], 0xffffffff
je 0x46a6e0
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call sub.kernel32.dll_WaitForSingleObject
sub esp, 8
test eax, eax
jne 0x46a6e0
cmp dword [ebx - 4], 1
je 0x46a7d4
mov eax, dword [ebx + 0x1c]
mov dword [esp], eax
call sub.kernel32.dll_ResetEvent
sub esp, 4
test eax, eax
je 0x46a8c0
lea edx, [ebp - 0x4a0]
lea eax, [ebp - 0x4b8]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov eax, dword [ebx]
mov dword [ebp - 0x4cc], edx
mov dword [ebp - 0x4b8], pe_nt_image_headers32
mov dword [esp], eax
call sub.ws2_32.dll_accept
mov edx, dword [ebp - 0x4cc]
sub esp, 0xc
cmp eax, 0xffffffff
mov edi, eax
je 0x46a980
mov eax, dword [ebp - 0x4b8]
mov dword [esp + 8], edx
lea edx, [ebp - 0x41c]
mov dword [esp], edx
mov dword [esp + 4], 0x100
mov dword [esp + 0xc], eax
mov dword [ebp - 0x4cc], edx
call sym.brltty.exe_formatAddress
mov edx, dword [ebp - 0x4cc]
mov dword [esp + 0xc], edx
mov dword [esp + 8], edi
mov dword [esp + 4], str.BrlAPI_connection_fd_p_accepted:__s
mov dword [esp], 5
call sym.brltty.exe_logMessage
cmp dword [0x4c0274], 4
jbe 0x46a733
mov edx, 8
mov eax, edi
call fcn.00466910
mov dword [esp], edi
call sub.kernel32.dll_CloseHandle
mov eax, dword [0x4c0270]
sub esp, 4
test eax, eax
je 0x46a960
add eax, 1
mov dword [0x4c0270], eax
nop
add esi, 1
add ebx, 0x24
cmp dword [0x4c02bc], esi
jg 0x46a5d1
mov edx, dword [ebp - 0x4a8]
lea eax, [ebp - 0x31c]
mov ecx, dword [ebp - 0x4a4]
mov dword [esp], 0x4c0294
call fcn.004697f0
mov edx, dword [ebp - 0x4a8]
lea eax, [ebp - 0x31c]
mov ecx, dword [ebp - 0x4a4]
mov dword [esp], 0x4c0278
call fcn.004697f0
jmp 0x46a437
mov edx, dword [ebp - 0x4a8]
mov eax, edi
mov ecx, dword [ebp - 0x4a4]
call fcn.00466970
test eax, eax
je 0x46aa96
mov edi, dword [0x4c029c]
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
mov dword [ebp - 0x4cc], eax
add dword [0x4c0274], 1
call sym.brltty.exe_lockMutex
mov eax, dword [edi + 4]
mov edx, dword [ebp - 0x4cc]
mov dword [edx + 4], eax
mov eax, dword [edi + 4]
mov dword [edx], edi
mov dword [eax], edx
mov dword [edi + 4], edx
mov dword [esp], sym.brltty.exe_apiConnectionsMutex
call sym.brltty.exe_unlockMutex
mov dword [esp], 8
call sub.ws2_32.dll_htonl
mov edx, dword [ebp - 0x4cc]
sub esp, 4
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x218]
mov dword [esp + 0xc], 4
mov dword [esp + 8], eax
mov dword [esp + 4], 0x76
mov eax, dword [edx + 8]
mov dword [esp], eax
call sym.brltty.exe_brlapiserver_writePacket
jmp 0x46a6e0
lea eax, [ebp - 0x218]
mov dword [esp + 8], eax
lea eax, [ebx + 0xc]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.kernel32.dll_GetOverlappedResult
sub esp, 0x10
test eax, eax
je 0x46aa85
lea eax, [ebx - 4]
mov edi, dword [ebx]
call fcn.004656e0
cmp eax, 0xffffffff
mov dword [ebx], eax
je 0x46a833
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], str.socket__d_re_established__fd__p__was__p_
mov dword [esp], 0x8a
call sym.brltty.exe_logMessage
mov eax, dword [ebx + 8]
lea edx, [ebp - 0x41c]
mov dword [esp], edx
mov dword [esp + 8], str..pipeBrlAPI_s
mov dword [esp + 4], 0x100
mov dword [esp + 0xc], eax
mov dword [ebp - 0x4cc], edx
call fcn.0046e270
mov edx, dword [ebp - 0x4cc]
jmp 0x46a68a
mov dword [esp + 4], 0x4c0060
mov dword [esp], 0x101
call sub.ws2_32.dll_WSAStartup
sub esp, 8
test eax, eax
je 0x46a143
mov dword [esp], str.Starting_socket_library
call sym.brltty.exe_logWindowsSocketError
nop
lea esi, [esi]
mov dword [esp + 4], str.server_thread_finished
mov dword [esp], 0x8a
call sym.brltty.exe_logMessage
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.ResetEvent_in_server_loop
call sym.brltty.exe_logWindowsSystemError
jmp 0x46a618
mov eax, dword [0x4758f8]
mov dword [esp], eax
call sym.brltty.exe_authBeginServer
test eax, eax
mov dword [0x4c01f0], eax
jne 0x46a0a3
mov dword [esp + 4], str.Unable_to_start_auth_server
mov dword [esp], 4
call sym.brltty.exe_logMessage
jmp 0x46a8a0
mov dword [esp], edx
call sub.msvcrt.dll__strdup
mov dword [edi + 8], eax
mov dword [esp], str.4101
call sub.msvcrt.dll__strdup
mov dword [edi + 0xc], eax
jmp 0x46a265
mov dword [esp + 0xc], 4
mov dword [esp + 8], edx
mov dword [esp + 4], str.too_many_hosts_specified:__d____d_
mov dword [esp], 3
call sym.brltty.exe_logMessage
jmp 0x46a8a0
mov dword [esp + 4], str.no_hosts_specified
mov dword [esp], 6
call sym.brltty.exe_logMessage
jmp 0x46a8a0
mov dword [esp + 4], str.Too_many_simultaneous_unauthorized_connections
mov dword [esp], 4
call sym.brltty.exe_logMessage
mov eax, dword [0x4c0270]
jmp 0x46a6d7
call sub.msvcrt.dll__errno
mov edi, eax
call sub.ws2_32.dll_WSAGetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [edi], eax
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 0xc], eax
mov eax, dword [ebx]
mov dword [esp + 4], str.accept__p_:__s
mov dword [esp], 4
mov dword [esp + 8], eax
call sym.brltty.exe_logMessage
jmp 0x46a6e0
mov dword [esp], eax
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
sub ebx, 1
cmp ebx, 0xffffffff
je 0x46a8a0
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 0x46aa2d
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 0x46a9e8
cmp eax, 0x102
je 0x46aa34
test eax, eax
je 0x46a9e8
call sub.msvcrt.dll__errno
sub ebx, 1
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
cmp ebx, 0xffffffff
jne 0x46a9f4
jmp 0x46a8a0
mov dword [esp], str.GetOverlappedResult
call sym.brltty.exe_logWindowsSystemError
jmp 0x46a802
mov dword [esp + 4], str.Failed_to_create_connection_structure
mov dword [esp], 4
call sym.brltty.exe_logMessage
mov dword [esp], edi
call sub.kernel32.dll_CloseHandle
sub esp, 4
jmp 0x46a6e0
call sub.msvcrt.dll__errno
mov ebx, eax
call sub.kernel32.dll_GetLastError
mov dword [esp], eax
call sym.brltty.exe_win_toErrno
mov dword [ebx], eax
call sub.msvcrt.dll__errno
jmp 0x46a16f