Function at 0x140004900
Capabilities:
Encode data using xor
Get common file path
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rax - 0x2d8]
sub rsp, 0x3b0
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rax, qword [0x14002b008]
xor rax, rsp
mov qword [rbp + 0x2a0], rax
mov r14, rcx
lea r12, [rcx + 0x20]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rdx, qword [r14]
mov qword [r14 + 8], rdx
xor r15d, r15d
mov ebx, r15d
mov r8, qword [r14 + 0x50]
mov rax, qword [r14 + 0x48]
cmp rax, r8
je 0x140004987
nop word [rax + rax]
lea ecx, [rbx + 1]
cmp byte [rax + 4], r15b
cmovne ecx, ebx
mov ebx, ecx
add rax, 0x88
cmp rax, r8
jne 0x140004970
mov dword [rsp + 0x40], ebx
lea r9, [rsp + 0x44]
lea r8, [rsp + 0x40]
mov rcx, r14
call fcn.140002bc0
test ebx, ebx
jne 0x1400049af
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140004d14
mov rdi, qword [r14 + 0x50]
mov rbx, qword [r14 + 0x48]
cmp rbx, rdi
je 0x140004a68
lea rsi, [rbx + 0x40]
cmp byte [rsi - 0x3c], r15b
jne 0x140004a51
mov byte [rsi - 0x3c], 1
mov eax, dword [rbx]
mov dword [rsp + 0x40], eax
lea r9, [rsp + 0x44]
lea r8, [rsp + 0x40]
mov rdx, qword [r14 + 8]
mov rcx, r14
call fcn.140002bc0
cmp qword [rsi - 0x20], 8
jb 0x1400049fb
mov rdx, qword [rsi - 0x38]
jmp 0x1400049ff
lea rdx, [rsi - 0x38]
mov rcx, r14
call fcn.140001040
cmp qword [rsi], 8
jb 0x140004a13
mov rdx, qword [rsi - 0x18]
jmp 0x140004a17
lea rdx, [rsi - 0x18]
mov rcx, r14
call fcn.140001040
cmp qword [rsi + 0x20], 8
jb 0x140004a2c
mov rdx, qword [rsi + 8]
jmp 0x140004a30
lea rdx, [rsi + 8]
mov rcx, r14
call fcn.140001040
cmp qword [rsi + 0x40], 8
jb 0x140004a45
mov rdx, qword [rsi + 0x28]
jmp 0x140004a49
lea rdx, [rsi + 0x28]
mov rcx, r14
call fcn.140001040
add rbx, 0x88
add rsi, 0x88
cmp rbx, rdi
jne 0x1400049c4
lea rdx, [rbp + 0x190]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
mov dword [rsp + 0x40], 0x414a4b
lea r9, [rbp + 0x80]
xor r8d, r8d
lea rdx, [rsp + 0x40]
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 6
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
lea rcx, [rbp + 0x80]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rbx, rax
mov qword [rsp + 0x40], rax
inc rax
test rax, 0xfffffffffffffffe
jne 0x140004aec
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140004d01
mov eax, r15d
mov dword [rbp + 0x70], eax
nop dword [rax]
nop word [rax + rax]
mov ecx, eax
movzx eax, byte [rbp + 0x70]
mov byte [rsp + rcx + 0x70], al
mov eax, dword [rbp + 0x70]
inc eax
mov dword [rbp + 0x70], eax
cmp eax, 0x100
jb 0x140004b00
mov edx, r15d
mov dword [rbp + 0x74], edx
mov eax, r15d
mov dword [rbp + 0x70], eax
lea r9, [0x1400263f0]
nop dword [rax]
lea r8, [rsp + 0x70]
add r8, rax
and eax, 0xf
movzx eax, byte [rax + r9]
movzx ecx, byte [r8]
add eax, edx
add ecx, eax
movzx eax, cl
mov dword [rbp + 0x74], eax
movzx edx, byte [r8]
mov ecx, eax
movzx eax, byte [rsp + rax + 0x70]
mov byte [r8], al
mov byte [rsp + rcx + 0x70], dl
mov eax, dword [rbp + 0x70]
inc eax
mov dword [rbp + 0x70], eax
cmp eax, 0x100
jae 0x140004b74
mov edx, dword [rbp + 0x74]
jmp 0x140004b30
mov r8d, r15d
mov qword [rbp + 0x70], r15
mov r9d, r15d
mov r10, qword [r14]
mov rax, qword [r14 + 8]
sub rax, r10
test eax, eax
je 0x140004bec
mov r11d, eax
nop
lea eax, [r9 + 1]
movzx ecx, al
mov dword [rbp + 0x70], ecx
lea r9, [rsp + 0x70]
add r9, rcx
movzx eax, byte [r9]
add eax, r8d
movzx ecx, al
mov dword [rbp + 0x74], ecx
movzx r8d, byte [r9]
movzx eax, byte [rsp + rcx + 0x70]
mov byte [r9], al
mov byte [rsp + rcx + 0x70], r8b
mov r8d, dword [rbp + 0x74]
movzx edx, byte [rsp + r8 + 0x70]
mov r9d, dword [rbp + 0x70]
movzx ecx, byte [rsp + r9 + 0x70]
add rdx, rcx
movzx eax, dl
movzx ecx, byte [rsp + rax + 0x70]
xor byte [r10], cl
lea r10, [r10 + 1]
sub r11, 1
jne 0x140004b90
mov rdx, qword [r14]
mov r8, qword [r14 + 8]
sub r8, rdx
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x48]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, eax
mov rcx, qword [r14]
mov r8, qword [r14 + 8]
sub r8, rcx
xor edx, edx
call fcn.14000c6c0
mov rcx, qword [r14]
mov qword [r14 + 8], rcx
test edi, edi
je 0x140004cf7
mov dword [rsp + 0x50], 0x4e0de872
lea rax, [rbp + 0x80]
or rsi, 0xffffffffffffffff
nop
inc rsi
cmp byte [rax + rsi], 0
jne 0x140004c40
inc esi
mov dword [rsp + 0x54], esi
mov ecx, esi
call fcn.140009a4c
mov r14, rax
mov qword [rsp + 0x58], rax
lea r8, [rbp + 0x80]
mov edx, esi
mov rcx, rax
call fcn.14000dab0
test esi, esi
je 0x140004ced
cmp esi, 0x20
jb 0x140004cc8
mov ecx, esi
and ecx, 0x1f
mov edx, esi
sub edx, ecx
movdqa xmm2, xmmword [0x140026ac0]
nop dword [rax]
mov eax, r15d
movdqu xmm0, xmmword [rax + r14]
movdqa xmm1, xmm2
pxor xmm1, xmm0
movdqu xmmword [rax + r14], xmm1
lea eax, [r15 + 0x10]
movdqu xmm0, xmmword [rax + r14]
movdqa xmm1, xmm2
pxor xmm1, xmm0
movdqu xmmword [rax + r14], xmm1
add r15d, 0x20
cmp r15d, edx
jb 0x140004c90
cmp r15d, esi
jae 0x140004ced
mov eax, r15d
add rax, r14
sub esi, r15d
mov ecx, esi
nop dword [rax + rax]
xor byte [rax], 0xcf
lea rax, [rax + 1]
sub rcx, 1
jne 0x140004ce0
lea rdx, [rsp + 0x50]
call fcn.140003570
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140004d14
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x2a0]
xor rcx, rsp
call fcn.140009740
lea r11, [rsp + 0x3b0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret