Function at 0x4018f0
Capabilities:
Clear file content
Move file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 4
push 0x3000
push 0x21c
push 0
mov dword [ebp - 0x54], edx
mov edi, ecx
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
mov ebx, eax
push edi
mov dword [ebp - 0x5c], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x64], esi
cmp esi, 0xffffffff
je 0x401da9
push 2
push 0
push 0xffffffffffffffff
push 0xfffffde4
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 8]
push eax
push 0x21c
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x38281
push 0x93892918
push dword [ebx + 0x218]
push dword [ebx + 0x214]
push edi
push 3
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0x28
push eax
push str.FILE:__ws__Magic__I64u_checking_aginst__I64u_r_n
call fcn.004013b0
add esp, 0x24
cmp dword [ebx + 0x214], 0x93892918
jne 0x401e06
cmp dword [ebx + 0x218], 0x38281
jne 0x401e06
push 2
push 0
push 0xffffffffffffffff
push 0xfffffde4
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 0x100
push eax
mov eax, dword [ebp - 0x54]
push ebx
mov edx, dword [eax + 8]
mov ecx, dword [eax + 4]
call fcn.00403650
add esp, 8
test eax, eax
jne 0x401a4d
mov ecx, str.Error_decrypting_rsa
call fcn.004016d0
push edi
push 1
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push str.FILE:__ws__Error_decrypting_rsa_r_n
call fcn.004013b0
add esp, 0x14
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004048b1
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0xc]
mov dword [ebp - 0xc], 0x100
push ecx
lea eax, [ebx + 0x100]
push eax
mov eax, dword [ebp - 0x54]
mov edx, dword [eax + 8]
mov ecx, dword [eax + 4]
call fcn.00403650
add esp, 8
test eax, eax
jne 0x401a92
mov ecx, str.Error_decrypting_rsa
call fcn.004016d0
push edi
push 1
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push str.FILE:__ws__Error_decrypting_salsa_iv_r_n
jmp 0x401a1d
xorps xmm0, xmm0
lea ecx, [ebp - 0x50]
sub esp, 8
mov edx, ebx
movdqu xmmword [ebp - 0x50], xmm0
movdqu xmmword [ebp - 0x40], xmm0
movdqu xmmword [ebp - 0x30], xmm0
movdqu xmmword [ebp - 0x20], xmm0
call fcn.004037c0
mov eax, dword [ebx + 0x100]
add esp, 8
mov dword [ebp - 0x38], eax
mov eax, dword [ebx + 0x104]
mov dword [ebp - 0x34], eax
mov eax, dword [ebx + 0x210]
push 4
push 0x3000
inc eax
mov dword [ebp - 0x30], 0
push eax
push 0
mov dword [ebp - 0x2c], 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [ebx + 0x210]
push 4
push 0x3000
add ecx, 5
mov dword [ebp - 0x54], eax
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0
push 0
xorps xmm0, xmm0
mov dword [ebp - 0x58], eax
movlpd qword [ebp - 0x80], xmm0
push dword [ebp - 0x7c]
push dword [ebp - 0x80]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push dword [ebx + 0x20c]
xor eax, eax
xorps xmm0, xmm0
push dword [ebx + 0x208]
mov dword [ebp - 0x60], eax
push edi
push 2
push 1
push edi
movlpd qword [ebp - 0x70], xmm0
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0x14
push eax
push str.FILE:__ws__NUMBER_OF_BLOCKS_TO_DECRYPT:___I64u_r_n
call fcn.004013b0
mov ecx, dword [ebp - 0x6c]
add esp, 0x1c
mov edx, dword [ebp - 0x70]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x7c], 1
mov dword [ebp - 0x74], ecx
mov dword [ebp - 0x6c], edx
jmp 0x401b80
mov eax, dword [ebp - 0x5c]
cmp ecx, dword [eax + 0x20c]
jg 0x401d81
jl 0x401b9d
cmp edx, dword [eax + 0x208]
jae 0x401d81
push 0
lea ecx, [ebp - 8]
push ecx
push dword [eax + 0x210]
push dword [ebp - 0x54]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401d53
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x401d37
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x60]
cmp ecx, dword [eax + 0x210]
cmovb edx, dword [ebp - 0x7c]
add dword [eax + 0x200], ecx
lea ecx, [ebp - 0x50]
mov dword [ebp - 0x60], edx
adc dword [eax + 0x204], 0
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x54]
push eax
push dword [ebp - 0x58]
mov dword [ebp - 0x68], eax
call fcn.00403820
mov eax, dword [ebp - 0x68]
add esp, 8
neg eax
cdq
push 1
push 0
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x401c50
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00401740
mov ecx, str.SetFilePointerEx_failed
call fcn.004016d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push 2
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0xa
push eax
push str.FILE:__ws__SetFilePointerEx_failed:_0x_X_r_n
call fcn.004013b0
add esp, 0x18
push 0
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x68]
push dword [ebp - 0x58]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x401d18
jmp 0x401c70
push 0
call ebx
push 4
push 0x3000
push str.Write_file_error
mov esi, eax
call ebx
add eax, esi
lea eax, [eax*2 + 0x14]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
test esi, esi
je 0x401cce
push str.Write_file_error
call ebx
push str.Write_file_error
push 0x418064
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
xor edx, edx
mov ecx, esi
call fcn.00401640
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push 2
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0xa
push eax
push str.FILE:__ws__Write_file_error:_0x_X_r_n
call fcn.004013b0
add esp, 0x18
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [ebp - 0x64]
lea eax, [ebp - 0x10]
push 0
push eax
push dword [ebp - 0x68]
push dword [ebp - 0x58]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401c70
mov edx, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x74]
add edx, 1
mov eax, dword [ebp - 0x60]
adc ecx, 0
mov dword [ebp - 0x6c], edx
mov dword [ebp - 0x74], ecx
test eax, eax
je 0x401b80
jmp 0x401d81
push edi
push 1
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push str.FILE:__ws__END_DECRYPTING_r_n
call fcn.004013b0
add esp, 0x14
jmp 0x401d81
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push 2
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0xa
push eax
push str.FILE:__ws__FINISHING_DECRYPTING:__0x_X_r_n
call fcn.004013b0
add esp, 0x18
mov ecx, str.Finishing_crypting
call fcn.004016d0
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x8000
push 0
push dword [ebp - 0x54]
call ebx
push 0x8000
push 0
push dword [ebp - 0x58]
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x5c]
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push 0
call ebx
push 4
push 0x3000
lea eax, [eax*2 + 2]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
push edi
push esi
mov dword [ebp - 0x64], esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push esi
call ebx
lea ecx, [eax - 1]
cmp word [esi + ecx*2], 0x3a
lea ecx, [esi + ecx*2]
je 0x401e4d
cmp word [ecx], 0x2e
je 0x401e48
sub ecx, 2
cmp word [ecx], 0x3a
jne 0x401df5
jmp 0x401e4d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
push 1
push 1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push str.FILE:__ws__Magic_NOT_FOUND_r_n
call fcn.004013b0
add esp, 0x14
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004048b1
mov esp, ebp
pop ebp
ret
xor eax, eax
mov word [ecx], ax
push esi
push 1
push 1
push esi
call ebx
push eax
push str.DECRYPTING:_Restoring_original_file:__ws_r_n
call fcn.004013b0
add esp, 0x14
push 1
push esi
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push edi
push 3
push 1
push edi
call ebx
add eax, 0x14
push eax
push str.FILE:__ws__FINISHED_DECRYPTING_MoveFileExW_result:__d__last_error_0x_X_r_n
call fcn.004013b0
add esp, 0x1c
push 0x8000
push 0
push dword [ebp - 0x64]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004048b1
mov esp, ebp
pop ebp
ret