Function at 0x40f558
Capabilities:
Create thread
Delete file
Write file on windows

Disassembly:
push 0xbdc
mov eax, 0x4ea710
call fcn.00495bb6
mov ebx, ecx
push 0x800
lea eax, [ebp - 0x810]
push 0
push eax
call fcn.00497890
and dword [ebp - 0xbe4], 0
lea ecx, [ebp - 0x8a0]
add esp, 0xc
call fcn.0042f203
xor eax, eax
push eax
mov dword [ebp - 4], eax
mov dword [ebp - 0xbdc], eax
lea eax, [ebp - 0x924]
push str._update_tips
push eax
call fcn.00403cdb
mov ecx, eax
call fcn.0043045b
mov ecx, dword [0x5388d4]
mov byte [ebp - 4], 1
push dword [ecx*8 + 0x535adc]
push dword [ecx*8 + 0x535ad8]
mov ecx, eax
push dword [ebx + 0x230]
push dword [ebx + 0x22c]
call fcn.0042fad9
push eax
lea eax, [ebp - 0x810]
push eax
call fcn.00405c58
add esp, 0x18
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x924]
call fcn.0042f32e
lea eax, [ebp - 0x810]
push eax
push str._tips
push dword [ebx]
call fcn.00405323
add esp, 0xc
cmp eax, 1
jne 0x40fb0b
push str.Start_force_update__n
call fcn.0042e448
mov dword [esp], 0x4f8df4
call fcn.004bf768
mov esi, eax
push esi
push str.tmp_dir_is__s_n
mov dword [ebp - 0xbe8], esi
call fcn.0042e448
push esi
lea eax, [ebx + 0xdb984]
push str._sMCU_UPG.bin
push eax
call fcn.00405c58
add esp, 0x18
call fcn.0043391c
push eax
lea ecx, [ebp - 0x9a8]
call fcn.0042f1ba
mov byte [ebp - 4], 2
call fcn.00433928
push eax
lea ecx, [ebp - 0x9a8]
call fcn.0042f5e3
call fcn.00433c95
test al, al
je 0x40f694
call fcn.0043392e
mov esi, eax
jmp 0x40f6f0
call fcn.00433934
push eax
lea ecx, [ebp - 0x924]
call fcn.0042f1ba
push 0
lea ecx, [ebp - 0x924]
mov byte [ebp - 4], 3
call fcn.0042fad9
push eax
call fcn.0041ba03
pop ecx
pop ecx
mov edi, eax
lea ecx, [ebp - 0x9a8]
push edi
call fcn.0042fad9
push eax
call fcn.0045add6
mov esi, eax
pop ecx
pop ecx
test edi, edi
je 0x40f6e1
push edi
call fcn.00495de5
pop ecx
lea ecx, [ebp - 0x924]
mov byte [ebp - 4], 2
call fcn.0042f32e
test esi, esi
jne 0x40f6fb
push 5
jmp 0x40fa9e
mov eax, dword [0x5388d4]
lea ecx, [ebp - 0x8a0]
shl eax, 9
add eax, 0x5352d8
push eax
call fcn.0042f456
push 0x4f8e3c
push 0x4f8e40
lea ecx, [ebp - 0x8a0]
call fcn.0042ff02
lea eax, [ebp - 0xbd8]
push eax
lea eax, [ebp - 0xbe4]
push eax
push 1
lea ecx, [ebp - 0x8a0]
call fcn.0042f4fb
push eax
push esi
call fcn.0045a581
add esp, 0x14
test eax, eax
je 0x40f759
push 6
jmp 0x40fa9e
mov eax, dword [ebp - 0x9ac]
mov dword [ebp - 0xbe0], eax
test eax, eax
jne 0x40f770
push 7
jmp 0x40fa9e
push eax
call fcn.004954b1
push dword [ebp - 0xbe0]
mov edi, eax
push edi
push dword [ebp - 0xbe4]
push esi
call fcn.0045b2a1
add esp, 0x14
test eax, eax
je 0x40f7b7
cmp eax, 0x600
je 0x40f7b7
push edi
call fcn.00495de5
pop ecx
call fcn.00433c95
test al, al
jne 0x40f7b0
push esi
call fcn.0045a364
pop ecx
push 8
jmp 0x40fa9e
call fcn.00433c95
test al, al
jne 0x40f7c7
push esi
call fcn.0045a364
pop ecx
xor eax, eax
push eax
push 0x82
push 2
push eax
push eax
push 0x40000000
lea eax, [ebx + 0xdb984]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40fa9c
and dword [ebp - 0xbdc], 0
lea eax, [ebp - 0xbdc]
push 0
push eax
push dword [ebp - 0xbe0]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x40f823
push 1
push edi
call fcn.004954a3
pop ecx
pop ecx
cmp dword [ebp - 0xbdc], 0
je 0x40fa9c
push dword [ebp - 0xbe8]
lea eax, [ebx + 0xdbd84]
push 0x4f8e44
push eax
call fcn.00405c58
add esp, 0xc
call fcn.0043391c
push eax
lea ecx, [ebp - 0x9a8]
call fcn.0042f3c8
call fcn.00433928
push eax
lea ecx, [ebp - 0x9a8]
call fcn.0042f5e3
call fcn.00433c95
test al, al
je 0x40f87e
call fcn.0043392e
mov edi, eax
jmp 0x40f8da
call fcn.00433934
push eax
lea ecx, [ebp - 0x924]
call fcn.0042f1ba
push 0
lea ecx, [ebp - 0x924]
mov byte [ebp - 4], 4
call fcn.0042fad9
push eax
call fcn.0041ba03
pop ecx
pop ecx
mov esi, eax
lea ecx, [ebp - 0x9a8]
push esi
call fcn.0042fad9
push eax
call fcn.0045add6
mov edi, eax
pop ecx
pop ecx
test esi, esi
je 0x40f8cb
push esi
call fcn.00495de5
pop ecx
lea ecx, [ebp - 0x924]
mov byte [ebp - 4], 2
call fcn.0042f32e
test edi, edi
je 0x40f6f4
mov eax, dword [0x5388d4]
lea ecx, [ebp - 0x8a0]
shl eax, 9
add eax, str.fwFEELART_DSP8_680_FLASH_UPG.bin
push eax
call fcn.0042f456
push 0x4f8e3c
push 0x4f8e40
lea ecx, [ebp - 0x8a0]
call fcn.0042ff02
lea eax, [ebp - 0xbd8]
push eax
lea eax, [ebp - 0xbe4]
push eax
push 1
lea ecx, [ebp - 0x8a0]
call fcn.0042f4fb
push eax
push edi
call fcn.0045a581
add esp, 0x14
test eax, eax
jne 0x40f752
mov eax, dword [ebp - 0x9ac]
mov dword [ebp - 0xbe0], eax
test eax, eax
je 0x40f769
push eax
call fcn.004954b1
push dword [ebp - 0xbe0]
mov esi, eax
push esi
push dword [ebp - 0xbe4]
push edi
call fcn.0045b2a1
add esp, 0x14
test eax, eax
je 0x40f994
cmp eax, 0x600
je 0x40f994
push esi
call fcn.00495de5
pop ecx
call fcn.00433c95
test al, al
jne 0x40f7b0
push edi
jmp 0x40f7aa
call fcn.00433c95
test al, al
jne 0x40f9a4
push edi
call fcn.0045a364
pop ecx
xor eax, eax
push eax
push 0x82
push 2
push eax
push eax
push 0x40000000
lea eax, [ebx + 0xdbd84]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40fa9c
and dword [ebp - 0xbdc], 0
lea eax, [ebp - 0xbdc]
push 0
push eax
push dword [ebp - 0xbe0]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40fa00
push 1
push esi
call fcn.004954a3
pop ecx
pop ecx
cmp dword [ebp - 0xbdc], 0
je 0x40fa9c
sub esp, 0x84
mov byte [ebx + 0xdb97e], 1
mov ecx, esp
mov dword [ebp - 0xbe8], esp
lea eax, [ebx + 0xdbd84]
push 0xffffffffffffffff
push eax
call fcn.0042f1df
sub esp, 0x84
mov byte [ebp - 4], 5
mov ecx, esp
lea eax, [ebx + 0xdb984]
push 0xffffffffffffffff
push eax
call fcn.0042f1df
lea esi, [ebx + 0xdc184]
push esi
push dword [ebx]
mov byte [ebp - 4], 2
call fcn.00410863
add esp, 0x110
mov byte [ebx + 0xdb97e], 0
cmp eax, 1
jne 0x40fb00
mov ecx, esi
call fcn.0048afaa
push 0
push 0
push 0x4fa
push dword [ebx]
call dword [sym.imp.USER32.dll_PostMessageW]
push ebx
push 0
push 0x412018
call fcn.004b7a2e
add esp, 0xc
jmp 0x40fb00
push 9
pop edi
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebx + 0xdb984]
push eax
call esi
lea eax, [ebx + 0xdbd84]
push eax
call esi
push edi
lea eax, [ebp - 0x810]
push str.File_prepare_error._error_code__d
push eax
call fcn.00405c58
and dword [ebp - 0x818], 0
lea eax, [ebp - 0x81c]
and dword [ebp - 0x814], 0
push 1
push eax
lea eax, [ebp - 0x810]
mov dword [ebp - 0x81c], str._confirm
push eax
push str._tips
push dword [ebx]
call fcn.004053a9
add esp, 0x20
lea ecx, [ebp - 0x9a8]
call fcn.0042f32e
lea ecx, [ebp - 0x8a0]
call fcn.0042f32e
call fcn.00495b60
ret