Function at 0x402060
Capabilities:
Clear file content
Get file size
Move file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x29f0
call fcn.00406b20
mov eax, dword [0x420040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x834]
push esi
push 0x830
xor esi, esi
mov dword [ebp - 0x29dc], ebx
push esi
push eax
call fcn.00407b00
add esp, 0xc
cmp word [ebx], si
je 0x4020b8
movzx eax, word [ebx]
xor ecx, ecx
inc esi
mov word [ebp + ecx - 0x834], ax
lea ecx, [esi + esi]
movzx eax, word [ecx + ebx]
test ax, ax
jne 0x4020a3
call fcn.00402ce0
cmp word [ebp + esi*2 - 0x834], 0x2e
mov dword [ebp - 0x29e4], eax
je 0x4020dc
nop
dec esi
cmp word [ebp + esi*2 - 0x834], 0x2e
jne 0x4020d0
add esi, esi
cmp esi, 0x830
jae 0x40264b
xor eax, eax
mov word [ebp + esi - 0x834], ax
lea eax, [ebp - 0x834]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x40212d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.____MoveFileW__ws__error__code:__d_n
call fcn.00405140
add esp, 0xc
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406952
mov esp, ebp
pop ebp
ret
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x834]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x29f0], ebx
cmp ebx, 0xffffffff
jne 0x402186
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x834]
push eax
push str.____CreateFileW__ws__error__code:__d_n
call fcn.00405140
add esp, 0xc
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406952
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x840]
mov dword [ebp - 0x840], 0
push eax
push ebx
mov dword [ebp - 0x83c], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4021d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x834]
push eax
push str.____GetFileSizeEx__ws__error__code__d_n
call fcn.00405140
add esp, 0xc
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406952
mov esp, ebp
pop ebp
ret
add dword [ebp - 0x840], 0xffffff00
push edi
adc dword [ebp - 0x83c], 0xffffffff
push 0xa00000
call fcn.0040b238
mov esi, dword [ebp - 0x840]
add esp, 4
mov edi, eax
mov eax, dword [ebp - 0x83c]
mov dword [ebp - 0x29e0], eax
push 0
push 0
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402322
push 0
lea eax, [ebp - 0x838]
push eax
push pe_nt_image_headers32
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402253
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x834]
push eax
push str.____ReadFile__ws__error__code__d_n
jmp 0x4025d1
lea eax, [ebp - 0x838]
push eax
mov eax, dword [ebp - 0x29e4]
add eax, 0x20
push edi
push eax
call fcn.00405f40
add esp, 0xc
test eax, eax
jne 0x40227f
mov esi, dword [ebp - 0x29dc]
push esi
push str.____Error_unlocking_file:__ws_n
jmp 0x4022ad
push dword [ebp - 0x838]
lea eax, [ebp - 0x950]
push edi
push eax
call fcn.00407580
add esp, 0xc
cmp dword [ebp - 0x8fc], 0xaabbccdd
je 0x40230a
mov esi, dword [ebp - 0x29dc]
push esi
push str.____Error_unlocking_file__control_flag_error_:__ws_n
call fcn.00405140
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040b233
add esp, 4
lea eax, [ebp - 0x834]
push esi
push eax
mov eax, dword [sym.imp.KERNEL32.dll_MoveFileW]
call eax
test eax, eax
jne 0x4025e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x834]
push eax
push str.____MoveFileW__ws__error__code:__d_n
call fcn.00405140
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406952
mov esp, ebp
pop ebp
ret
push 0
push 0
push dword [ebp - 0x29e0]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push ebx
call esi
test eax, eax
jne 0x40233a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x834]
push eax
push str.____SetFilePointerEx__ws__error__code__d_n
jmp 0x4025d1
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x402359
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____SetEndOfFile_error_code__d_n
call fcn.00405140
add esp, 8
push 0
push 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x29ec], xmm0
push dword [ebp - 0x29e8]
push dword [ebp - 0x29ec]
push ebx
call esi
push dword [ebp - 0x83c]
mov eax, dword [ebp - 0x900]
push dword [ebp - 0x840]
cdq
push edx
push eax
mov dword [ebp - 0x838], pe_nt_image_headers32
call fcn.00406a20
push 0
push 0x64
push edx
push eax
call fcn.00406970
push 0
mov esi, eax
mov eax, edx
push 0x40
push eax
push esi
mov dword [ebp - 0x29d8], eax
call fcn.00406a60
mov ecx, eax
or ecx, edx
je 0x4023e1
mov ecx, 0x40
sub ecx, eax
mov eax, 0
sbb eax, edx
add esi, ecx
mov ecx, dword [ebp - 0x29d8]
adc ecx, eax
mov dword [ebp - 0x29d8], ecx
jmp 0x4023e7
mov ecx, dword [ebp - 0x29d8]
test ecx, ecx
jg 0x402422
jl 0x4023f5
cmp esi, 0x500000
jae 0x402422
mov eax, dword [ebp - 0x83c]
xor ecx, ecx
mov dword [ebp - 0x29d8], ecx
mov esi, 0x500000
test eax, eax
jg 0x402422
mov edx, dword [ebp - 0x840]
jl 0x402418
cmp edx, esi
jae 0x402422
mov ecx, eax
mov esi, edx
mov dword [ebp - 0x29d8], ecx
push 0
push 0xa00000
push ecx
push esi
call fcn.00406970
mov dword [ebp - 0x29e4], eax
imul eax, eax, 0xa00000
cdq
sub esi, eax
mov eax, esi
mov dword [ebp - 0x29dc], esi
sbb dword [ebp - 0x29d8], edx
sub eax, dword [ebp - 0x910]
mov dword [ebp - 0x29e8], eax
lea eax, [ebp - 0x930]
push eax
lea eax, [ebp - 0x950]
push eax
lea eax, [ebp - 0x29d4]
push eax
call fcn.00403dd0
add esp, 0xc
mov dword [ebp - 0x29e0], 0
cmp dword [ebp - 0x29e4], 0
jle 0x40251d
nop dword [eax]
push 0
lea eax, [ebp - 0x838]
push eax
push 0xa00000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40253b
xor esi, esi
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29d4]
push eax
call fcn.00402d00
add esi, 0x40
add esp, 8
cmp esi, 0xa00000
jl 0x4024b0
push 1
push 0
push 0xffffffffffffffff
push 0xff600000
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x838]
push eax
push 0xa00000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4025bd
mov eax, dword [ebp - 0x29e0]
inc eax
mov dword [ebp - 0x29e0], eax
cmp eax, dword [ebp - 0x29e4]
jl 0x402490
mov esi, dword [ebp - 0x29dc]
test esi, esi
je 0x4025fc
push 0
lea eax, [ebp - 0x838]
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402554
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push eax
lea eax, [ebp - 0x834]
push eax
push str.____ReadFile__ws__error__code__d_n
jmp 0x4025d1
mov eax, dword [ebp - 0x29dc]
xor esi, esi
test eax, eax
jle 0x402588
mov ebx, eax
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29d4]
push eax
call fcn.00402d00
add esi, 0x40
add esp, 8
cmp esi, ebx
jl 0x402562
mov ebx, dword [ebp - 0x29f0]
mov eax, dword [ebp - 0x29dc]
mov ecx, dword [ebp - 0x29d8]
neg eax
push 1
adc ecx, 0
push 0
neg ecx
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x838]
push eax
push dword [ebp - 0x29e8]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4025fc
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push eax
lea eax, [ebp - 0x834]
push eax
push str.____WriteFile__ws__error__code__d_n
call fcn.00405140
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040b233
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406952
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x910]
or eax, dword [ebp - 0x90c]
je 0x40262a
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x40262a
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push eax
push str.____SetEndOfFile_error_code__d_n
call fcn.00405140
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.0040b233
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00406952
mov esp, ebp
pop ebp
ret
call fcn.00406876
int3