Function at 0x100df780
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20028
call fcn.10203e10
mov eax, dword [0x105520d0]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
xor eax, eax
push edi
push eax
push eax
push 3
push eax
push 1
mov esi, ecx
mov ecx, dword [ebp + 8]
push SysReAllocString
push ecx
mov dword [ebp - 0x20018], eax
mov dword [ebp - 0x20014], eax
mov dword [ebp - 0x20010], eax
mov dword [ebp - 0x2000c], eax
mov dword [ebp - 0x20008], eax
mov dword [ebp - 0x20028], 0x14
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x100df7f6
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10203cc8
mov esp, ebp
pop ebp
ret 4
mov edx, dword [esi + 0x14]
push ebx
lea eax, [ebp - 0x20018]
push eax
lea ecx, [ebp - 0x20028]
push ecx
mov ecx, dword [esi]
push edx
mov dword [ebp - 0x20028], 8
call fcn.100d9c40
cmp al, 1
jne 0x100df8fb
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x100df830
mov eax, dword [ebp - 0x20014]
sub eax, dword [ebp - 0x20028]
lea ecx, [ebp - 0x20010]
push ecx
mov ecx, dword [esi]
lea edx, [ebp - 0x20028]
mov dword [ebp - 0x20028], eax
mov eax, dword [esi + 0x14]
push edx
push eax
call fcn.100d9c40
cmp al, 1
jne 0x100df8fb
mov eax, dword [ebp - 0x20018]
cmp eax, 3
jne 0x100df90c
mov ecx, dword [ebp - 0x2000c]
push 0
push 0
push ecx
push edi
call ebx
cmp eax, 0xffffffff
je 0x100dfa21
mov eax, dword [ebp - 0x20008]
push 0
lea edx, [ebp - 0x20028]
push edx
push eax
lea ecx, [ebp - 0x20004]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100dfa2f
mov eax, dword [ebp - 0x20028]
mov ecx, dword [esi + 0x14]
lea edx, [ebp - 0x20004]
push edx
push eax
push ecx
mov ecx, dword [esi]
call fcn.100d9bf0
cmp al, 1
jne 0x100dfa3d
mov ecx, dword [esi + 0x14]
lea edx, [ebp - 0x20018]
push edx
lea eax, [ebp - 0x20028]
push eax
push ecx
mov ecx, dword [esi]
mov dword [ebp - 0x20028], 8
call fcn.100d9c40
cmp al, 1
je 0x100df830
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Failed_to_read_the_command_from_the_opened_port__r__n
jmp 0x100dfa49
push edi
cmp eax, 4
je 0x100df934
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x20018]
push 4
push edx
push str.Recieved__d_instead_of_SAHARA_END_TRANSFER__command_____d___r_n
push esi
call fcn.100df120
add esp, 0x10
jmp 0x100dfa52
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x18]
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
je 0x100df95c
push eax
push str.Waiting__d_ms_before_Sahara_Done
push esi
call fcn.100df120
mov eax, dword [esi + 0x18]
add esp, 0xc
push eax
call edi
mov edx, dword [esi + 0x14]
lea ecx, [ebp - 0x20024]
push ecx
mov ecx, dword [esi]
xor eax, eax
push 8
mov dword [ebp - 0x20020], eax
push edx
mov dword [ebp - 0x2001c], eax
mov dword [ebp - 0x20024], 5
mov dword [ebp - 0x20020], 8
call fcn.100d9bf0
cmp al, 1
je 0x100df9ab
push 5
push str.Failed_to_send_the_SAHARA_DONE_REQ__command_____d__as_expected__r_n
push esi
call fcn.100df120
add esp, 0xc
jmp 0x100dfa52
mov edx, dword [esi + 0x14]
lea eax, [ebp - 0x20024]
push eax
lea ecx, [ebp - 0x20028]
push ecx
mov ecx, dword [esi]
push edx
mov dword [ebp - 0x20028], 0xc
call fcn.100d9c40
cmp al, 1
je 0x100df9d9
push str.Failed_to_recieve_the_SAHARA_DONE_RSP_as_expected__r_n
jmp 0x100dfa49
mov eax, dword [ebp - 0x20024]
cmp eax, 6
je 0x100df9f7
push 6
push eax
push str.Recieved__d_instead_of_SAHARA_DONE_RSP__command_____d___r_n
push esi
call fcn.100df120
add esp, 0x10
jmp 0x100dfa52
push str.Flash_programmer_successfully_downloaded_using_Sahara_Protocol__n
push esi
call fcn.100df120
add esp, 8
push 0x1f4
call edi
pop ebx
pop edi
mov al, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10203cc8
mov esp, ebp
pop ebp
ret 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Failed_to_move_file_specific_offset_disk__r__n
jmp 0x100dfa49
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Failed_to_read_file_from_disk__r__n
jmp 0x100dfa49
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Failed_to_send_the_command_from_the_host_to_the_device__r__n
push esi
call fcn.100df120
add esp, 8
mov ecx, dword [ebp - 4]
pop ebx
pop edi
xor ecx, ebp
xor al, al
pop esi
call fcn.10203cc8
mov esp, ebp
pop ebp
ret 4