Function at 0x403020
Capabilities:
Delete file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8068
call fcn.004084e0
mov eax, dword [0x40e004]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
xorps xmm0, xmm0
push ebx
push esi
push edi
mov esi, edx
mov dword [ebp - 0x8040], eax
xor eax, eax
movlpd qword [ebp - 0x804c], xmm0
xor edi, edi
movlpd qword [ebp - 0x805c], xmm0
mov dword [ebp - 0x8014], 0
mov ebx, ecx
mov dword [ebp - 0x8034], ebx
mov dword [ebp - 0x8020], eax
mov dword [ebp - 0x8038], edi
mov dword [ebp - 0x8024], eax
mov byte [ebp - 0x800d], al
mov dword [ebp - 0x803c], eax
mov dword [ebp - 0x8030], eax
mov dword [ebp - 0x8050], eax
test esi, esi
je 0x403720
push esi
call dword [sym.imp.plist.dll_plist_get_node_type]
add esp, 4
cmp eax, 4
jne 0x403720
push esi
call dword [sym.imp.plist.dll_plist_array_get_size]
add esp, 4
cmp eax, 4
jb 0x403720
cmp dword [ebp - 0x8040], edi
je 0x403720
push 3
push esi
call dword [sym.imp.plist.dll_plist_array_get_item]
mov esi, eax
push esi
call dword [sym.imp.plist.dll_plist_get_node_type]
add esp, 0xc
cmp eax, 1
jne 0x4030fd
lea eax, [ebp - 0x805c]
push eax
push esi
call dword [sym.imp.plist.dll_plist_get_uint_val]
add esp, 8
cmp dword [ebp - 0x8058], edi
ja 0x40310d
cmp dword [ebp - 0x805c], edi
jbe 0x403123
cmp dword [0x40e018], 1
jl 0x403123
push str.Receiving_files_n
call fcn.004013c0
add esp, 4
mov esi, dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
cmp dword [0x40e484], edi
jne 0x403652
mov eax, dword [ebp - 0x8048]
mov dword [ebp - 0x8028], eax
mov eax, dword [ebp - 0x804c]
mov dword [ebp - 0x802c], eax
jmp 0x403156
mov esi, dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
lea edx, [ebp - 0x8038]
mov ecx, ebx
call fcn.00402f10
mov ecx, eax
mov dword [ebp - 0x8014], ecx
test ecx, ecx
je 0x40362c
lea edx, [ebp - 0x8020]
mov ecx, ebx
call fcn.00402f10
mov ecx, eax
mov dword [ebp - 0x8014], ecx
test ecx, ecx
je 0x40362c
mov eax, dword [ebp - 0x8024]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test eax, eax
je 0x4031a6
push eax
call edi
add esp, 4
mov eax, dword [ebp - 0x8020]
push 0
push eax
push dword [ebp - 0x8040]
call fcn.00401080
mov dword [ebp - 0x8024], eax
add esp, 0xc
mov eax, dword [ebp - 0x8020]
test eax, eax
je 0x4031dd
push eax
call edi
add esp, 4
mov dword [ebp - 0x8020], 0
lea eax, [ebp - 0x8018]
mov dword [ebp - 0x8018], 0
push eax
push 4
lea eax, [ebp - 0x8014]
mov dword [ebp - 0x8014], 0
push eax
push ebx
call esi
add esp, 0x10
cmp dword [ebp - 0x8018], 4
jne 0x403614
mov ecx, dword [ebp - 0x8014]
mov edx, ecx
mov eax, ecx
and edx, 0xff0000
shr eax, 0x10
or edx, eax
mov eax, ecx
and eax, 0xff00
shl ecx, 0x10
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov al, byte [ebp - 0x800d]
mov byte [ebp - 0x8019], al
lea eax, [ebp - 0x8018]
push eax
push 1
lea eax, [ebp - 0x800d]
mov dword [ebp - 0x8014], edx
push eax
push ebx
mov byte [ebp - 0x800d], 0
call esi
add esp, 0x10
cmp dword [ebp - 0x8018], 1
jne 0x403608
mov al, byte [ebp - 0x800d]
test al, al
je 0x4032a5
cmp al, 0xc
je 0x4032a5
cmp al, 0xb
je 0x4032a5
cmp dword [0x40e018], 1
jl 0x4032a5
movsx eax, al
push eax
push str.Found_new_flag__02x_n
call fcn.004013c0
add esp, 8
mov edi, dword [ebp - 0x8024]
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x4032bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x409350
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 8
mov dword [ebp - 0x8048], eax
test eax, eax
je 0x4035ae
nop dword [eax]
cmp byte [ebp - 0x800d], 0xc
jne 0x403510
mov edi, dword [ebp - 0x8014]
xor esi, esi
sub edi, 1
je 0x403354
nop word [eax + eax]
mov eax, edi
mov ecx, 0x8000
sub eax, esi
cmp eax, ecx
cmovb ecx, eax
lea eax, [ebp - 0x8018]
push eax
push ecx
lea eax, [ebp - 0x800c]
push eax
push ebx
call dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
mov eax, dword [ebp - 0x8018]
add esp, 0x10
test eax, eax
jle 0x403354
push dword [ebp - 0x8048]
push eax
lea eax, [ebp - 0x800c]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esi, dword [ebp - 0x8018]
add esp, 0x10
cmp esi, edi
jb 0x403300
mov ecx, dword [ebp - 0x802c]
mov eax, dword [ebp - 0x8028]
cmp esi, edi
jne 0x403375
add ecx, edi
mov dword [ebp - 0x802c], ecx
adc eax, 0
mov dword [ebp - 0x8028], eax
mov edi, dword [ebp - 0x8058]
mov esi, dword [ebp - 0x805c]
test edi, edi
jne 0x40338d
test esi, esi
je 0x403489
mov edx, eax
call fcn.00408800
mov edx, edi
movsd qword [ebp - 0x8064], xmm0
mov ecx, esi
call fcn.00408800
movsd xmm1, qword [ebp - 0x8064]
xorps xmm2, xmm2
divsd xmm1, xmm0
movsd xmm0, qword [0x40be68]
mulsd xmm1, xmm0
comisd xmm2, xmm1
ja 0x403489
minsd xmm0, xmm1
movaps xmm1, xmm0
movsd qword [ebp - 0x8064], xmm0
call fcn.004027c0
mov eax, dword [ebp - 0x8028]
push eax
mov eax, dword [ebp - 0x802c]
push eax
call fcn.004011a0
add esp, 8
mov ebx, eax
cmp dword [0x40e018], 1
jl 0x40340d
push ebx
push str.___s
call fcn.004013c0
add esp, 8
push ebx
mov ebx, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call ebx
add esp, 4
push edi
push esi
call fcn.004011a0
add esp, 8
mov esi, eax
cmp dword [0x40e018], 1
jl 0x40343c
push esi
push str.__s_
call fcn.004013c0
add esp, 8
push esi
call ebx
add esp, 4
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fflush]
movsd xmm0, qword [ebp - 0x8064]
add esp, 4
ucomisd xmm0, qword [0x40be68]
lahf
test ah, 0x44
jp 0x403483
cmp dword [0x40e018], 1
jl 0x403483
push 0x409360
call fcn.004013c0
add esp, 4
mov ebx, dword [ebp - 0x8034]
cmp dword [0x40e484], 0
jne 0x403510
mov esi, dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
lea eax, [ebp - 0x8018]
push eax
push 4
lea eax, [ebp - 0x8014]
mov dword [ebp - 0x8014], 0
push eax
push ebx
call esi
mov ecx, dword [ebp - 0x8014]
add esp, 0x10
mov edx, ecx
mov eax, ecx
shr eax, 0x10
and edx, 0xff0000
or edx, eax
mov eax, ecx
and eax, 0xff00
shl ecx, 0x10
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov dword [ebp - 0x8014], edx
jbe 0x403510
mov al, byte [ebp - 0x800d]
mov byte [ebp - 0x8019], al
lea eax, [ebp - 0x8018]
push eax
push 1
lea eax, [ebp - 0x800d]
push eax
push ebx
call esi
add esp, 0x10
jmp 0x4032e0
push dword [ebp - 0x8048]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
inc dword [ebp - 0x803c]
add esp, 4
mov ecx, dword [ebp - 0x8014]
test ecx, ecx
je 0x40362c
cmp byte [ebp - 0x800d], 0xb
jne 0x40359f
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ecx, dword [ebp - 0x8014]
add esp, 4
mov esi, eax
dec ecx
lea eax, [ebp - 0x8018]
push eax
push ecx
push esi
push ebx
call dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
mov eax, dword [ebp - 0x8018]
add esp, 0x10
cmp byte [ebp - 0x8019], 0xc
mov byte [esi + eax], 0
je 0x40358f
push esi
push str._nReceived_an_error_message_from_device:__s_n
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0x8014]
add esp, 4
cmp dword [0x40e484], 0
je 0x403150
jmp 0x40362c
mov esi, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call esi
mov ecx, dword [eax]
mov eax, ecx
sub eax, 2
je 0x4035da
sub eax, 0xf
je 0x4035ce
neg ecx
mov dword [ebp - 0x8030], ecx
jmp 0x4035e4
mov dword [ebp - 0x8030], 0xfffffff9
jmp 0x4035e4
mov dword [ebp - 0x8030], 0xfffffffa
call esi
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
mov dword [ebp - 0x8050], eax
push eax
push edi
push str.Error_opening__s_for_writing:__s_n
call fcn.004013c0
add esp, 0xc
jmp 0x403626
push str.mb2_handle_receive_files
push str.ERROR:__s:_could_not_receive_code__n
jmp 0x40361e
push str.mb2_handle_receive_files
push str.ERROR:__s:_could_not_receive_code_length__n
call fcn.004013c0
add esp, 8
mov ecx, dword [ebp - 0x8014]
mov eax, dword [ebp - 0x8020]
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test eax, eax
je 0x40364a
push eax
call esi
mov edi, dword [ebp - 0x8038]
add esp, 4
jmp 0x403658
mov edi, dword [ebp - 0x8038]
jmp 0x40365e
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0x8014]
lea eax, [ecx - 1]
test eax, eax
jle 0x4036c9
cmp dword [0x40e018], 1
jl 0x403681
push str._nDiscarding_current_data_hunk._n
call fcn.004013c0
mov ecx, dword [ebp - 0x8014]
add esp, 4
lea eax, [ecx - 1]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ecx, dword [ebp - 0x8014]
add esp, 4
mov esi, eax
dec ecx
lea eax, [ebp - 0x8018]
push eax
push ecx
push esi
push ebx
call dword [sym.imp.imobiledevice.dll_mobilebackup2_receive_raw]
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 0x14
push dword [ebp - 0x8024]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x4036c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x8024]
test eax, eax
je 0x4036d9
push eax
call esi
add esp, 4
test edi, edi
je 0x4036e3
push edi
call esi
add esp, 4
call dword [sym.imp.plist.dll_plist_new_dict]
mov esi, eax
push esi
push dword [ebp - 0x8050]
push dword [ebp - 0x8030]
push ebx
call dword [sym.imp.imobiledevice.dll_mobilebackup2_send_status_response]
push esi
call dword [sym.imp.plist.dll_plist_free]
mov eax, dword [ebp - 0x803c]
add esp, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00407770
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00407770
mov esp, ebp
pop ebp
ret