Function at 0x408740
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
mov ebx, edx
sub esp, 0x3c
lea eax, [ebp - 0x20]
mov dword [esp], eax
call fcn.0040e6d0
test eax, eax
jne 0x408906
test byte [0x561ee1], 2
jne 0x4087c4
mov dword [esp], 0xc
call sub.msvcrt.dll_malloc
test eax, eax
mov edi, eax
je 0x408950
mov dword [eax], esi
mov dword [eax + 8], ebx
mov eax, dword [ebp - 0x1c]
mov dword [edi + 4], eax
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0x4086d0
call dword [sym.imp.msvcrt.dll__beginthread]
cmp eax, 0xffffffff
je 0x40891c
test byte [0x561ee1], 2
jne 0x408868
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov ecx, dword [ebp - 0x1c]
mov eax, dword [eax]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp - 0x20]
mov dword [esp + 4], 0x51c107
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x24]
mov dword [esp + 8], ecx
mov dword [esp], eax
call fcn.0042a1c0
lea ecx, [ebp - 0x28]
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0xce
mov dword [esp], str.system_core_adb_services.cpp
call fcn.0042a560
lea ecx, [ebp - 0x28]
sub esp, 0x14
call fcn.0042a6d0
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx - 0xc]
mov dword [esp + 4], ecx
mov dword [esp], eax
mov dword [esp + 8], edx
call fcn.00505c10
lea ecx, [ebp - 0x28]
call fcn.0042a790
mov eax, dword [ebp - 0x24]
lea ecx, [eax - 0xc]
cmp ecx, 0x516f30
jne 0x40895c
call edi
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
jmp 0x408769
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [eax]
lea eax, [ebp - 0x24]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp - 0x20]
mov dword [esp], eax
mov dword [esp + 4], str.service_thread_started___d:_d
mov dword [esp + 8], ecx
call fcn.0042a1c0
lea ecx, [ebp - 0x28]
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0xe0
mov dword [esp], str.system_core_adb_services.cpp
call fcn.0042a560
lea ecx, [ebp - 0x28]
sub esp, 0x14
call fcn.0042a6d0
mov ecx, dword [ebp - 0x24]
mov esi, dword [ecx - 0xc]
mov dword [esp + 4], ecx
mov dword [esp], eax
mov dword [esp + 8], esi
call fcn.00505c10
lea ecx, [ebp - 0x28]
call fcn.0042a790
mov eax, dword [ebp - 0x24]
lea esi, [eax - 0xc]
cmp esi, 0x516f30
jne 0x408983
call edi
mov dword [eax], ebx
jmp 0x4087b9
mov dword [esp], str.cannot_create_service_socket_pair_n
call fcn.00415a30
mov eax, 0xffffffff
jmp 0x4087bc
mov dword [esp], edi
call fcn.004ae080
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call fcn.0040e5b0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call fcn.0040e5b0
mov dword [esp], str.cannot_create_service_thread_n
call fcn.00415a30
mov eax, 0xffffffff
jmp 0x4087bc
mov dword [esp], str.cannot_allocate_stinfo
call fcn.004167f0
sub eax, 4
mov dword [ebp - 0x30], ecx
call fcn.0050de90
mov ecx, dword [ebp - 0x30]
test eax, eax
jg 0x40885c
lea eax, [ebp - 0x28]
mov dword [esp], eax
call fcn.004dba20
push edx
jmp 0x40885c
sub eax, 4
call fcn.0050de90
test eax, eax
jg 0x4088fd
lea eax, [ebp - 0x28]
mov ecx, esi
mov dword [esp], eax
call fcn.004dba20
push eax
jmp 0x4088fd