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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2058
call fcn.0041b330
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xorps xmm0, xmm0
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push edi
mov esi, ecx
mov dword [ebp - 0x2018], 0
mov dword [ebp - 0x2014], 0
mov dword [ebp - 0x2010], 0
movlpd qword [ebp - 0x203c], xmm0
movlpd qword [ebp - 0x2034], xmm0
movlpd qword [ebp - 0x202c], xmm0
mov dword [ebp - 0x204c], 0
mov dword [ebp - 0x2048], 0
mov dword [ebp - 0x2054], 0
mov dword [ebp - 0x2050], 0
mov dword [ebp - 0x2040], 0x18
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x2044], ebx
cmp ebx, 0xffffffff
jne 0x40a315
mov eax, 0x6e
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
push edi
push str.Successfully_open_flash_programmer_to_write:__s_n
push esi
call fcn.00409eb0
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
nop word [eax + eax]
mov eax, dword [esi]
lea ecx, [ebp - 0x2040]
push 0
push ecx
push 8
lea ecx, [ebp - 0x204c]
mov dword [ebp - 0x2040], 8
xorps xmm0, xmm0
push ecx
movq qword [ebp - 0x204c], xmm0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a367
call edi
mov eax, dword [ebp - 0x204c]
cmp eax, 0x12
jne 0x40a3c8
mov eax, dword [esi]
lea ecx, [ebp - 0x2040]
push 0
push ecx
xorps xmm0, xmm0
mov dword [ebp - 0x2040], 0x18
push 0x18
lea ecx, [ebp - 0x203c]
movlpd qword [ebp - 0x203c], xmm0
push ecx
movlpd qword [ebp - 0x2034], xmm0
movlpd qword [ebp - 0x202c], xmm0
push dword [eax]
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
test eax, eax
jne 0x40a3ba
call edi
mov eax, dword [ebp - 0x2034]
mov ebx, dword [ebp - 0x202c]
jmp 0x40a428
cmp eax, 3
jne 0x40a4fd
mov eax, dword [esi]
lea ecx, [ebp - 0x2040]
push 0
push ecx
push 0xc
lea ecx, [ebp - 0x2018]
mov dword [ebp - 0x2018], 0
push ecx
mov dword [ebp - 0x2014], 0
mov dword [ebp - 0x2010], 0
mov dword [ebp - 0x2040], 0xc
push dword [eax]
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
test eax, eax
jne 0x40a41c
call edi
mov eax, dword [ebp - 0x2014]
mov ebx, dword [ebp - 0x2010]
push 0
push 0
push eax
push dword [ebp - 0x2044]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40a4ce
push 0
lea eax, [ebp - 0x2040]
push eax
push ebx
mov ebx, dword [ebp - 0x2044]
lea eax, [ebp - 0x200c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a4a4
mov eax, dword [ebp - 0x2040]
lea edx, [ebp - 0x2058]
mov ecx, dword [esi]
push 0
push edx
push eax
mov dword [ebp - 0x2058], eax
lea eax, [ebp - 0x200c]
push eax
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a330
call edi
test eax, eax
je 0x40a330
push str.Failed_to_write_data_to_device_in_IMEM_n
jmp 0x40a4a9
push str.Failed_to_read_data_from_flash_programmer_file_n
push esi
call fcn.00409eb0
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_update_FlashProgrammer_pointer_offset_n
push esi
call fcn.00409eb0
add esp, 8
push dword [ebp - 0x2044]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x204c]
cmp eax, 4
je 0x40a536
push eax
push str.Expecting_SAHARA_END_TRANSFER_but_found:__i_n
push esi
call fcn.00409eb0
add esp, 0xc
mov eax, 0x1d
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esi]
lea ecx, [ebp - 0x2040]
push 0
push ecx
push 8
lea ecx, [ebp - 0x2054]
mov dword [ebp - 0x2040], 8
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a562
call edi
mov eax, dword [ebp - 0x2050]
test eax, eax
je 0x40a594
push eax
push str.Image_load_failed_with_status:__i_n
push esi
call fcn.00409eb0
mov eax, dword [ebp - 0x2050]
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esi]
lea eax, [ebp - 0x2024]
xorps xmm0, xmm0
mov dword [ebp - 0x2024], 5
push 8
movq qword [ebp - 0x2020], xmm0
push eax
mov dword [ebp - 0x2020], 8
call fcn.0040aa00
test eax, eax
jne 0x40a633
mov ecx, dword [esi]
lea eax, [ebp - 0x2040]
push eax
lea eax, [ebp - 0x2024]
mov dword [ebp - 0x2040], 0xc
push eax
call fcn.0040aa30
mov ecx, dword [ebp - 0x2024]
mov edi, eax
cmp ecx, 6
je 0x40a61a
push ecx
push str.Expecting_SAHARA_DONE_RSP_but_found:__i
push esi
call fcn.00409eb0
add esp, 0xc
mov eax, 0x1d
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esi]
push 0x1f4
call fcn.0040ac30
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, edi
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040b4d0
mov esp, ebp
pop ebp
ret 4