Function at 0x408230
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.00415a10
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
test ebx, ebx
jne 0x40827e
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.00411990
add esp, 0xc
cmp ebx, dword [esi + 0x218]
jne 0x4082d8
cmp dword [ebp + 0x1c], 0
mov eax, dword [ebp + 0x18]
jg 0x4082c1
jl 0x4082aa
test eax, eax
jae 0x4082c1
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 0x4082ed
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 0x4082ed
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.0040ca05
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 0x408310
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 0x40833e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esi + 0x264]
push esi
call fcn.00409880
add esp, 8
nop dword [eax]
mov ecx, esi
call fcn.00407950
mov ebx, eax
cmp ebx, 0x15
je 0x408350
mov edx, dword [ebp + 8]
cmp edx, 0xffffffff
jne 0x408405
push str.hRead__INVALID_HANDLE_VALUE__zeroing_input_buffer_n
call fcn.0040b79b
push dword [esi + 0x25c]
push 0
push dword [esi + 0x24c]
call fcn.00411990
mov eax, dword [esi + 0x25c]
add esp, 0x10
mov dword [esp + 0x10], eax
test ebx, ebx
jne 0x408533
mov ebx, dword [ebp + 0x20]
test ebx, ebx
je 0x40852a
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 0x4083cb
mov edi, ecx
imul edi, ebx
mov eax, dword [ebp + 0x14]
cmp eax, dword [esi + 0x218]
jne 0x4084a1
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], 0
cmp eax, 0xffffffff
je 0x40845e
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 0x408462
cmp dword [ebp + 0x10], 0
jl 0x408394
jg 0x408411
test edi, edi
je 0x408394
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 0x40839c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push dword [ebp + 0x10]
push edi
push 0x427350
call fcn.0040b79b
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 0x40851e
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 0x408497
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jne 0x408533
jmp 0x4084e4
xor ebx, ebx
test edi, edi
je 0x4084cb
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 0x4084a7
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 0x40851e
mov ebx, dword [esp + 0x14]
push ebx
push str.Sectors_remaining__i_r
call fcn.0040b79b
xor edx, edx
mov eax, edi
div dword [esi + 0x22c]
add esp, 8
sub ebx, eax
mov dword [esp + 0x14], ebx
jne 0x4083b0
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 0x408533
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