Function at 0x401660
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [ebp + 8]
test eax, eax
jne 0x401736
mov dword [esp + 4], 1
lea ebx, [ebp - 0x28]
mov dword [esp], 0x401530
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
push edx
push edx
call fcn.0041cc30
call fcn.0041ee30
mov dword [esp], 0x15b3
call fcn.004216f0
call fcn.00424040
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], str.tcp:_d
mov dword [esp], ebx
mov dword [ebp - 0x2c], 0x516f3c
mov dword [esp + 8], eax
call fcn.0042a1c0
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5181e8
mov dword [esp], ebx
call fcn.004246b0
test eax, eax
jne 0x401c3e
test byte [0x561ee0], 1
jne 0x4019d1
call fcn.0040f090
mov eax, dword [ebp - 0x28]
lea ebx, [eax - 0xc]
cmp ebx, 0x516f30
jne 0x401aa3
mov eax, dword [ebp - 0x2c]
lea ebx, [eax - 0xc]
cmp ebx, 0x516f30
jne 0x401a80
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp + 4], 0
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll_setvbuf
cmp eax, 0xffffffff
je 0x401a5d
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp + 4], 0
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_setvbuf
cmp eax, 0xffffffff
je 0x401ae5
mov dword [esp + 4], 1
lea ebx, [ebp - 0x28]
mov dword [esp], 0x401530
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
push eax
push eax
call fcn.0041cc30
call fcn.0041ee30
mov dword [esp], 0x15b3
call fcn.004216f0
call fcn.00424040
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], str.tcp:_d
mov dword [esp], ebx
mov dword [ebp - 0x2c], 0x516f3c
mov dword [esp + 8], eax
call fcn.0042a1c0
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5181e8
mov dword [esp], ebx
call fcn.004246b0
test eax, eax
jne 0x401c3e
mov dword [esp + 4], 0
mov dword [esp], 0x5181f6
call fcn.00415400
cmp eax, 0xffffffff
mov ebx, eax
je 0x401bcf
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll__dup2
cmp eax, 0xffffffff
je 0x401b88
mov dword [esp], ebx
lea esi, [ebp - 0x24]
call sub.msvcrt.dll__close
mov eax, esi
call fcn.00401540
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], 0x1a0
mov dword [esp + 4], 0x109
mov dword [esp], eax
call fcn.00415400
cmp eax, 0xffffffff
mov ebx, eax
je 0x401ba8
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll__dup2
cmp eax, 0xffffffff
je 0x401b05
mov dword [esp + 4], 2
mov dword [esp], ebx
call sub.msvcrt.dll__dup2
cmp eax, 0xffffffff
je 0x401b25
mov dword [esp], ebx
lea ebx, [ebp - 0x1c]
call sub.msvcrt.dll__close
call sub.msvcrt.dll__getpid
mov dword [esp + 4], str.____adb_starting__pid__d______n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00415a00
mov dword [esp], ebx
call fcn.004167b0
lea ecx, [ebp - 0x20]
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0x62
mov dword [esp], str.system_core_adb_client_main.cpp
call fcn.0042a560
lea ecx, [ebp - 0x20]
sub esp, 0x14
call fcn.0042a6d0
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx - 0xc]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00505c10
lea ecx, [ebp - 0x20]
call fcn.0042a790
mov eax, dword [ebp - 0x1c]
lea edi, [eax - 0xc]
cmp edi, 0x516f30
jne 0x401b45
mov eax, dword [ebp - 0x24]
lea edi, [eax - 0xc]
cmp edi, 0x516f30
jne 0x401b68
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x1c], 0xa4b4f
mov dword [ebp - 0x24], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 8], 3
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x401bf7
mov eax, dword [ebp - 0x24]
cmp eax, 3
jne 0x401c26
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
test byte [0x561ee0], 1
je 0x401703
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov esi, dword [eax]
lea eax, [ebp - 0x1c]
mov dword [esp], eax
mov dword [esp + 4], str.Event_loop_starting
call fcn.0042a1c0
lea ecx, [ebp - 0x20]
mov dword [esp + 0x10], 0xffffffff
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0xa6
mov dword [esp], str.system_core_adb_client_main.cpp
call fcn.0042a560
lea ecx, [ebp - 0x20]
sub esp, 0x14
call fcn.0042a6d0
mov edx, dword [ebp - 0x1c]
mov ecx, dword [edx - 0xc]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00505c10
lea ecx, [ebp - 0x20]
call fcn.0042a790
mov eax, dword [ebp - 0x1c]
lea edi, [eax - 0xc]
cmp edi, 0x516f30
jne 0x401ac6
call ebx
mov dword [eax], esi
jmp 0x401703
lea esi, [esi]
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_make_stdout_unbuffered:__s
mov dword [esp + 4], eax
call fcn.004167f0
sub eax, 4
call fcn.0050d5c0
test eax, eax
jg 0x40172c
lea eax, [ebp - 0x1c]
mov ecx, ebx
mov dword [esp], eax
call fcn.004dba20
push ecx
jmp 0x40172c
sub eax, 4
call fcn.0050d5c0
test eax, eax
jg 0x40171a
lea eax, [ebp - 0x1c]
mov ecx, ebx
mov dword [esp], eax
call fcn.004dba20
push ebx
jmp 0x40171a
sub eax, 4
call fcn.0050d5c0
test eax, eax
jg 0x401a54
lea eax, [ebp - 0x20]
mov ecx, edi
mov dword [esp], eax
call fcn.004dba20
push edi
jmp 0x401a54
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_make_stderr_unbuffered:__s
mov dword [esp + 4], eax
call fcn.004167f0
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_redirect_stdout:__s
mov dword [esp + 4], eax
call fcn.004167f0
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_redirect_stderr:__s
mov dword [esp + 4], eax
call fcn.004167f0
sub eax, 4
call fcn.0050d5c0
test eax, eax
jg 0x40195a
lea eax, [ebp - 0x20]
mov ecx, edi
mov dword [esp], eax
call fcn.004dba20
push eax
jmp 0x40195a
sub eax, 4
call fcn.0050d5c0
test eax, eax
jg 0x40196c
mov dword [esp], ebx
mov ecx, edi
call fcn.004dba20
push eax
jmp 0x40196c
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_redirect_stdin:__s
mov dword [esp + 4], eax
call fcn.004167f0
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp], str.cannot_open__s:__s
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
call fcn.004167f0
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], 0x5181f6
mov dword [esp], str.cannot_open__s:__s
mov dword [esp + 8], eax
call fcn.004167f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 4], eax
lea eax, [ebp - 0x20]
mov dword [esp], eax
call fcn.004104a0
mov eax, dword [ebp - 0x20]
mov dword [esp], str.adb:_cannot_write_ACK_to_handle_0x_p:__s
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
call fcn.004167f0
mov dword [esp + 8], eax
mov dword [esp + 4], 3
mov dword [esp], str.adb:_cannot_write__lu_bytes_of_ACK:_only_wrote__lu_bytes
call fcn.004167f0
mov eax, dword [ebp - 0x2c]
mov dword [esp], str.could_not_install_smartsocket_listener:__s
mov dword [esp + 4], eax
call fcn.004167f0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop