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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x20], 0
mov dword [esp], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], eax
push ebx
mov ebx, 1
mov dword [esp + 0x20], ebx
push esi
mov esi, dword [ebp + 0x18]
push edi
mov edi, ecx
test eax, eax
jg 0x4022c7
jl 0x4022a2
test esi, esi
jae 0x4022c7
mov eax, dword [edi + 0x22c]
cdq
push edx
push eax
push dword [edi + 0x214]
push dword [edi + 0x210]
call fcn.0041d7c0
add esi, eax
mov eax, dword [ebp + 0x1c]
adc eax, edx
mov dword [esp + 0x20], eax
mov eax, 0x100000
cdq
idiv dword [edi + 0x22c]
push 0
push 0
push 0
push 0
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x40], eax
test eax, eax
jne 0x4022fb
mov eax, 0xe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
mov ecx, dword [edi + 0x22c]
mov eax, ecx
push dword [esp + 0x20]
imul eax, esi
push esi
mov dword [esp + 0x40], eax
mov eax, ecx
cdq
push edx
push eax
call fcn.00415a10
push 0
push 0
mov eax, edx
mov dword [esp + 0x44], edx
push 0
sar eax, 0x1f
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x54], eax
test eax, eax
je 0x4022ed
mov ecx, dword [edi + 0x22c]
mov eax, ecx
mov esi, dword [ebp + 0xc]
push dword [ebp + 0x10]
imul eax, esi
push esi
mov dword [esp + 0x54], eax
mov eax, ecx
cdq
push edx
push eax
call fcn.00415a10
mov eax, edx
mov dword [esp + 0x50], edx
sar eax, 0x1f
cmp dword [ebp + 8], 0xffffffff
jne 0x4023b9
push str.hRead__INVALID_HANDLE_VALUE__zeroing_input_buffer_n
call fcn.0040b79b
mov eax, dword [edi + 0x22c]
imul eax, dword [esp + 0x20]
push eax
push 0
push dword [edi + 0x21c]
call fcn.00411990
mov eax, dword [edi + 0x22c]
imul eax, dword [esp + 0x2c]
push eax
push 0
push dword [edi + 0x220]
call fcn.00411990
mov esi, dword [edi + 0x22c]
add esp, 0x1c
mov ecx, dword [esp + 0x1c]
imul esi, ecx
mov dword [esp + 0xc], esi
jmp 0x4023c1
mov esi, dword [esp + 0xc]
mov ecx, dword [esp + 0x1c]
cmp dword [ebp + 0x24], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x10], xmm0
jb 0x4025b8
ja 0x4023e0
cmp dword [ebp + 0x20], 0
jbe 0x4025b8
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
mov eax, ecx
cdq
add eax, dword [esp + 0x10]
adc edx, dword [esp + 0x20]
cmp edx, dword [ebp + 0x24]
jb 0x40241a
mov edx, dword [ebp + 0x20]
ja 0x402409
cmp eax, edx
jbe 0x40241a
mov eax, edx
or eax, dword [ebp + 0x24]
je 0x40241a
mov ecx, edx
sub ecx, dword [esp + 0x10]
mov dword [esp + 0x1c], ecx
mov edx, dword [ebp + 8]
cmp edx, 0xffffffff
je 0x4024b3
lea eax, [esp + 0x44]
mov dword [esp + 0xc], 0
push eax
lea eax, [esp + 0x10]
push eax
mov eax, dword [edi + 0x22c]
imul eax, ecx
cmp dword [esp + 0x30], 0
push eax
je 0x402451
push dword [edi + 0x21c]
jmp 0x402457
push dword [edi + 0x220]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402493
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
jne 0x4025a0
push 1
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x4c]
push eax
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x4025a0
mov ecx, dword [edi + 0x22c]
mov esi, dword [esp + 0xc]
dec esi
mov dword [esp + 0x24], 0
add esi, ecx
lea eax, [ecx - 1]
not eax
and esi, eax
mov dword [esp + 0xc], esi
mov eax, dword [esp + 0x4c]
lea ecx, [eax + esi]
cmp ecx, eax
jae 0x4024c2
inc dword [esp + 0x50]
mov dword [esp + 0x4c], ecx
test ebx, ebx
jne 0x40250b
push 1
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x38]
push eax
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov ebx, eax
test ebx, ebx
je 0x4025aa
mov eax, dword [esp + 0x2c]
add eax, dword [esp + 0x38]
cmp eax, dword [esp + 0x38]
jae 0x4024fb
inc dword [esp + 0x3c]
mov esi, dword [esp + 0xc]
mov dword [esp + 0x38], eax
mov dword [esp + 0x24], 0
cmp dword [esp + 0x28], 0
lea eax, [esp + 0x30]
push eax
push 0
push esi
je 0x402522
push dword [edi + 0x21c]
jmp 0x402528
push dword [edi + 0x220]
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, eax
test ebx, ebx
je 0x40254d
mov eax, dword [esp + 0xc]
add eax, dword [esp + 0x38]
cmp eax, dword [esp + 0x38]
jae 0x402549
inc dword [esp + 0x3c]
mov dword [esp + 0x38], eax
mov ecx, dword [esp + 0x10]
xor eax, eax
cmp dword [esp + 0x28], eax
mov esi, dword [ebp + 0x20]
sete al
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
cdq
add ecx, eax
mov eax, esi
mov dword [esp + 0x10], ecx
adc dword [esp + 0x20], edx
sub eax, ecx
push eax
push str.Sectors_remaining:__i_______r
call fcn.0040b79b
mov eax, dword [ebp + 0x24]
add esp, 8
cmp dword [esp + 0x20], eax
ja 0x4025c8
jb 0x402593
cmp dword [esp + 0x10], esi
jae 0x4025c8
mov esi, dword [esp + 0xc]
mov ecx, dword [esp + 0x1c]
jmp 0x4023f0
call esi
mov esi, eax
mov dword [esp + 0x24], esi
jmp 0x4025ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x24], esi
jmp 0x4025ca
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
xor esi, esi
push esi
push str._nStatus___i_n
call fcn.0040b79b
mov eax, dword [ebp + 0x24]
add esp, 8
cmp dword [esp + 0x20], eax
ja 0x402641
jb 0x4025ec
mov eax, dword [esp + 0x10]
cmp eax, dword [ebp + 0x20]
jae 0x402641
mov ecx, dword [esp + 0xc]
test ecx, ecx
je 0x402641
test esi, esi
jne 0x402641
mov eax, dword [edi + 0x22c]
dec ecx
add ecx, eax
dec eax
not eax
and ecx, eax
lea eax, [esp + 0x30]
push eax
push esi
mov dword [esp + 0x14], ecx
push ecx
cmp dword [esp + 0x34], esi
je 0x40261f
push dword [edi + 0x21c]
jmp 0x402625
push dword [edi + 0x220]
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [esp + 0xc]
mov ebx, eax
push str.Wrote_last_bytes:__i_n
call fcn.0040b79b
add esp, 8
test ebx, ebx
jne 0x402673
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x3e5
jne 0x402673
push 1
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x38]
push eax
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x402673
call ebx
mov dword [esp + 0x24], eax
push dword [esp + 0x54]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x40]
call esi
mov eax, dword [esp + 0x24]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24