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

Disassembly:
push 0xffffffffffffffff
push 0x41494b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x80
push ebx
push ebp
push esi
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
push edi
push 0x7e00
call esi
push 0x200
mov ebp, eax
call esi
add esp, 8
mov esi, eax
test ebp, ebp
mov dword [esp + 0x14], esi
je 0x408578
test esi, esi
je 0x40856e
mov ecx, 0x1f80
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, 0x80
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa0]
lea ecx, [esp + 0x28]
push eax
push str..PHYSICALDRIVE_d
push ecx
call dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 0xc
lea edx, [esp + 0x28]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x408564
mov eax, dword [esp + 0xa4]
push 0x41e428
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x4083ea
push edi
push 1
push 0x7e00
push ebp
call dword [sym.imp.MSVCRT.dll_fread]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x50]
mov byte [esp + 0x13], al
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa8]
test eax, eax
jne 0x408534
lea ecx, [esp + 0x18]
push 0
push ecx
push 0x200
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40846c
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push str.restoreBootTrack
call fcn.00413dc4
push ecx
mov dword [esp + 0xa0], 0
mov ecx, esp
mov dword [esp + 0x24], esp
push str.ReadFile
call fcn.00413dc4
push 0
mov dword [esp + 0xa4], 0xffffffff
call fcn.00406a10
add esp, 0xc
or eax, 0xffffffff
jmp 0x40857a
cmp dword [esp + 0x18], 0x200
je 0x4084c0
push 0
push ecx
mov ecx, esp
mov dword [esp + 0x24], esp
push 0x41c198
call fcn.00413dc4
push ecx
mov dword [esp + 0xa4], 1
mov ecx, esp
mov dword [esp + 0x20], esp
push str.restoreBootTrack:_bytesRead___512
call fcn.00413dc4
mov dword [esp + 0xa4], 0xffffffff
call fcn.00406ff0
add esp, 0xc
or eax, 0xffffffff
jmp 0x40857a
lea edi, [esi + 0x1be]
mov ecx, 0x10
lea esi, [esp + 0x50]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
jne 0x40851b
push edx
push ecx
mov ecx, esp
mov dword [esp + 0x24], esp
push 0x41c198
call fcn.00413dc4
push ecx
mov dword [esp + 0xa4], 2
mov ecx, esp
mov dword [esp + 0x2c], esp
push str.Error_found_in_restoreBootTrack__
call fcn.00413dc4
mov dword [esp + 0xa4], 0xffffffff
call fcn.00406ff0
add esp, 0xc
mov byte [esp + 0x13], 1
mov eax, dword [esp + 0x14]
lea edi, [ebp + 0x1be]
mov ecx, 0x10
lea esi, [eax + 0x1be]
rep movsd dword es:[edi], dword [esi]
mov esi, eax
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov al, byte [esp + 0x13]
test al, al
jne 0x40855d
lea ecx, [esp + 0x24]
push 0
push ecx
push 0x7e00
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push ebp
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x90]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x8c
ret