Function at 0x40d3f0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xc
mov edi, eax
test byte [0x4dcfc8], 2
jne 0x40d611
mov ebx, dword [edi + 0x14]
test ebx, ebx
je 0x40d448
test byte [0x4dcfc8], 2
jne 0x40d684
mov eax, dword [edi + 0x14]
mov dword [eax + 0x14], 0
mov eax, dword [edi + 0x14]
mov edx, dword [eax + 0x48]
cmp edx, 0x40f550
je 0x40d772
sub esp, 0xc
push eax
call edx
add esp, 0x10
mov dword [edi + 0x14], 0
mov ebx, dword [edi + 0xc]
test ebx, ebx
jne 0x40d4a0
mov ecx, dword [edi + 0x38]
test ecx, ecx
je 0x40d4a0
test byte [0x4dcfc8], 2
jne 0x40d7ef
mov dword [edi + 0xc], 1
push eax
push eax
lea eax, [edi + 0x18]
push 1
push eax
call fcn.004143d0
push edi
call fcn.0040d150
add esp, 0x14
test byte [0x4dcfc8], 2
jne 0x40d77c
lea esp, [ebp - 0xc]
mov eax, edi
mov edx, 0x49b180
pop ebx
pop esi
pop edi
pop ebp
jmp fcn.0040d130
mov eax, dword [edi + 8]
test byte [0x4dcfc8], 2
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0x10]
mov dword [ebp - 0x14], eax
jne 0x40d6ff
sub esp, 0xc
lea eax, [edi + 0x18]
push eax
call fcn.00413e40
mov esi, dword [edi + 0x38]
add esp, 0x10
test esi, esi
je 0x40d570
mov eax, dword [sym.imp.m__iob]
add eax, 0x40
mov dword [ebp - 0x18], eax
jmp 0x40d4f4
sub esp, 0xc
mov ebx, dword [esi]
push esi
call fcn.00401540
add esp, 0x10
test ebx, ebx
je 0x40d570
mov esi, ebx
test byte [0x4dcfc8], 2
je 0x40d4e0
call sub.m__errno
sub esp, 0xc
mov ebx, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
push str.local_socket_destroy
push str.system_core_adb_sockets.c
push 0x4a1ad6
mov eax, dword [ebp - 0x18]
push eax
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], ebx
mov eax, dword [esi + 4]
push eax
mov eax, dword [edi + 8]
push eax
push str.LS__d_:_discarding__d_bytes_n
mov eax, dword [ebp - 0x18]
push eax
call fcn.0040d1f0
add esp, 0x14
mov eax, dword [ebp - 0x18]
push eax
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], ebx
jmp 0x40d4e0
push edi
call fcn.0040d150
push ebx
push ebx
push edi
call sub.m_free
mov ecx, dword [ebp - 0x14]
add esp, 0x10
test ecx, ecx
jne 0x40d860
test byte [0x4dcfc8], 2
jne 0x40d59d
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_close_locked
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
add esp, 0xc
mov dword [eax], esi
mov eax, dword [ebp - 0x10]
push eax
push str.LS__d_:_closed_n
push ebx
call fcn.0040d1f0
mov dword [esp], ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_close_locked
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], esi
mov eax, dword [edi + 0x34]
push eax
mov eax, dword [edi + 8]
push eax
push str.entered._LS__d__fd_d_n
push ebx
call fcn.0040d1f0
add esp, 0x14
push ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d408
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_close_locked
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], esi
mov eax, dword [edi + 0x14]
pop ecx
mov edx, dword [eax + 0x34]
push edx
mov eax, dword [eax + 8]
push eax
mov eax, dword [edi + 8]
push eax
push str.LS__d_:_closing_peer._peer__id_d_peer__fd_d_n
push ebx
call fcn.0040d1f0
add esp, 0x14
push ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d41c
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_destroy
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], esi
mov edx, dword [edi + 0x20]
push edx
mov eax, dword [edi + 8]
push eax
push str.LS__d_:_destroying_fde.fd_d_n
push ebx
call fcn.0040d1f0
add esp, 0x14
push ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d4b9
call fcn.0040d3f0
jmp 0x40d441
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_close_locked
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], esi
mov eax, dword [edi + 0x34]
push eax
mov eax, dword [edi + 8]
push eax
push str.LS__d_:_put_on_socket_closing_list_fd_d_n
push ebx
call fcn.0040d1f0
add esp, 0x14
push ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d48d
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_close_locked
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
add esp, 0xc
mov dword [eax], esi
mov eax, dword [edi + 8]
push eax
push str.LS__d_:_closing_n
push ebx
call fcn.0040d1f0
mov dword [esp], ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d463
test byte [0x4dcfc8], 2
jne 0x40d873
sub esp, 0xc
push 1
call sub.m_exit
call sub.m__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4dcfd8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.m__iob]
add esp, 0xc
add ebx, 0x40
push str.local_socket_destroy
push str.system_core_adb_sockets.c
push 0x4a1ad6
push ebx
call fcn.0040d1f0
call sub.m__errno
mov dword [eax], esi
pop eax
pop edx
push str.local_socket_destroy:_exiting_n
push ebx
call fcn.0040d1f0
mov dword [esp], ebx
call sub.m_fflush
mov dword [esp], 0x4dcfd8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.m__errno
mov dword [eax], esi
jmp 0x40d869