Function at 0x405310
Capabilities:
Clear file content
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42fa78
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x442004]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
push eax
mov eax, dword [ebp + 8]
push eax
push esi
push str.Creating_file__s_of_size__I64u._n
push dword [ebp + 0x18]
mov byte [ebp - 0x31], 0
call fcn.004027b0
add esp, 0x14
mov ecx, str.SeManageVolumePrivilege
call fcn.004023f0
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test al, al
jne 0x405383
call edi
push eax
push str.WARNING:_Could_not_set_privileges_for_setting_valid_file_size__will_use_a_slower_method_of_preparing_the_file_n
call fcn.00402770
add esp, 8
mov byte [ebp - 0x31], 1
push esi
call fcn.00405220
test eax, eax
je 0x4053a0
cmp eax, 0x32
je 0x4053a0
push eax
push str.WARNING:_Could_not_create_intermediate_directory__error_code:__u__n
call fcn.00402770
add esp, 8
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
mov dword [ebp - 0x38], ebx
cmp ebx, 0xffffffff
jne 0x4053d8
call edi
push eax
push str.Could_not_create_the_file__error_code:__u__n
call fcn.00402770
add esp, 8
jmp 0x40566c
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
test eax, eax
jne 0x4053ea
test esi, esi
je 0x4055a2
push 0
lea ecx, [ebp - 0x18]
push ecx
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push ebx
call esi
test eax, eax
jne 0x405414
call edi
push eax
push str.Could_not_set_file_pointer_during_file_creation_when_extending_file__error_code:__u__n
call fcn.00402770
add esp, 8
jmp 0x405665
mov eax, dword [ebp + 8]
cmp dword [ebp - 0x18], eax
jne 0x405658
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x14], eax
jne 0x405658
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x40544c
call edi
push eax
push str.Error_setting_end_of_file__error_code:__u__n
call fcn.00402770
add esp, 8
jmp 0x405665
cmp byte [ebp - 0x31], 0
jne 0x405477
push dword [ebp + 0xc]
push dword [ebp + 8]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileValidData]
test eax, eax
jne 0x40559f
call edi
push eax
push str.WARNING:_Could_not_set_valid_file_size__error_code:__u___trying_a_slower_method_of_filling_the_file__this_does_not_affect_performance__just_makes_the_test_preparation_longer__n
call fcn.00402770
add esp, 8
push 0
lea eax, [ebp - 0x18]
push eax
push 0
push 0
push ebx
call esi
test eax, eax
jne 0x40549d
call edi
push eax
push str.Could_not_set_file_pointer_during_file_creation__error_code:__u__n
call fcn.00402770
add esp, 8
jmp 0x405665
mov eax, dword [ebp - 0x18]
or eax, dword [ebp - 0x14]
je 0x4054af
push str.File_pointer_improperly_moved_during_file_creation_n
jmp 0x40565d
cmp dword [ebp + 0xc], 0
mov esi, 0x100000
mov edi, dword [ebp + 8]
ja 0x4054c5
jb 0x4054c3
cmp edi, esi
jae 0x4054c5
mov esi, edi
xor eax, eax
lea ecx, [ebp - 0x24]
push esi
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
call fcn.004074f0
xor eax, eax
mov dword [ebp - 4], 0
mov ebx, dword [ebp - 0x24]
test esi, esi
je 0x405503
mov dl, byte [ebp + 0x14]
lea esp, [esp]
test dl, dl
je 0x4054f8
xor ecx, ecx
jmp 0x4054fb
movzx ecx, al
mov byte [ebx + eax], cl
inc eax
cmp eax, esi
jb 0x4054f0
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x3c], eax
lea esp, [esp]
xor ecx, ecx
cmp ecx, eax
jb 0x40551e
ja 0x40551c
cmp esi, edi
jbe 0x40551e
mov esi, edi
push 0
lea eax, [ebp - 0x28]
push eax
push esi
push ebx
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4055f2
cmp dword [ebp - 0x28], esi
jne 0x4055e3
mov eax, dword [ebp - 0x3c]
sub edi, esi
sbb eax, 0
mov dword [ebp - 0x3c], eax
test eax, eax
ja 0x405510
jb 0x405555
test edi, edi
jne 0x405510
test ebx, ebx
je 0x40559c
mov eax, dword [ebp - 0x1c]
sub eax, ebx
cmp eax, 0x1000
jb 0x405593
test bl, 0x1f
je 0x40556f
call fcn.0042054b
mov eax, dword [ebx - 4]
cmp eax, ebx
jb 0x40557b
call fcn.0042054b
sub ebx, eax
cmp ebx, 4
jae 0x405587
call fcn.0042054b
cmp ebx, 0x23
jbe 0x405591
call fcn.0042054b
mov ebx, eax
push ebx
call fcn.00419ee3
add esp, 4
mov ebx, dword [ebp - 0x38]
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x30]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4055d5
cmp dword [ebp - 0x30], esi
jne 0x4055be
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x2c], eax
je 0x4055d5
push 0x7b4
push str.....IORequestGeneratorIORequestGenerator.cpp
push str.li.QuadPart___LONGLONG_ullFileSize
call fcn.00421f70
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x40566e
push str.Improperly_written_data_during_file_creation_n
call fcn.00402770
add esp, 4
jmp 0x405606
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_while_writng_during_file_creation__error_code:__u__n
call fcn.00402770
add esp, 8
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x40566c
mov eax, dword [ebp - 0x1c]
sub eax, ebx
cmp eax, 0x1000
jb 0x40564d
test bl, 0x1f
je 0x405629
call fcn.0042054b
mov eax, dword [ebx - 4]
cmp eax, ebx
jb 0x405635
call fcn.0042054b
sub ebx, eax
cmp ebx, 4
jae 0x405641
call fcn.0042054b
cmp ebx, 0x23
jbe 0x40564b
call fcn.0042054b
mov ebx, eax
push ebx
call fcn.00419ee3
add esp, 4
jmp 0x40566c
push str.File_pointer_improperly_moved_during_file_creation_when_extending_file_n
call fcn.00402770
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00419ed2
mov esp, ebp
pop ebp
ret 0x14