Function at 0x18001f8e0
Capabilities:
Get thread local storage value
Hash data using sha512
Read file on windows
Set thread local storage value

Disassembly:
push rbx
push rbp
push rdi
push r12
push r13
sub rsp, 0x80
mov rbx, rdx
mov r12, rcx
mov ebp, 4
mov edx, 0x10110
xor ecx, ecx
mov r8d, 0x3000
mov r9d, ebp
mov dword [rsp + 0x48], 0x10110
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov qword [rsp + 0x40], rax
test rax, rax
je 0x18001fca6
mov ecx, dword [0x18002dbb0]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
xor r13d, r13d
mov rdi, rax
test rax, rax
jne 0x18001f97c
mov qword [rsp + 0x30], r13
lea rcx, str..dcrypt
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x28], r13d
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x18001f9bf
mov ecx, dword [0x18002dbb0]
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov qword [rsp + 0x38], r13
lea rax, [rsp + 0xc8]
lea r8, [rsp + 0x40]
mov qword [rsp + 0x30], rax
mov r9d, 0xc
mov edx, 0x2201f0
mov rcx, rdi
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x18001f9cf
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x18001f9cf
mov rcx, qword [rsp + 0x40]
mov edx, 0x10110
call qword [sym.imp.KERNEL32.dll_VirtualLock]
mov rdi, qword [rsp + 0x40]
test rdi, rdi
je 0x18001fca6
xor r9d, r9d
mov qword [rsp + 0x30], r13
mov edx, 0x80000000
lea r8d, [r9 + 1]
mov rcx, rbx
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0xb0], rsi
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x18001fa1d
lea esi, [rax + 0xe]
jmp 0x18001fb94
movabs rax, 0x6a09e667f3bcc908
lea r9, [rsp + 0xc0]
lea rdx, [rdi + 0xd0]
mov qword [rdi], rax
movabs rax, 0xbb67ae8584caa73b
mov r8d, 0x10000
mov qword [rdi + 8], rax
movabs rax, 0x3c6ef372fe94f82b
mov rcx, rbx
mov qword [rdi + 0x10], rax
movabs rax, 0xa54ff53a5f1d36f1
mov dword [rdi + 0x48], r13d
mov qword [rdi + 0x18], rax
movabs rax, 0x510e527fade682d1
mov qword [rdi + 0x40], r13
mov qword [rdi + 0x20], rax
movabs rax, 0x9b05688c2b3e6c1f
mov qword [rsp + 0x20], r13
mov qword [rdi + 0x28], rax
movabs rax, 0x1f83d9abfb41bd6b
mov qword [rdi + 0x30], rax
movabs rax, 0x5be0cd19137e2179
mov qword [rdi + 0x38], rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18001fb04
nop dword [rax + rax]
mov eax, dword [rsp + 0xc0]
test eax, eax
je 0x18001fb04
lea rdx, [rdi + 0xd0]
mov r8d, eax
mov rcx, rdi
call fcn.1800163a0
lea r9, [rsp + 0xc0]
lea rdx, [rdi + 0xd0]
mov r8d, 0x10000
mov rcx, rbx
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18001fac0
lea rdx, [rdi + 0x100d0]
mov rcx, rdi
call fcn.1800162c0
movsxd rdx, dword [r12]
mov eax, 0x100
sub eax, edx
lea rcx, [rdx + r12 + 4]
xor edx, edx
movsxd r8, eax
call sub.msvcrt.dll_memset
mov rcx, rdi
lea rdx, [r12 + 4]
sub rcx, r12
nop dword [rax + rax]
mov eax, dword [rcx + rdx + 0x100cc]
add rdx, 0x10
add dword [rdx - 0x10], eax
mov eax, dword [rcx + rdx + 0x100c0]
add dword [rdx - 0xc], eax
mov eax, dword [rcx + rdx + 0x100c4]
add dword [rdx - 8], eax
mov eax, dword [rcx + rdx + 0x100c8]
add dword [rdx - 4], eax
dec rbp
jne 0x18001fb40
mov eax, dword [r12]
mov ecx, 0x40
mov esi, r13d
cmp eax, ecx
cmovg ecx, eax
mov dword [r12], ecx
test rbx, rbx
je 0x18001fb94
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x18002dbb0]
mov qword [rsp + 0x40], rdi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test rax, rax
jne 0x18001fbec
mov qword [rsp + 0x30], r13
lea rcx, str..dcrypt
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x28], r13d
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x18001fc2f
mov ecx, dword [0x18002dbb0]
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov qword [rsp + 0x38], r13
lea rax, [rsp + 0xc8]
lea r8, [rsp + 0x40]
mov qword [rsp + 0x30], rax
mov r9d, 8
mov edx, 0x2201f4
mov rcx, rdi
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x18001fc7a
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x18001fc7a
mov rcx, qword [rsp + 0x40]
lea rdx, [rsp + 0x50]
mov r8d, 0x30
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
cmp rax, 0x30
jne 0x18001fc7a
mov rcx, qword [rsp + 0x40]
cmp qword [rsp + 0x50], rcx
jne 0x18001fc7f
cmp qword [rsp + 0x58], rcx
jne 0x18001fc7f
mov rdi, rcx
mov rcx, qword [rsp + 0x68]
xor eax, eax
rep stosb byte [rdi], al
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_VirtualUnlock]
mov rcx, qword [rsp + 0x40]
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, esi
mov rsi, qword [rsp + 0xb0]
add rsp, 0x80
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret
mov eax, 9
add rsp, 0x80
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret