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

Disassembly:
push ebp
lea ebp, [esp - 0x3330]
mov eax, 0x3330
call fcn.100c8100
push 0xffffffffffffffff
push 0x100ea09a
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x10144930]
xor eax, ebp
mov dword [ebp + 0x332c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 0x3338]
mov dword [ebp - 0x44], esi
mov edi, dword [ebp + 0x333c]
mov dword [ebp - 0x24], 0xffffffff
mov byte [ebp + 0x331c], 0x1b
mov byte [ebp + 0x331d], 0x91
xor ebx, ebx
mov byte [ebp + 0x331e], bl
mov byte [ebp + 0x331f], bl
mov byte [ebp + 0x3320], bl
mov byte [ebp + 0x3321], bl
mov byte [ebp + 0x3322], bl
mov byte [ebp + 0x3323], 3
mov byte [ebp + 0x3324], bl
mov byte [ebp + 0x3325], bl
mov byte [ebp + 0x3326], bl
mov byte [ebp + 0x3327], 1
mov byte [ebp + 0x3328], bl
mov byte [ebp + 0x3329], bl
mov byte [ebp + 0x332a], bl
mov byte [ebp + 0x332b], bl
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 4], ebx
cmp edi, ebx
je 0x1006a57b
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x1006a1f5
sub eax, edx
sar eax, 1
je 0x1006a57b
lea edx, [esi + 0x406]
mov eax, edx
lea ecx, [eax + 2]
mov dword [ebp - 0x20], ecx
jmp 0x1006a220
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x1006a220
sub eax, dword [ebp - 0x20]
push 0xff
sar eax, 1
je 0x1006a246
push edx
push 0x100
lea edx, [ebp + 0x301c]
push edx
jmp 0x1006a259
lea eax, [esi + 0x206]
push eax
push 0x100
lea ecx, [ebp + 0x301c]
push ecx
call fcn.100c6041
add esp, 0x10
push 0x800
push ebx
lea edx, [ebp + 0x281c]
push edx
call fcn.100c7d20
lea eax, [ebp + 0x301c]
push eax
push edi
push str._s_s.jpg
push 0x400
lea ecx, [ebp + 0x281c]
push ecx
call fcn.100c5d3f
add esp, 0x20
mov edi, 0x10123730
mov edx, esi
call fcn.10060800
test al, al
je 0x1006a50b
mov edi, 0x10123738
mov edx, esi
call fcn.10060800
test al, al
je 0x1006a50b
lea edx, [ebp]
push edx
call fcn.10060b10
mov byte [ebp - 4], 1
add esi, 0x4606
push esi
lea ecx, [ebp]
call fcn.10060c60
test eax, eax
je 0x1006a2ff
push str.Fail_to_IO_Init_in_CDiscoveryUSB::DownloadImg...
mov ecx, 0x10152dd8
call fcn.1003f430
add esp, 4
mov dword [ebp - 0x2c], ebx
push 0x1012af20
lea eax, [ebp - 0x2c]
push eax
call fcn.100c80ad
mov esi, 0x10
mov dword [ebp - 0x14], esi
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp + 0x331c]
push edx
lea ecx, [ebp]
call fcn.100612b0
test eax, eax
jne 0x1006a4e4
push 0x2710
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp + 0x321c]
push ecx
lea ecx, [ebp]
call fcn.10060f40
test eax, eax
jne 0x1006a4dd
cmp dword [ebp - 0x14], esi
jne 0x1006a4dd
movzx esi, byte [ebp + 0x3228]
shl esi, 8
movzx edx, byte [ebp + 0x3229]
add esi, edx
shl esi, 8
movzx eax, byte [ebp + 0x322a]
add esi, eax
shl esi, 8
movzx ecx, byte [ebp + 0x322b]
add esi, ecx
cmp esi, 0x186a0
jbe 0x1006a3a1
push str.the_image_file_size_value_is_invalid__
mov ecx, 0x10152dd8
call fcn.1003f430
add esp, 4
mov dword [ebp - 0x34], ebx
push 0x1012af20
lea edx, [ebp - 0x34]
push edx
call fcn.100c80ad
lea edi, [esi + 1]
push edi
call fcn.100b61c6
mov dword [ebp - 0x18], eax
push edi
push ebx
push eax
call fcn.100c7d20
add esp, 0x10
xor edi, edi
mov dword [ebp - 0x38], edi
mov eax, esi
shr eax, 9
push 0x2710
cmp edi, eax
jge 0x1006a3ec
mov dword [ebp - 0x20], 0x200
lea ecx, [ebp - 0x20]
push ecx
mov edx, edi
shl edx, 9
add edx, dword [ebp - 0x18]
push edx
lea ecx, [ebp]
call fcn.10060f40
add edi, 1
jmp 0x1006a3ba
mov eax, esi
and eax, 0x1ff
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 0x1c]
push ecx
mov edx, esi
shr edx, 9
shl edx, 9
mov edi, dword [ebp - 0x18]
add edx, edi
push edx
lea ecx, [ebp]
call fcn.10060f40
test eax, eax
jne 0x1006a4d6
lea eax, [ebp + 0x281c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push ebx
push 0x80
push 4
push ebx
push 1
push 0xc0000000
lea ecx, [ebp + 0x281c]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
jne 0x1006a47c
lea edx, [ebp + 0x281c]
push edx
push str.Create_File_fail___s_
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov edx, 0x10152dd8
call fcn.1003f2f0
add esp, 8
mov dword [ebp - 0x28], ebx
push 0x1012af20
lea eax, [ebp - 0x28]
push eax
call fcn.100c80ad
push ebx
lea ecx, [ebp - 0x3c]
push ecx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1006a4a4
mov ecx, dword [ebp - 0x44]
add ecx, 0x3a06
lea eax, [ebp + 0x281c]
call fcn.10008bf0
jmp 0x1006a4f6
lea edx, [ebp + 0x281c]
push edx
push str.Write_File_fail___s_
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov edx, 0x10152dd8
call fcn.1003f2f0
add esp, 8
mov dword [ebp - 0x30], ebx
push 0x1012af20
lea eax, [ebp - 0x30]
push eax
call fcn.100c80ad
push str.Read_remained_image_data_fail___
jmp 0x1006a4e9
push str.Read_Image_Size_fail___
jmp 0x1006a4e9
push str.Write_Command_for_loading_device_image_fail___
mov ecx, 0x10152dd8
call fcn.1003f430
add esp, 4
mov byte [ebp - 4], bl
lea ecx, [ebp]
push ecx
call fcn.10060bc0
mov dword [ebp - 4], 0xffffffff
jmp 0x1006a55c
push str.the_target_device_doesnt_support_Downloading_image
mov ecx, 0x10152dd8
call fcn.1003f430
add esp, 4
mov dword [ebp - 0x40], ebx
push 0x1012af20
lea edx, [ebp - 0x40]
push edx
call fcn.100c80ad
mov dword [ebp - 4], 0xffffffff
mov eax, 0x1006a55a
ret
mov eax, dword [ebp - 0x24]
cmp eax, 0xffffffff
je 0x1006a56b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x1006a57b
push eax
call fcn.100b61c1
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x332c]
xor ecx, ebp
call fcn.100c59be
add ebp, 0x3330
mov esp, ebp
pop ebp
ret 8