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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6c
push ebx
push esi
push edi
mov esi, edx
mov dword [ebp - 0x48], 0
mov edi, ecx
or ebx, 0xffffffff
mov dword [ebp - 0x18], edi
test esi, esi
je 0x40cef1
mov eax, dword [0x543760]
mov ecx, dword [0x543764]
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], ecx
jmp 0x40cf01
mov eax, dword [0x543610]
mov dword [ebp - 0x14], eax
mov eax, dword [0x543614]
mov dword [ebp - 8], eax
xor eax, eax
mov dword [ebp - 0x20], 0xffffffff
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x30], eax
mov eax, dword [0x543770]
mov dword [ebp - 0x24], 0xffffffff
mov dword [ebp - 4], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x44], 0
cmp eax, 0x200
jae 0x40cf4f
push eax
push str.Unexpected_sector_size___d____Aborting
call fcn.004407e0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
push 0
push 0
push 0
push edi
mov dword [ebp - 0x34], eax
call eax
test eax, eax
jne 0x40cf73
push str.Warning:_Unable_to_rewind_image_position___wrong_data_might_be_copied_
call fcn.004407e0
add esp, 4
push 0
push 0
push 0
push 0
push 0
xor edx, edx
or ecx, 0xffffffff
call fcn.004510c0
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x14
mov dword [ebp - 0x2c], eax
test esi, esi
je 0x40d39f
cmp dword [0x4fada8], 0
mov ecx, str.Zeroing_drive:
mov eax, str.Fast_zeroing_drive:
cmove eax, ecx
push eax
call fcn.004407e0
mov ecx, dword [0x543770]
xor edx, edx
add esp, 4
lea eax, [ecx + 0x1ffffff]
div ecx
push ecx
mov edi, eax
imul edi, ecx
push edi
call fcn.0049557c
add esp, 8
mov dword [ebp - 4], eax
test eax, eax
jne 0x40cffc
push str.Could_not_allocate_disk_zeroing_buffer
mov dword [0x4fa958], 0xc0030008
call fcn.004407e0
mov edi, dword [ebp - 4]
add esp, 4
jmp 0x40d400
xor edx, edx
div dword [0x543770]
test edx, edx
je 0x40d01f
push 0x49e
push str.C:UsersgamerDownloads_rufus72_rufus_7_src_format.c
push str._uintptr_t_buffer___SelectedDrive.SectorSize__0
call fcn.0049ed6b
add esp, 0xc
mov esi, dword [0x4fada8]
mov eax, esi
neg eax
push edi
sbb eax, eax
and eax, 0xff
push eax
push dword [ebp - 4]
call fcn.00493600
add esp, 0xc
test esi, esi
je 0x40d09d
push dword [0x543770]
push edi
call fcn.0049557c
mov esi, eax
add esp, 8
mov dword [ebp - 0x10], esi
test esi, esi
jne 0x40d078
push str.Could_not_allocate_disk_comparison_buffer
mov dword [0x4fa958], 0xc0030008
call fcn.004407e0
mov edi, dword [ebp - 4]
add esp, 4
jmp 0x40d402
xor edx, edx
mov eax, esi
div dword [0x543770]
test edx, edx
je 0x40d09d
push 0x4aa
push str.C:UsersgamerDownloads_rufus72_rufus_7_src_format.c
push str._uintptr_t_cmp_buffer___SelectedDrive.SectorSize__0
call fcn.0049ed6b
add esp, 0xc
mov ecx, dword [ebp - 8]
xor ebx, ebx
mov dword [ebp - 0x68], edi
xor edi, edi
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x1c], ebx
test ecx, ecx
jb 0x40d21a
mov esi, dword [ebp - 0x14]
ja 0x40d0c2
test esi, esi
je 0x40d21a
cmp dword [0x4fada8], 0
mov eax, 0xcea
push 0
push ecx
push esi
push ebx
mov edx, 0xcd6
mov ecx, 4
push edi
cmovne edx, eax
call fcn.004510c0
mov eax, dword [ebp - 8]
add esp, 0x14
test eax, eax
jb 0x40d100
ja 0x40d0f7
cmp esi, 0x50
jbe 0x40d100
mov ecx, 0x50
xor eax, eax
jmp 0x40d102
mov ecx, esi
push ebx
push edi
push eax
push ecx
call fcn.00491ed0
push dword [ebp - 8]
push esi
push edx
push eax
call fcn.00491dc0
cmp eax, dword [ebp - 0x20]
jne 0x40d120
cmp edx, dword [ebp - 0x24]
je 0x40d130
mov ecx, 0x4d0824
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], edx
call fcn.00440920
mov ecx, dword [ebp - 0x68]
xor eax, eax
mov edx, ecx
add edx, edi
adc eax, ebx
cmp eax, dword [ebp - 8]
jb 0x40d14d
ja 0x40d146
cmp edx, esi
jbe 0x40d14d
mov ecx, esi
sub ecx, edi
mov dword [ebp - 0x68], ecx
mov esi, dword [0x543770]
xor edx, edx
mov eax, ecx
div esi
test edx, edx
je 0x40d16e
lea eax, [esi - 1]
xor edx, edx
add eax, ecx
div esi
mov ecx, eax
imul ecx, esi
mov dword [ebp - 0x68], ecx
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40d17e
dec eax
mov dword [ebp - 0x28], eax
jmp 0x40d280
cmp dword [0x4fada8], 0
je 0x40d280
mov eax, dword [0x4fa958]
test eax, eax
jns 0x40d19e
cmp ax, 0x4c7
je 0x40d351
mov esi, dword [ebp - 0x10]
lea eax, [ebp - 0x4c]
push 0
push eax
push ecx
push esi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d35f
mov ecx, dword [ebp - 0x68]
cmp dword [ebp - 0x4c], ecx
jne 0x40d35f
mov esi, dword [esi]
test esi, esi
je 0x40d1d5
cmp esi, 0xffffffff
jne 0x40d262
mov edx, ecx
mov eax, 1
shr edx, 2
cmp edx, eax
jbe 0x40d1f3
mov ebx, dword [ebp - 0x10]
cmp dword [ebx + eax*4], esi
jne 0x40d1f0
inc eax
cmp eax, edx
jb 0x40d1e6
mov ebx, dword [ebp - 0x30]
cmp eax, edx
jb 0x40d262
mov dword [ebp - 0x1c], ecx
add edi, ecx
mov ecx, dword [ebp - 8]
adc ebx, 0
mov dword [ebp - 0x30], ebx
cmp ebx, ecx
ja 0x40d21a
mov esi, dword [ebp - 0x14]
jb 0x40d0c2
cmp edi, esi
jb 0x40d0c2
or ebx, 0xffffffff
push 0
lea eax, [ebp - 0x60]
push eax
push 0
push 0
push 0
push 0
push 0x70140
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40d250
call fcn.00440bb0
push eax
push str.Could_not_refresh_drive_layout:__s
call fcn.004407e0
add esp, 8
mov edi, dword [ebp - 4]
mov esi, dword [ebp - 0x10]
mov dword [ebp - 0x48], 1
jmp 0x40d402
push 0
push 0
push ebx
push edi
push dword [ebp - 0x18]
call dword [ebp - 0x34]
test eax, eax
je 0x40d33e
mov ecx, dword [ebp - 0x68]
mov dword [ebp - 0x28], 0xf
mov esi, 1
mov eax, dword [0x4fa958]
test eax, eax
jns 0x40d298
cmp ax, 0x4c7
je 0x40d351
push 0
lea eax, [ebp - 0x1c]
push eax
push ecx
push dword [ebp - 4]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d2ce
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x68]
cmp ecx, eax
je 0x40d1fa
push eax
push ecx
push str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.004407e0
add esp, 0xc
jmp 0x40d2f2
call fcn.00440bb0
push eax
push 0
push dword [0x543770]
push ebx
push edi
call fcn.00491dc0
push edx
push eax
push str._r_nWrite_error_at_sector__lld:__s
call fcn.004407e0
add esp, 0x10
cmp esi, 4
jae 0x40d38a
push 5
push str.Retrying_in__d_seconds...
call fcn.004407e0
add esp, 8
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push ebx
push edi
push dword [ebp - 0x18]
call dword [ebp - 0x34]
test eax, eax
je 0x40d37d
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
inc esi
cmp esi, 4
ja 0x40d351
mov ecx, dword [ebp - 0x68]
jmp 0x40d285
call fcn.00440bb0
push eax
push str._r_nError:_Could_not_reset_position____s
call fcn.004407e0
add esp, 8
mov edi, dword [ebp - 4]
or ebx, 0xffffffff
mov esi, dword [ebp - 0x10]
jmp 0x40d402
call fcn.00440bb0
push eax
push str._r_nRead_error:_Could_not_read_data_for_fast_zeroing_comparison____s
call fcn.004407e0
mov edi, dword [ebp - 4]
add esp, 8
or ebx, 0xffffffff
jmp 0x40d402
call fcn.00440bb0
push eax
push str.Write_error:_Could_not_reset_position____s
jmp 0x40d349
mov edi, dword [ebp - 4]
or ebx, 0xffffffff
mov esi, dword [ebp - 0x10]
mov dword [0x4fa958], 0xc003001d
jmp 0x40d402
mov al, byte [0x543653]
test al, al
je 0x40d588
cmp al, 9
jae 0x40d58a
push str.Writing_compressed_image:
call fcn.004407e0
mov ecx, dword [0x4fad9c]
push 0x8000000
sub esp, 0xc
call fcn.00409c00
mov ebx, eax
add esp, 0x14
cmp ebx, 0xffffffff
jne 0x40d431
call fcn.00440bb0
push eax
push dword [0x4fad9c]
push str.Could_not_open_image__s:__s
call fcn.004407e0
add esp, 0xc
mov dword [0x4fa958], 0xc003006e
xor edi, edi
xor esi, esi
mov al, byte [0x543653]
test al, al
je 0x40d9e6
cmp al, 9
jae 0x40d9e6
cmp ebx, 0xffffffff
je 0x40da03
test ebx, ebx
je 0x40da03
push ebx
call dword [ebp - 0x2c]
jmp 0x40da03
mov eax, dword [0x543770]
push eax
push eax
call fcn.0049557c
add esp, 8
mov dword [0x4fa95c], eax
test eax, eax
jne 0x40d462
push str.Could_not_allocate_disk_write_buffer
mov dword [0x4fa958], 0xc0030008
call fcn.004407e0
add esp, 4
jmp 0x40d3fe
xor edx, edx
div dword [0x543770]
test edx, edx
je 0x40d485
push 0x50d
push str.C:UsersgamerDownloads_rufus72_rufus_7_src_format.c
push str._uintptr_t_sec_buf___SelectedDrive.SectorSize__0
call fcn.0049ed6b
add esp, 0xc
push 0x4fa958
push 0
push 0x40ccf0
push 0x40cd90
push 0
push fcn.004407e0
push 0x40000
mov dword [0x52be98], 0
call fcn.0046c9f0
movzx eax, byte [0x543653]
add esp, 0x1c
push eax
push edi
push ebx
call fcn.0046cef0
add esp, 0xc
mov esi, eax
mov edi, edx
call fcn.0046c9a0
mov ecx, 0x4d0bf0
call fcn.00440920
test edi, edi
jl 0x40d531
jg 0x40d4e3
test esi, esi
jb 0x40d531
cmp dword [0x52be98], 0
je 0x40d531
push str.Notice:_Compressed_image_data_didnt_end_on_block_boundary.
call fcn.004407e0
add esp, 4
lea eax, [ebp - 0x1c]
push 0
push eax
push dword [0x543770]
push dword [0x4fa95c]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [0x4fa95c]
call fcn.00495562
add esp, 4
mov dword [0x4fa95c], 0
jmp 0x40d21d
push dword [0x4fa95c]
call fcn.00495562
add esp, 4
mov dword [0x4fa95c], 0
test edi, edi
jg 0x40d21d
jl 0x40d55b
test esi, esi
jae 0x40d21d
cmp word [0x4fa958], 0x4c7
je 0x40d21d
push edi
push esi
push str.Could_not_write_compressed_image:__lld
call fcn.004407e0
add esp, 0xc
mov dword [0x4fa958], 0xc003001d
jmp 0x40d3fe
cmp al, 9
jne 0x40d5a8
push 0x523
push str.C:UsersgamerDownloads_rufus72_rufus_7_src_format.c
push str.img_report.compression_type___IMG_COMPRESSION_FFU
call fcn.0049ed6b
mov al, byte [0x543653]
add esp, 0xc
cmp al, 0xa
je 0x40d5b0
cmp al, 0xb
jne 0x40d5c8
mov ecx, dword [0x4fad9c]
call fcn.004549f0
mov dword [ebp - 0x44], eax
test eax, eax
je 0x40d3fe
jmp 0x40d5ca
xor eax, eax
mov esi, dword [0x4fad9c]
test eax, eax
push 1
push 0x20
cmovne esi, eax
call fcn.0049570f
mov ebx, eax
add esp, 8
mov dword [ebp - 0xc], ebx
test ebx, ebx
jne 0x40d5f7
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d3db
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
push ecx
push 0x48000000
sub esp, 0xc
mov dword [ebx + 0x18], eax
mov ecx, esi
call fcn.00409c00
add esp, 0x14
mov dword [ebx], eax
cmp eax, 0xffffffff
jne 0x40d638
push dword [ebx + 0x18]
call dword [ebp - 0x2c]
push ebx
call fcn.004998ec
add esp, 4
xor ebx, ebx
jmp 0x40d3db
mov ecx, dword [0x543770]
xor edx, edx
push ecx
lea eax, [ecx + 0x1ffffff]
div ecx
mov esi, eax
imul esi, ecx
mov dword [ebp - 0x3c], esi
lea eax, [esi + esi]
push eax
call fcn.0049557c
mov edi, eax
add esp, 8
mov dword [ebp - 4], edi
test edi, edi
jne 0x40d682
push str.Could_not_allocate_disk_write_buffer
mov dword [0x4fa958], 0xc0030008
call fcn.004407e0
add esp, 4
jmp 0x40d400
xor edx, edx
mov eax, edi
div dword [0x543770]
test edx, edx
je 0x40d6a7
push 0x53c
push str.C:UsersgamerDownloads_rufus72_rufus_7_src_format.c
push str._uintptr_t_buffer___SelectedDrive.SectorSize__0
call fcn.0049ed6b
add esp, 0xc
lea eax, [ebx + 8]
mov dword [ebx + 0x1c], 0
push eax
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
push esi
push edi
push dword [ebx]
mov dword [ebp - 0x58], eax
call eax
test eax, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38], eax
jne 0x40d6de
call eax
sub eax, 0x3e5
neg eax
sbb eax, eax
neg eax
dec eax
jmp 0x40d6e3
mov eax, 1
mov dword [ebx + 4], eax
xor ebx, ebx
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
xor esi, esi
mov dword [ebp - 0x60], eax
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x40], eax
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x50], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov dword [ebp - 0x64], 1
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x54], eax
mov edi, dword [ebp - 0x14]
mov edx, 0xcbd
push 0
push dword [ebp - 8]
mov ecx, 4
push edi
push esi
push ebx
call fcn.004510c0
mov eax, dword [ebp - 8]
add esp, 0x14
test eax, eax
jb 0x40d748
ja 0x40d73f
cmp edi, 0x50
jbe 0x40d748
mov ecx, 0x50
xor eax, eax
jmp 0x40d74a
mov ecx, edi
push esi
push ebx
push eax
push ecx
call fcn.00491ed0
push dword [ebp - 8]
push edi
push edx
push eax
call fcn.00491dc0
cmp eax, dword [ebp - 0x20]
jne 0x40d768
cmp edx, dword [ebp - 0x24]
je 0x40d778
mov ecx, 0x4d0824
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], edx
call fcn.00440920
mov ecx, dword [ebp - 0xc]
cmp dword [ecx + 4], 0
jg 0x40d79c
push 0x3a98
push dword [ecx + 0x18]
call dword [ebp - 0x50]
neg eax
sbb eax, eax
add eax, 1
je 0x40d9be
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x30]
lea edi, [ebp - 0x68]
lea edi, [edi + eax*4]
mov eax, dword [ecx + 4]
test eax, eax
je 0x40d9b8
cmp dword [ecx + 0x1c], 0
jne 0x40d9ab
shr eax, 0x1f
push eax
push edi
lea eax, [ecx + 8]
push eax
push dword [ecx]
call dword [ebp - 0x54]
test eax, eax
jne 0x40d7e1
call dword [ebp - 0x38]
xor ecx, ecx
cmp eax, 0x26
sete cl
test ecx, ecx
je 0x40d9be
jmp 0x40d7f4
mov ecx, dword [ebp - 0xc]
mov eax, dword [edi]
add dword [ecx + 0x10], eax
mov dword [ecx + 0x1c], 1
adc dword [ecx + 0x14], 0
mov ecx, dword [edi]
xor eax, eax
mov edx, ecx
add edx, ebx
adc eax, esi
cmp eax, dword [ebp - 8]
jb 0x40d812
mov eax, dword [ebp - 0x14]
ja 0x40d80c
cmp edx, eax
jbe 0x40d812
mov ecx, eax
sub ecx, ebx
mov dword [edi], ecx
mov esi, dword [0x543770]
xor edx, edx
mov eax, ecx
div esi
test edx, edx
je 0x40d830
lea eax, [esi - 1]
xor edx, edx
add eax, ecx
div esi
imul eax, esi
mov dword [edi], eax
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x5c], ecx
inc ecx
and ecx, 0x80000001
jns 0x40d844
dec ecx
or ecx, 0xfffffffe
inc ecx
mov esi, dword [ebp - 0xc]
mov dword [ebp - 0x30], ecx
lea eax, [esi + 8]
mov dword [esi + 0x1c], 0
push eax
mov eax, dword [ebp - 0x3c]
push 0
push eax
imul eax, ecx
add eax, dword [ebp - 4]
push eax
push dword [esi]
call dword [ebp - 0x58]
test eax, eax
jne 0x40d87c
call dword [ebp - 0x38]
sub eax, 0x3e5
neg eax
sbb eax, eax
neg eax
dec eax
jmp 0x40d881
mov eax, 1
mov dword [esi + 4], eax
mov esi, 1
lea esp, [esp]
mov eax, dword [0x4fa958]
test eax, eax
jns 0x40d8a3
cmp ax, 0x4c7
je 0x40d98b
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x3c]
imul eax, dword [ebp - 0x5c]
push dword [edi]
add eax, dword [ebp - 4]
push eax
push dword [ebp - 0x18]
call dword [ebp - 0x60]
test eax, eax
je 0x40d8de
mov eax, dword [edi]
mov ecx, dword [ebp - 0x1c]
cmp ecx, eax
je 0x40d953
push eax
push ecx
push str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.004407e0
add esp, 0xc
jmp 0x40d904
call fcn.00440bb0
push eax
push 0
push dword [0x543770]
push dword [ebp - 0x28]
push ebx
call fcn.00491dc0
push edx
push eax
push str._r_nWrite_error_at_sector__lld:__s
call fcn.004407e0
add esp, 0x10
cmp esi, 4
jae 0x40d996
push 5
push str.Retrying_in__d_seconds...
call fcn.004407e0
add esp, 8
push 0x1388
call dword [ebp - 0x40]
push 0
push 0
push dword [ebp - 0x28]
push ebx
push dword [ebp - 0x18]
call dword [ebp - 0x34]
test eax, eax
je 0x40d978
push 0xc8
call dword [ebp - 0x40]
inc esi
cmp esi, 4
jbe 0x40d890
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
jmp 0x40d400
mov esi, dword [ebp - 0x28]
add ebx, eax
adc esi, 0
mov dword [ebp - 0x28], esi
test eax, eax
jne 0x40d714
mov ecx, 0x4d0bf0
call fcn.00440920
mov ebx, dword [ebp - 0xc]
jmp 0x40d21d
call fcn.00440bb0
push eax
push str.Write_error:_Could_not_reset_position____s
call fcn.004407e0
add esp, 8
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
jmp 0x40d400
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
mov dword [0x4fa958], 0xc003001d
jmp 0x40d400
push 0x103
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d9be
mov dword [edi], 0
call fcn.00440bb0
push eax
push str._r_nRead_error:__s
call fcn.004407e0
mov ebx, dword [ebp - 0xc]
add esp, 8
mov edi, dword [ebp - 4]
mov dword [0x4fa958], 0xc003001e
jmp 0x40d400
test ebx, ebx
je 0x40da03
cmp ebx, 0xffffffff
je 0x40da03
push dword [ebx]
call dword [ebp - 0x2c]
push dword [ebx + 0x18]
call dword [ebp - 0x2c]
push ebx
call fcn.004998ec
add esp, 4
cmp dword [ebp - 0x44], 0
je 0x40da0e
call fcn.00454d80
push edi
call fcn.00495562
add esp, 4
push esi
call fcn.00495562
mov eax, dword [ebp - 0x48]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret