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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x8c
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x38], edx
test edx, edx
je 0x40f147
mov eax, dword [0x4e2220]
mov dword [ebp - 0x30], eax
mov eax, dword [0x4e2224]
jmp 0x40f154
mov eax, dword [0x5132d0]
mov dword [ebp - 0x30], eax
mov eax, dword [0x5132d4]
mov dword [ebp - 0x3c], eax
mov eax, dword [0x4e2230]
cmp eax, 0x1ff
ja 0x40f178
mov dword [esp + 4], eax
mov dword [esp], str.Unexpected_sector_size___d____Aborting
call fcn.0043efa9
jmp 0x40fe5e
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
mov dword [esp + 4], eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
jne 0x40f1a9
mov dword [esp], str.Warning:_Unable_to_rewind_image_position___wrong_data_might_be_copied_
call fcn.0043efa9
xor eax, eax
mov dword [esp], 0xffffffff
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov dword [esp + 8], eax
mov dword [esp + 0xc], eax
mov dword [esp + 4], eax
call fcn.0044d5f3
cmp dword [ebp - 0x38], 0
je 0x40f669
cmp dword [0x526c98], 0
mov edx, str.Fast_zeroing_drive:
mov eax, str.Zeroing_drive:
cmovne eax, edx
mov dword [esp], eax
call fcn.0043efa9
mov ecx, dword [0x4e2230]
xor edx, edx
lea ebx, [ecx + 0x1ffffff]
mov eax, ebx
div ecx
sub ebx, edx
mov edx, ecx
mov eax, ebx
call fcn.0040eca5
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x40f23b
mov dword [0x4e2900], 0xc0030008
xor esi, esi
mov dword [esp], str.Could_not_allocate_disk_zeroing_buffer
call fcn.0043efa9
xor eax, eax
mov dword [ebp - 0x40], eax
jmp 0x40f32b
mov eax, dword [ebp - 0x2c]
xor edx, edx
div dword [0x4e2230]
test edx, edx
je 0x40f257
mov dword [esp + 8], 0x49e
jmp 0x40fa35
mov eax, dword [0x526c98]
test eax, eax
je 0x40f265
mov eax, 0xff
mov edi, dword [ebp - 0x2c]
mov ecx, ebx
xor esi, esi
rep stosb byte es:[edi], al
cmp dword [0x526c98], 0
je 0x40f2ce
mov edx, dword [0x4e2230]
mov eax, ebx
call fcn.0040eca5
mov esi, eax
test eax, eax
jne 0x40f2a5
mov dword [0x4e2900], 0xc0030008
mov dword [esp], str.Could_not_allocate_disk_comparison_buffer
call fcn.0043efa9
jmp 0x40f326
xor edx, edx
div dword [0x4e2230]
test edx, edx
je 0x40f2ce
mov dword [esp + 8], 0x4aa
mov dword [esp + 4], str.format.c
mov dword [esp], str._uintptr_t_cmp_buffer___SelectedDrive.SectorSize__0
call dword [0x494088]
xor ecx, ecx
xor eax, eax
mov edx, 0x50
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x30]
xor edi, edi
or ebx, 0xffffffff
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
xor eax, eax
cmp edx, ecx
mov ecx, eax
sbb ecx, dword [ebp - 0x3c]
cmovae edx, dword [ebp - 0x30]
mov dword [ebp - 0x48], 0xffffffff
cmovae eax, dword [ebp - 0x3c]
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x58], eax
jmp 0x40f3a6
mov edi, dword [0x526c98]
test edi, edi
je 0x40f505
test eax, eax
jns 0x40f333
cmp ax, 0x4c7
jne 0x40f333
xor eax, eax
mov dword [ebp - 0x40], eax
or ebx, 0xffffffff
jmp 0x40fe02
lea eax, [ebp - 0x24]
xor edi, edi
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40f4a0
mov edx, dword [ebp - 0x20]
cmp edx, dword [ebp - 0x24]
jne 0x40f4a0
mov ecx, dword [esi]
lea eax, [ecx - 1]
cmp eax, 0xfffffffd
jbe 0x40f4c0
mov ebx, edx
mov eax, 1
shr ebx, 2
cmp eax, ebx
jb 0x40f4b5
mov dword [ebp - 0x28], edx
xor edi, edi
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x50]
adc dword [ebp - 0x34], 0
mov ebx, dword [ebp - 0x40]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x34]
sbb eax, dword [ebp - 0x3c]
jae 0x40f65c
cmp dword [0x526c98], 1
sbb eax, eax
xor edx, edx
mov dword [esp + 0x18], edx
mov ecx, dword [ebp - 0x30]
and eax, 0xffffffec
add eax, 0xcea
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x3c]
mov dword [esp + 0x14], ecx
mov edx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x34]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], ecx
mov dword [esp], 4
call fcn.0044d5f3
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x34]
imul ecx, eax
mov eax, dword [ebp - 0x54]
imul eax, edx
add ecx, eax
mov eax, dword [ebp - 0x54]
mul dword [ebp - 0x38]
add edx, ecx
mov ecx, dword [ebp - 0x30]
mov dword [esp + 8], ecx
mov ecx, dword [ebp - 0x3c]
mov dword [esp], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 4], edx
call fcn.00487e10
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x50], edx
cmp edx, ecx
jne 0x40f442
cmp eax, ebx
je 0x40f44e
mov dword [esp], 0x49ad65
call fcn.0043f0d2
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
mov ebx, dword [ebp - 0x3c]
add eax, dword [ebp - 0x20]
adc edx, 0
cmp dword [ebp - 0x30], eax
sbb ebx, edx
jae 0x40f46f
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x38]
sub eax, ebx
mov dword [ebp - 0x20], eax
mov ebx, dword [ebp - 0x20]
mov ecx, dword [0x4e2230]
xor edx, edx
mov eax, ebx
div ecx
test edx, edx
je 0x40f490
lea eax, [ebx + ecx - 1]
xor edx, edx
div ecx
imul eax, ecx
mov dword [ebp - 0x20], eax
mov eax, dword [0x4e2900]
test edi, edi
je 0x40f30e
dec edi
jmp 0x40f505
call fcn.0043f53d
mov dword [esp], str._r_nRead_error:_Could_not_read_data_for_fast_zeroing_comparison____s
mov dword [esp + 4], eax
jmp 0x40f5eb
cmp ecx, dword [esi + eax*4]
jne 0x40f4c0
inc eax
jmp 0x40f386
xor ebx, ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ebx
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
jne 0x40f500
call fcn.0043f53d
mov dword [esp], str._r_nError:_Could_not_reset_position____s
mov dword [esp + 4], eax
jmp 0x40f5eb
mov edi, 0xf
mov dword [ebp - 0x48], 4
jmp 0x40f518
mov dword [esp], 0xc8
call ebx
push eax
mov eax, dword [0x4e2900]
test eax, eax
jns 0x40f52b
cmp ax, 0x4c7
je 0x40f326
xor ecx, ecx
lea eax, [ebp - 0x28]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
sub esp, 0x14
test eax, eax
je 0x40f5f5
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x28]
cmp edx, eax
je 0x40f393
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.0043efa9
dec dword [ebp - 0x48]
je 0x40f64d
mov dword [esp + 4], 5
mov dword [esp], 0x49b024
call fcn.0043efa9
mov dword [esp], 0x1388
mov ebx, dword [sym.imp.KERNEL32.DLL_Sleep]
call ebx
push eax
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
jne 0x40f50e
call fcn.0043f53d
mov dword [esp], 0x49b03e
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40f326
call fcn.0043f53d
mov ecx, dword [esp + 8]
xor edx, edx
mov dword [esp + 0xc], eax
mov eax, dword [0x4e2230]
mov ebx, dword [esp + 0xc]
mov dword [ebp - 0x60], ecx
mov dword [ebp - 0x5c], ebx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487e10
mov ebx, dword [ebp - 0x5c]
mov dword [esp], str._r_nWrite_error_at_sector__lld:__s
mov dword [esp + 4], eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edx
call fcn.0043efa9
jmp 0x40f57f
mov dword [0x4e2900], 0xc003001d
jmp 0x40f326
xor eax, eax
or ebx, 0xffffffff
mov dword [ebp - 0x40], eax
jmp 0x40fdf7
mov al, byte [0x513313]
lea edx, [eax - 1]
cmp dl, 7
ja 0x40f88c
mov dword [esp], str.Writing_compressed_image:
xor edi, edi
call fcn.0043efa9
mov eax, dword [0x525a68]
call fcn.0040ed0d
mov dword [esp + 0x18], edi
mov esi, eax
xor eax, eax
mov dword [esp + 0x14], 0x8000000
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], esi
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
sub esp, 0x1c
mov ebx, eax
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov edi, eax
test esi, esi
je 0x40f6e0
mov dword [esp], esi
call sub.msvcrt.dll_free
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_SetLastError]
push esi
cmp ebx, 0xffffffff
jne 0x40f728
call fcn.0043f53d
mov dword [esp + 8], eax
mov eax, dword [0x525a68]
mov dword [esp], 0x49b083
mov dword [esp + 4], eax
call fcn.0043efa9
mov dword [0x4e2900], 0xc003006e
xor edx, edx
xor ecx, ecx
xor esi, esi
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x2c], ecx
jmp 0x40f32b
mov eax, dword [0x4e2230]
mov edx, eax
call fcn.0040eca5
mov dword [0x4e28e4], eax
test eax, eax
jne 0x40f758
mov dword [0x4e2900], 0xc0030008
mov dword [esp], str.Could_not_allocate_disk_write_buffer
call fcn.0043efa9
jmp 0x40f87b
xor edx, edx
div dword [0x4e2230]
test edx, edx
je 0x40f780
mov dword [esp + 8], 0x50d
mov dword [esp + 4], str.format.c
mov dword [esp], str._uintptr_t_sec_buf___SelectedDrive.SectorSize__0
jmp 0x40f2c8
xor eax, eax
mov dword [0x4e2910], eax
xor eax, eax
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x18], 0x4e2900
mov dword [esp + 0x10], 0x40ea8e
mov dword [esp + 0xc], 0x40eb57
mov dword [esp + 8], eax
mov dword [esp + 4], fcn.0043efa9
mov dword [esp], 0x40000
call fcn.0045564d
movzx eax, byte [0x513313]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.00455121
mov esi, edx
mov edi, eax
call fcn.004556d3
mov dword [esp], 0x49b12c
call fcn.0043f0d2
test esi, esi
js 0x40f835
cmp dword [0x4e2910], 0
je 0x40f835
mov dword [esp], str.Notice:_Compressed_image_data_didnt_end_on_block_boundary.
call fcn.0043efa9
xor eax, eax
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], eax
mov eax, dword [0x4e2230]
mov dword [esp + 8], eax
mov eax, dword [0x4e28e4]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
sub esp, 0x14
mov eax, dword [0x4e28e4]
call fcn.0040ecf5
xor eax, eax
mov dword [0x4e28e4], eax
test esi, esi
jns 0x40fdeb
cmp word [0x4e2900], 0x4c7
je 0x40fdeb
mov dword [esp + 4], edi
mov dword [esp + 8], esi
mov dword [esp], str.Could_not_write_compressed_image:__lld
call fcn.0043efa9
mov dword [0x4e2900], 0xc003001d
xor ecx, ecx
xor edi, edi
xor esi, esi
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x2c], edi
jmp 0x40fe02
cmp al, 9
jne 0x40f8ac
mov dword [esp + 8], 0x523
mov dword [esp + 4], str.format.c
mov dword [esp], str.img_report.compression_type___IMG_COMPRESSION_FFU
jmp 0x40f2c8
xor edx, edx
sub eax, 0xa
mov esi, dword [0x525a68]
mov dword [ebp - 0x40], edx
cmp al, 1
ja 0x40f8d3
mov dword [esp], esi
call fcn.00451503
mov esi, eax
test eax, eax
je 0x40f717
mov dword [ebp - 0x40], eax
mov dword [esp + 4], 1
mov dword [esp], 0x20
call sub.msvcrt.dll_calloc
mov ebx, eax
test eax, eax
jne 0x40f900
mov dword [esp], 8
call dword [sym.imp.KERNEL32.DLL_SetLastError]
push eax
jmp 0x40f9e8
xor eax, eax
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CreateEventA]
mov dword [ebx + 0x18], eax
sub esp, 0x10
mov eax, esi
call fcn.0040ed0d
mov dword [esp + 0x14], 0x48000000
mov edi, eax
xor eax, eax
mov dword [esp + 0x10], 3
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
sub esp, 0x1c
mov esi, eax
call dword [sym.imp.KERNEL32.DLL_GetLastError]
test edi, edi
je 0x40f97e
mov dword [ebp - 0x2c], eax
mov dword [esp], edi
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetLastError]
push edi
mov dword [ebx], esi
inc esi
jne 0x40f9a4
mov eax, dword [ebx + 0x18]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push esi
mov dword [esp], ebx
call sub.msvcrt.dll_free
jmp 0x40f9e8
mov ecx, dword [0x4e2230]
xor edx, edx
lea esi, [ecx + 0x1ffffff]
mov eax, esi
div ecx
sub esi, edx
mov edx, ecx
mov eax, esi
mov dword [ebp - 0x48], esi
add eax, esi
call fcn.0040eca5
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x40fa1e
mov dword [0x4e2900], 0xc0030008
mov dword [esp], str.Could_not_allocate_disk_write_buffer
call fcn.0043efa9
jmp 0x40fb7f
call fcn.0043f53d
xor esi, esi
xor ebx, ebx
mov dword [esp + 8], eax
mov eax, dword [0x525a68]
mov dword [esp], 0x49b083
mov dword [esp + 4], eax
call fcn.0043efa9
xor ecx, ecx
mov dword [0x4e2900], 0xc003006e
mov dword [ebp - 0x2c], ecx
jmp 0x40fe02
mov eax, dword [ebp - 0x2c]
xor edx, edx
div dword [0x4e2230]
test edx, edx
je 0x40fa49
mov dword [esp + 8], 0x53c
mov dword [esp + 4], str.format.c
mov dword [esp], str._uintptr_t_buffer___SelectedDrive.SectorSize__0
jmp 0x40f2c8
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x2c]
mov eax, ebx
call fcn.0040f08b
xor edx, edx
mov edi, dword [ebp - 0x30]
mov ecx, 0x50
mov dword [ebp - 0x50], edx
mov eax, 1
mov dword [ebp - 0x4c], edx
xor edx, edx
cmp ecx, edi
mov edi, edx
sbb edi, dword [ebp - 0x3c]
cmovae ecx, dword [ebp - 0x30]
mov dword [ebp - 0x1c], 1
cmovae edx, dword [ebp - 0x3c]
mov dword [ebp - 0x54], 0xffffffff
mov dword [ebp - 0x64], 0xffffffff
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x70], edx
jmp 0x40fab5
mov esi, dword [ebp - 0x54]
add dword [ebp - 0x50], eax
mov edi, dword [ebp - 0x58]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x38], esi
mov esi, dword [ebp - 0x60]
adc dword [ebp - 0x4c], 0
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x64], esi
cmp dword [ebp + eax*4 - 0x20], 0
je 0x40fddb
xor edi, edi
mov dword [esp + 0x18], edi
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [esp + 4], 0xcbd
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov dword [esp], 4
call fcn.0044d5f3
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x70]
mov edi, dword [ebp - 0x4c]
imul ecx, eax
mov eax, dword [ebp - 0x68]
imul eax, edi
mov edi, dword [ebp - 0x30]
add ecx, eax
mov eax, dword [ebp - 0x68]
mul dword [ebp - 0x50]
mov dword [esp + 8], edi
mov edi, dword [ebp - 0x3c]
add edx, ecx
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487e10
mov edi, dword [ebp - 0x64]
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x60], edx
cmp edx, edi
jne 0x40fb86
mov edi, dword [ebp - 0x54]
cmp eax, edi
jne 0x40fb86
cmp dword [ebx + 4], 0
jg 0x40fb94
mov dword [esp + 4], 0x3a98
mov eax, dword [ebx + 0x18]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
push esi
push esi
test eax, eax
je 0x40fb94
call fcn.0043f53d
mov dword [esp], str._r_nRead_error:__s
mov dword [esp + 4], eax
call fcn.0043efa9
mov dword [0x4e2900], 0xc003001e
xor esi, esi
jmp 0x40fe02
mov dword [esp], 0x49ad65
call fcn.0043f0d2
jmp 0x40fb40
mov eax, dword [ebx + 4]
test eax, eax
jne 0x40fba6
mov eax, dword [ebp - 0x38]
xor ecx, ecx
mov dword [ebp + eax*4 - 0x20], ecx
jmp 0x40fb60
cmp dword [ebx + 0x1c], 0
je 0x40fbbc
mov dword [esp], 0x103
call dword [sym.imp.KERNEL32.DLL_SetLastError]
push edx
jmp 0x40fb60
shr eax, 0x1f
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
lea eax, [ebp + eax*4 - 0x20]
mov dword [esp + 8], eax
lea eax, [ebx + 8]
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_GetOverlappedResult]
sub esp, 0x10
test eax, eax
jne 0x40fbf7
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x26
je 0x40fc0d
jmp 0x40fb60
mov eax, dword [ebp - 0x38]
xor edx, edx
mov dword [ebx + 0x1c], 1
mov eax, dword [ebp + eax*4 - 0x20]
add dword [ebx + 0x10], eax
adc dword [ebx + 0x14], edx
mov edi, dword [ebp - 0x38]
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x50]
add eax, dword [ebp + edi*4 - 0x20]
mov edi, dword [ebp - 0x3c]
adc edx, 0
cmp dword [ebp - 0x30], eax
sbb edi, edx
jae 0x40fc36
mov edi, dword [ebp - 0x50]
mov eax, dword [ebp - 0x30]
sub eax, edi
mov edi, dword [ebp - 0x38]
mov dword [ebp + edi*4 - 0x20], eax
mov eax, dword [ebp - 0x38]
mov ecx, dword [0x4e2230]
xor edx, edx
mov eax, dword [ebp + eax*4 - 0x20]
mov edi, eax
div ecx
test edx, edx
je 0x40fc5f
lea eax, [edi + ecx - 1]
xor edx, edx
mov edi, dword [ebp - 0x38]
div ecx
imul eax, ecx
mov dword [ebp + edi*4 - 0x20], eax
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x48]
inc eax
and eax, 1
imul edx, eax
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x2c]
add edx, eax
mov eax, ebx
call fcn.0040f08b
mov edi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x6c], 4
imul eax, edi
mov edi, dword [ebp - 0x2c]
add eax, edi
mov dword [ebp - 0x64], eax
mov eax, dword [0x4e2900]
test eax, eax
jns 0x40fca9
cmp ax, 0x4c7
je 0x40fb7f
xor eax, eax
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
mov eax, dword [ebp + eax*4 - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x64]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
sub esp, 0x14
test eax, eax
je 0x40fd03
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp + eax*4 - 0x20]
cmp eax, edx
je 0x40fa99
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], str._r_nWrite_error:_Wrote__d_bytes__expected__d_bytes
call fcn.0043efa9
jmp 0x40fd49
call fcn.0043f53d
mov dword [esp + 0xc], eax
mov eax, dword [0x4e2230]
mov edi, dword [esp + 0xc]
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487e10
mov dword [esp + 0xc], edi
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp], str._r_nWrite_error_at_sector__lld:__s
call fcn.0043efa9
dec dword [ebp - 0x6c]
je 0x40fdbd
mov dword [esp + 4], 5
mov dword [esp], 0x49b024
call fcn.0043efa9
mov edx, dword [sym.imp.KERNEL32.DLL_Sleep]
mov dword [esp], 0x1388
mov dword [ebp - 0x74], edx
call edx
push eax
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
mov edx, dword [ebp - 0x74]
sub esp, 0x14
test eax, eax
jne 0x40fdcc
call fcn.0043f53d
mov dword [esp], 0x49b03e
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40fb7f
mov dword [0x4e2900], 0xc003001d
jmp 0x40fb7f
mov dword [esp], 0xc8
call edx
push eax
jmp 0x40fc96
mov dword [esp], 0x49b12c
xor esi, esi
call fcn.0043f0d2
jmp 0x40fdf7
xor edi, edi
xor esi, esi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x40], esi
xor esi, esi
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.0040ba38
mov al, byte [0x513313]
lea edx, [ebx - 1]
dec eax
cmp al, 7
ja 0x40fe20
cmp edx, 0xfffffffd
ja 0x40fe44
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push ecx
jmp 0x40fe44
cmp edx, 0xfffffffd
ja 0x40fe44
mov eax, dword [ebx]
mov edi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov dword [esp], eax
call edi
push eax
mov eax, dword [ebx + 0x18]
mov dword [esp], eax
call edi
push edx
mov dword [esp], ebx
call sub.msvcrt.dll_free
cmp dword [ebp - 0x40], 0
je 0x40fe4f
call fcn.00451458
mov eax, dword [ebp - 0x2c]
call fcn.0040ecf5
mov eax, esi
call fcn.0040ecf5
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret