Function at 0x85bd20
Capabilities:
Allocate thread local storage
Encode data using xor
Get file size

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
mov rbx, rcx
mov rcx, rdx
lea rdx, [rsp + 0x40]
mov rsi, r8
call sym.utf8_to_utf16.constprop.0
mov r12d, eax
test eax, eax
je 0x85bd60
mov eax, r12d
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov rcx, qword [rsp + 0x40]
xor r9d, r9d
mov r8d, 3
mov edx, 0xc0000000
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rcx, qword [rsp + 0x40]
mov qword [rbx + 8], rax
call sym.free
mov rcx, qword [rbx + 8]
cmp rcx, 0xffffffffffffffff
je 0x85bfc0
test byte [rbx + 0x1a], 0x20
jne 0x85bdfd
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [rbx + 0xa8], eax
cmp eax, 0xffffffff
je 0x85bff8
movsxd rax, dword [0x00a2f600]
or dword [rbx + 0x18], 0x10000000
cmp eax, 0x3f
jg 0x85c291
mov ecx, dword [rbx + 0xa8]
lea edx, [rax + 1]
mov dword [0x00a2f600], edx
lea rdx, [0x00a2f620]
mov dword [rdx + rax*4], ecx
mov rcx, qword [rbx + 8]
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], 0
mov r9d, 1
call qword [sym.imp.KERNEL32.dll_LockFile]
test eax, eax
je 0x85bf60
mov dword [rsi], 1
mov rcx, qword [rbx + 8]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [rbx + 0x24]
mov rcx, qword [rbx + 8]
mov ebp, eax
lea edi, [rdx - 1]
mov rax, rbp
add rdi, 3
shl rdi, 6
cmp rbp, rdi
jl 0x85bf18
sub rax, 0xc0
shr rax, 6
add eax, 1
mov dword [rbx + 0x24], eax
mov qword [rsp + 0x28], 0
xor r9d, r9d
mov r8d, 4
xor edx, edx
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov r13, rax
test rax, rax
je 0x85bfe8
xor r9d, r9d
xor r8d, r8d
mov edx, 2
mov rcx, rax
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], rbp
call qword [sym.imp.KERNEL32.dll_MapViewOfFileEx]
mov rcx, r13
mov qword [rbx + 0x48], rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rbx + 0x48]
test rax, rax
je 0x85bfe8
mov edx, dword [rsi]
test edx, edx
jle 0x85c218
mov eax, dword [0x00a2f720]
test eax, eax
je 0x85c1a0
lea rsi, [rsp + 0x60]
mov rcx, qword [rbx + 8]
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x85c010
nop dword [rax + rax]
call rbp
mov r12d, eax
jmp 0x85bd49
mov r8d, dword [rsi]
test r8d, r8d
jle 0x85be50
xor r9d, r9d
xor r8d, r8d
mov edx, edi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jne 0x85bf08
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x85bf08
mov rcx, qword [rbx + 8]
mov rbp, rdi
jmp 0x85be60
lea rax, [rsp + 0x60]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rbx + 8]
mov qword [rsp + 0x60], 0
mov r9d, 1
mov qword [rsp + 0x68], 0
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_LockFileEx]
test eax, eax
je 0x85c200
mov dword [rsi], 0
jmp 0x85be24
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
call rbp
cmp eax, 0x13
jne 0x85bf08
test byte [rbx + 0x1a], 2
je 0x85bf08
jmp 0x85bd49
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x85bf08
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x85bdc9
mov r12d, eax
jmp 0x85bd49
mov eax, dword [rsp + 0x7c]
lea r8, [rsp + 0x54]
movabs rdx, 0xcbf29ce484222325
mov dword [rsp + 0x54], eax
mov rax, qword [rsp + 0x8c]
mov qword [rsp + 0x58], rax
nop dword [rax]
movzx eax, byte [r8]
add r8, 1
xor rax, rdx
mov rdx, rax
mov r9, rax
mov rcx, rax
shl rdx, 4
shl r9, 5
lea rdx, [rdx + rax*2]
shl rcx, 0x28
add rdx, rax
add rdx, r9
mov r9, rax
shl rax, 8
shl r9, 7
add rdx, r9
add rax, rdx
lea rdx, [rcx + rax]
cmp r8, rsi
jne 0x85c038
lea rsi, [rsp + 0x49]
mov r9d, edx
lea rdi, [rsp + 0x4e]
mov r11d, 0xc0c0c0c1
mov rcx, rsi
lea r8, str.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_____________
mov eax, r9d
add rcx, 1
imul rax, r11
shr rax, 0x26
imul r10d, eax, 0x55
sub r9d, r10d
movzx r9d, byte [r8 + r9]
mov byte [rcx - 1], r9b
mov r9d, eax
cmp rcx, rdi
jne 0x85c099
shr rdx, 0x20
lea r11, [rsp + 0x53]
mov r10d, 0xc0c0c0c1
mov rax, rdx
mov rdx, rcx
mov ecx, eax
add rdx, 1
imul rcx, r10
shr rcx, 0x26
imul r9d, ecx, 0x55
sub eax, r9d
movzx eax, byte [r8 + rax]
mov byte [rdx - 1], al
mov eax, ecx
cmp rdx, r11
jne 0x85c0d5
mov rax, qword [rbx + 0x48]
mov r8, rsi
mov byte [rsp + 0x53], 0
lea rdx, str.GlobalMDBr_s
lea rcx, [rax + 0x14]
call sym.sprintf
mov rax, qword [rbx + 0x48]
mov r8, rsi
lea rdx, str.GlobalMDBw_s
lea rcx, [rax + 0x40]
call sym.sprintf
mov r8, qword [rbx + 0x48]
xor edx, edx
mov rsi, qword [sym.imp.KERNEL32.dll_CreateMutexA]
lea rcx, [0x00a2f730]
add r8, 0x14
call rsi
mov qword [rbx + 0xf0], rax
test rax, rax
je 0x85bfe8
mov r8, qword [rbx + 0x48]
xor edx, edx
lea rcx, [0x00a2f730]
add r8, 0x40
call rsi
mov qword [rbx + 0xf8], rax
test rax, rax
je 0x85bfe8
movabs rdi, 0x1beefc0de
mov rax, qword [rbx + 0x48]
mov qword [rax + 8], 0
mov qword [rax], rdi
mov dword [rax + 0x10], 0
jmp 0x85bd49
mov edx, 1
lea rcx, [0x00a2f760]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
xor r9d, r9d
xor r8d, r8d
mov edx, 1
lea rcx, [0x00a2f760]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
lea rax, [0x00a2f760]
mov dword [0x00a2f730], 0x18
mov dword [0x00a2f740], 0
mov qword [0x00a2f738], rax
mov dword [0x00a2f720], 1
jmp 0x85bee2
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x85c006
jmp 0x85be24
cmp dword [rax], 0xbeefc0de
jne 0x85c2a7
cmp dword [rax + 4], 1
jne 0x85c29c
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
call rbp
lea edx, [rax - 0xb]
and edx, 0xfffffffd
je 0x85c243
test eax, eax
jne 0x85c006
mov r8, qword [rbx + 0x48]
mov rsi, qword [sym.imp.KERNEL32.dll_OpenMutexA]
xor edx, edx
mov ecx, 0x100000
add r8, 0x14
call rsi
mov qword [rbx + 0xf0], rax
test rax, rax
je 0x85bf08
mov r8, qword [rbx + 0x48]
xor edx, edx
mov ecx, 0x100000
add r8, 0x40
call rsi
mov qword [rbx + 0xf8], rax
test rax, rax
jne 0x85bd49
jmp 0x85bf08
mov r12d, 0xffff87bb
jmp 0x85bd49
mov r12d, 0xffff87b6
jmp 0x85bd49
mov r12d, 0xffff87b7
jmp 0x85bd49