Function at 0x409330
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
push esi
push ebx
sub esp, 0x2c
mov dword [esp], 0x8000
mov dword [ebp - 0x1c], edx
call sub.msvcrt.dll_malloc
test byte [0x504120], 1
mov ebx, eax
jne 0x409546
mov dword [ebp - 0x20], 0
jmp 0x409398
mov dword [esp], 0
call sub.msvcrt.dll__read
mov esi, eax
test esi, esi
je 0x4093b6
js 0x409405
cmp dword [ebp - 0x1c], 1
nop
je 0x4093d3
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.004198d0
add dword [ebp - 0x20], esi
test edi, edi
mov dword [esp + 8], 0x8000
mov dword [esp + 4], ebx
je 0x409362
mov dword [esp], edi
call fcn.00419890
mov esi, eax
test esi, esi
jne 0x409374
test byte [0x504120], 1
jne 0x409680
mov dword [esp], ebx
call sub.msvcrt.dll_free
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], ebx
add eax, 0x20
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll_fflush
jmp 0x409395
mov eax, dword [sym.imp.msvcrt.dll__errno]
mov esi, eax
call eax
cmp dword [eax], 4
je 0x4095e4
test byte [0x504120], 1
je 0x4093c3
call esi
mov edi, dword [eax]
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp], 0x504108
mov dword [ebp - 0x1c], eax
call eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
sub esp, 4
mov dword [esp + 0xc], str.copy_to_file
mov dword [esp + 8], str.system_core_adb_commandline.c
mov dword [esp + 4], 0x4c199e
mov dword [esp], eax
call fcn.00408e50
call esi
mov dword [eax], edi
call esi
mov eax, dword [eax]
mov dword [esp + 4], str.copy_to_file___:_error__d_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00408e50
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp], 0x504108
mov dword [ebp - 0x24], eax
call eax
sub esp, 4
call esi
mov dword [eax], edi
test byte [0x504120], 1
je 0x4093c3
call esi
mov edi, dword [eax]
mov dword [esp], 0x504108
call dword [ebp - 0x1c]
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
sub esp, 4
mov dword [esp + 0xc], str.copy_to_file
mov dword [esp + 8], str.system_core_adb_commandline.c
mov dword [esp + 4], 0x4c199e
mov dword [esp], eax
call fcn.00408e50
call esi
mov dword [eax], edi
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], str.copy_to_file___finished_after__lu_bytes_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00408e50
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x504108
call dword [ebp - 0x24]
sub esp, 4
call esi
mov dword [eax], edi
mov dword [esp], ebx
call sub.msvcrt.dll_free
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov eax, dword [eax]
mov dword [esp], 0x504108
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [edx + 0x40]
sub esp, 4
mov dword [esp + 0xc], str.copy_to_file
mov dword [esp + 8], str.system_core_adb_commandline.c
mov dword [esp + 4], 0x4c199e
mov dword [esp], eax
call fcn.00408e50
call esi
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
mov dword [eax], ecx
mov dword [esp + 0xc], edx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], edi
mov dword [esp + 4], str.copy_to_file__d_____d__n
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.00408e50
mov edx, dword [sym.imp.msvcrt.dll__iob]
lea eax, [edx + 0x40]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x504108
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov ecx, dword [ebp - 0x20]
mov dword [eax], ecx
jmp 0x409359
test byte [0x504120], 1
je 0x409398
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
mov dword [esp], 0x504108
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
sub esp, 4
mov dword [esp + 0xc], str.copy_to_file
mov dword [esp + 8], str.system_core_adb_commandline.c
mov dword [esp + 4], 0x4c199e
mov dword [esp], eax
call fcn.00408e50
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.copy_to_file___:_EINTR__retrying_n
add eax, 0x40
mov dword [esp], eax
call fcn.00408e50
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x504108
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
jmp 0x409398
mov eax, dword [sym.imp.msvcrt.dll__errno]
mov esi, eax
call eax
mov edi, dword [eax]
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp], 0x504108
mov dword [ebp - 0x1c], eax
call eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
sub esp, 4
mov dword [esp + 0xc], str.copy_to_file
mov dword [esp + 8], str.system_core_adb_commandline.c
mov dword [esp + 4], 0x4c199e
mov dword [esp], eax
call fcn.00408e50
call esi
mov dword [eax], edi
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.copy_to_file___:_read_0_bytes__exiting_n
add eax, 0x40
mov dword [esp], eax
call fcn.00408e50
jmp 0x409484