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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
push esi
push edi
push dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
mov esi, ecx
push edi
mov dword [esp + 0x18], 0
mov dword [esp + 0x20], 1
mov eax, dword [esi + 0x22c]
cdq
push edx
push eax
call fcn.004159e0
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
test ebx, ebx
jne 0x40825e
lea eax, [ebx + 0x57]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
push 0x800
push 0
push dword [esi + 0x264]
call fcn.00411960
add esp, 0xc
cmp ebx, dword [esi + 0x218]
jne 0x4082b8
cmp dword [ebp + 0x1c], 0
mov eax, dword [ebp + 0x18]
jg 0x4082a1
jl 0x40828a
test eax, eax
jae 0x4082a1
push eax
movzx eax, byte [ebp + 0x28]
push eax
mov eax, dword [ebp + 0x20]
push eax
push dword [esi + 0x22c]
push str.__xml_version_1.0_____data__n_program_SECTOR_SIZE_IN_BYTES__i__num_partition_sectors__i__physical_partition_number__i__start_sector_NUM_DISK_SECTORS_i____n__data_
jmp 0x4082cd
push eax
movzx eax, byte [ebp + 0x28]
push eax
mov eax, dword [ebp + 0x20]
push eax
push dword [esi + 0x22c]
push str.__xml_version_1.0_____data__n_program_SECTOR_SIZE_IN_BYTES__i__num_partition_sectors__i__physical_partition_number__i__start_sector__i____n__data_
jmp 0x4082cd
movzx eax, byte [ebp + 0x28]
push edi
push eax
mov eax, dword [ebp + 0x20]
push eax
push dword [esi + 0x22c]
push str.__xml_version_1.0_____data__n_read_SECTOR_SIZE_IN_BYTES__i__num_partition_sectors__i__physical_partition_number__i__start_sector__i____n__data_
push 0x800
push dword [esi + 0x264]
mov dword [esp + 0x30], eax
call fcn.0040c9d5
mov edx, dword [esi + 0x264]
add esp, 0x1c
mov ecx, edx
lea ebx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4082f0
mov eax, dword [esi + 0x238]
sub ecx, ebx
push 0
lea ebx, [esp + 0x20]
mov dword [esp + 0x20], ecx
push ebx
push ecx
push edx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40831e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esi + 0x264]
push esi
call fcn.00409850
add esp, 8
nop dword [eax]
mov ecx, esi
call fcn.00407950
mov ebx, eax
cmp ebx, 0x15
je 0x408330
mov edx, dword [ebp + 8]
cmp edx, 0xffffffff
jne 0x4083e5
push str.hRead__INVALID_HANDLE_VALUE__zeroing_input_buffer_n
call fcn.0040b76b
push dword [esi + 0x25c]
push 0
push dword [esi + 0x24c]
call fcn.00411960
mov eax, dword [esi + 0x25c]
add esp, 0x10
mov dword [esp + 0x10], eax
test ebx, ebx
jne 0x408513
mov ebx, dword [ebp + 0x20]
test ebx, ebx
je 0x40850a
nop word [eax + eax]
mov edi, dword [esi + 0x25c]
xor edx, edx
mov ecx, dword [esi + 0x22c]
mov eax, edi
div ecx
cmp ebx, eax
jae 0x4083ab
mov edi, ecx
imul edi, ebx
mov eax, dword [ebp + 0x14]
cmp eax, dword [esi + 0x218]
jne 0x408481
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], 0
cmp eax, 0xffffffff
je 0x40843e
push 0
lea ecx, [esp + 0x14]
push ecx
push edi
push dword [esi + 0x24c]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [esp + 0x18], eax
jmp 0x408442
cmp dword [ebp + 0x10], 0
jl 0x408374
jg 0x4083f1
test edi, edi
je 0x408374
mov ecx, dword [esp + 0x20]
mov eax, ecx
sar eax, 0x1f
push 0
lea eax, [esp + 0x24]
mov dword [esp + 0x24], ecx
push eax
push dword [esp + 0x2c]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40837c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push dword [ebp + 0x10]
push edi
push str.Failed_to_set_offset_0x_I64x_status:__i_n
call fcn.0040b76b
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4084fe
mov ecx, dword [esi + 0x238]
lea eax, [esp + 0x24]
xor ebx, ebx
mov dword [esp + 0x24], edi
push ebx
push eax
push edi
push dword [esi + 0x24c]
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408477
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jne 0x408513
jmp 0x4084c4
xor ebx, ebx
test edi, edi
je 0x4084ab
push 0
mov eax, edi
mov ecx, esi
sub eax, ebx
push eax
mov eax, dword [esi + 0x24c]
add eax, ebx
push eax
call fcn.00407400
add ebx, eax
mov dword [esp + 0x10], eax
cmp ebx, edi
jb 0x408487
mov eax, dword [ebp + 0x14]
push 0
lea ecx, [esp + 0x14]
push ecx
push edi
push dword [esi + 0x24c]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4084fe
mov ebx, dword [esp + 0x14]
push ebx
push str.Sectors_remaining__i_r
call fcn.0040b76b
xor edx, edx
mov eax, edi
div dword [esi + 0x22c]
add esp, 8
sub ebx, eax
mov dword [esp + 0x14], ebx
jne 0x408390
mov ecx, esi
call fcn.00407950
mov ebx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jne 0x408513
mov ecx, esi
call fcn.00407950
mov ebx, eax
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 0x24