Function at 0x405f60
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
test byte [ebp + 0xc], 1
je 0x406066
lea esi, [ebp - 0x14]
mov ebx, 8
jmp 0x405f88
sub ebx, eax
add esi, eax
test ebx, ebx
jle 0x405fc5
push edi
push ebx
push esi
mov ecx, dword [ebp + 8]
push ecx
call dbg.adb_read
add esp, 0x10
cmp eax, 0
jg 0x405f80
je 0x405fa8
call sym.__errno
cmp dword [eax], 4
je 0x405f84
test byte [0x443b68], 8
jne 0x406271
sub esp, 0xc
push str.cannot_read_transport_registration_socket
call dbg.fatal_errno
add esp, 0x10
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
test eax, eax
jne 0x40606e
test byte [0x443b68], 8
jne 0x406147
sub esp, 0xc
lea eax, [edi + 0x20]
push eax
call dbg.fdevent_remove
mov ecx, dword [edi + 0x18]
pop ebx
push ecx
call dbg.adb_close
mov dword [esp], 0x443b78
call sub.KERNEL32.dll_EnterCriticalSection
mov edx, dword [edi]
mov eax, dword [edi + 4]
mov dword [edx + 4], eax
mov eax, dword [edi + 4]
mov dword [eax], edx
push 0x443b78
call sub.KERNEL32.dll_LeaveCriticalSection
push edi
call dbg.run_transport_disconnects
mov eax, dword [edi + 0x58]
add esp, 0x10
test eax, eax
je 0x406035
sub esp, 0xc
push eax
call sym._free
add esp, 0x10
mov eax, dword [edi + 0x54]
test eax, eax
je 0x406048
sub esp, 0xc
push eax
call sym._free
add esp, 0x10
push edx
push 0x74
push 0xee
push edi
call sym._memset
mov dword [esp], edi
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 [edi + 0x44], 5
je 0x4060fe
sub esp, 0xc
mov dword [edi + 0x3c], 2
lea eax, [ebp - 0x1c]
push eax
call dbg.adb_socketpair
add esp, 0x10
test eax, eax
jne 0x406232
test byte [0x443b68], 8
jne 0x4061ba
mov eax, dword [ebp - 0x1c]
lea ebx, [edi + 0x20]
mov dword [edi + 0x1c], eax
mov eax, dword [ebp - 0x18]
mov dword [edi + 0x18], eax
push edi
push dbg.transport_socket_events
mov eax, dword [edi + 0x1c]
push eax
push ebx
call dbg.fdevent_install
pop esi
pop eax
push 1
push ebx
call dbg.fdevent_set
add esp, 0xc
push edi
push 0
push dbg.input_thread
call sym.__beginthread
add esp, 0x10
inc eax
je 0x40625c
push ecx
push edi
push 0
push dbg.output_thread
call sym.__beginthread
add esp, 0x10
inc eax
je 0x406247
sub esp, 0xc
push 0x443b78
call sub.KERNEL32.dll_EnterCriticalSection
mov eax, dword [0x425084]
mov dword [edi], 0x425080
mov dword [edi + 4], eax
mov dword [0x425084], edi
mov eax, dword [edi + 4]
mov dword [eax], edi
push 0x443b78
call sub.KERNEL32.dll_LeaveCriticalSection
lea eax, [edi + 0x64]
mov dword [edi + 0x70], eax
mov dword [edi + 0x6c], eax
add esp, 0xc
call dbg.update_transports
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sym.__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x443b48
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.transport_registration_func
push str.system_core_adb_transport.c
push 0x4268e4
push ebx
call sym._fprintf_2
call sym.__errno
mov dword [eax], esi
mov eax, dword [edi + 0x1c]
push eax
mov eax, dword [edi + 0x54]
push eax
push str.transport:__s_removing_and_freeing__d_n
push ebx
call sym._fprintf_2
add esp, 0x14
push ebx
call sym._fflush
mov dword [esp], 0x443b48
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sym.__errno
mov dword [eax], esi
jmp 0x405fe0
call sym.__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x443b48
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.transport_registration_func
push str.system_core_adb_transport.c
push 0x4268e4
push ebx
call sym._fprintf_2
call sym.__errno
mov dword [eax], esi
pop eax
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [edi + 0x54]
push eax
push str.transport:__s___d__d__starting_n
push ebx
call sym._fprintf_2
add esp, 0x14
push ebx
call sym._fflush
mov dword [esp], 0x443b48
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sym.__errno
mov dword [eax], esi
jmp 0x4060a3
sub esp, 0xc
push str.cannot_open_transport_socketpair
call dbg.fatal_errno
add esp, 0x10
jmp 0x406096
sub esp, 0xc
push str.cannot_create_output_thread
call dbg.fatal_errno
add esp, 0x10
jmp 0x4060fe
sub esp, 0xc
push 0x427238
call dbg.fatal_errno
add esp, 0x10
jmp 0x4060e6
call sym.__errno
sub esp, 0xc
mov edi, dword [eax]
push 0x443b48
call sub.KERNEL32.dll_EnterCriticalSection
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add esi, 0x40
push str.transport_read_action
push str.system_core_adb_transport.c
push 0x4268e4
push esi
call sym._fprintf_2
call sym.__errno
mov dword [eax], edi
call sym.__errno
pop edx
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 [ebp + 8]
push eax
push str.transport_read_action:_on_fd__d__error__d:__s_n
push esi
call sym._fprintf_2
add esp, 0x14
push esi
call sym._fflush
mov dword [esp], 0x443b48
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sym.__errno
mov dword [eax], edi
jmp 0x405fb5