Function at 0x404a10
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov edi, dword [ebp + 8]
test byte [ebp + 0xc], 1
je 0x404b13
lea esi, [ebp - 0x14]
mov ebx, 8
jmp 0x404a38
sub ebx, eax
add esi, eax
test ebx, ebx
jle 0x404a72
push eax
push ebx
push esi
push edi
call dbg.adb_read
add esp, 0x10
cmp eax, 0
jg 0x404a30
je 0x404a55
call sym.__errno
cmp dword [eax], 4
je 0x404a34
test byte [0x434b38], 8
jne 0x404c80
sub esp, 0xc
push str.cannot_read_transport_registration_socket
call dbg.fatal_errno
add esp, 0x10
mov eax, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
test eax, eax
jne 0x404b1b
test byte [0x434b38], 8
jne 0x404bf4
sub esp, 0xc
lea eax, [esi + 0x20]
push eax
call dbg.fdevent_remove
pop ecx
mov edx, dword [esi + 0x18]
push edx
call dbg.adb_close
mov dword [esp], 0x434b48
call sub.KERNEL32.dll_EnterCriticalSection
mov edx, dword [esi]
mov eax, dword [esi + 4]
mov dword [edx + 4], eax
mov eax, dword [esi + 4]
mov dword [eax], edx
push 0x434b48
call sub.KERNEL32.dll_LeaveCriticalSection
push esi
call dbg.run_transport_disconnects
mov eax, dword [esi + 0x54]
add esp, 0x10
test eax, eax
je 0x404ae2
sub esp, 0xc
push eax
call sym._free
add esp, 0x10
mov eax, dword [esi + 0x50]
test eax, eax
je 0x404af5
sub esp, 0xc
push eax
call sym._free
add esp, 0x10
push eax
push 0x70
push 0xee
push esi
call sym._memset
mov dword [esp], esi
call sym._free
call dbg.update_transports
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esi + 0x40], 5
je 0x404bab
sub esp, 0xc
mov dword [esi + 0x38], 2
lea eax, [ebp - 0x1c]
push eax
call dbg.adb_socketpair
add esp, 0x10
test eax, eax
jne 0x404c41
test byte [0x434b38], 8
jne 0x404c17
mov eax, dword [ebp - 0x1c]
lea ebx, [esi + 0x20]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x18], eax
push esi
push dbg.transport_socket_events
mov eax, dword [esi + 0x1c]
push eax
push ebx
call dbg.fdevent_install
pop edi
pop eax
push 1
push ebx
call dbg.fdevent_set
add esp, 0xc
push esi
push 0
push dbg.input_thread
call sym.__beginthread
add esp, 0x10
inc eax
je 0x404c6b
push ecx
push esi
push 0
push dbg.output_thread
call sym.__beginthread
add esp, 0x10
inc eax
je 0x404c56
sub esp, 0xc
push 0x434b48
call sub.KERNEL32.dll_EnterCriticalSection
mov eax, dword [0x419064]
mov dword [esi], 0x419060
mov dword [esi + 4], eax
mov dword [0x419064], esi
mov eax, dword [esi + 4]
mov dword [eax], esi
push 0x434b48
call sub.KERNEL32.dll_LeaveCriticalSection
lea eax, [esi + 0x60]
mov dword [esi + 0x6c], eax
mov dword [esi + 0x68], eax
add esp, 0xc
call dbg.update_transports
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [esi + 0x1c]
mov eax, dword [sym.imp.msvcrt.dll__iob]
push edi
add eax, 0x40
mov ebx, dword [esi + 0x50]
push ebx
push str.transport:__s_removing_and_freeing__d_n
push eax
call sym._fprintf_2
add esp, 0x10
jmp 0x404a8d
sub esp, 0xc
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x50]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push str.transport:__s___d__d__starting_n
push eax
call sym._fprintf_2
add esp, 0x20
jmp 0x404b50
sub esp, 0xc
push str.cannot_open_transport_socketpair
call dbg.fatal_errno
add esp, 0x10
jmp 0x404b43
sub esp, 0xc
push str.cannot_create_output_thread
call dbg.fatal_errno
add esp, 0x10
jmp 0x404bab
sub esp, 0xc
push 0x41b0b4
call dbg.fatal_errno
add esp, 0x10
jmp 0x404b93
call sym.__errno
sub esp, 0xc
mov eax, dword [eax]
push eax
call sym._strerror
mov ebx, eax
call sym.__errno
mov dword [esp], ebx
mov eax, dword [eax]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push edi
push str.transport_read_action:_on_fd__d__error__d:__s_n
push eax
call sym._fprintf_2
add esp, 0x20
jmp 0x404a62