Function at 0x59c08
Capabilities:
Set registry value

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xd8
lea rbx, [rcx + 0x18]
mov rbp, rcx
lea rcx, [rsp + 0x78]
mov rsi, qword [rbx]
mov r8d, 0x20
mov r12, rdx
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], rbx
call fcn.0003aae0
xor dil, dil
xor r15b, r15b
xor r13d, r13d
mov r11, rbp
mov qword [rsp + 0x130], rbp
lea r14d, [r13 + 1]
mov rax, qword [rbx]
cmp qword [r11 + 0x18], rax
jne 0x59d5e
mov edx, dword [r11]
lea r9, [rsp + 0x50]
xor r8d, r8d
mov rcx, rsi
call fcn.0005755c
test eax, eax
mov ebx, eax
js 0x59ff4
mov rax, qword [rsp + 0x130]
add r13d, dword [rsp + 0x60]
mov rbx, qword [rax + 0x10]
test byte [rbx + 4], 2
jne 0x59d4b
test dil, dil
jne 0x59d4b
mov rax, qword [rsp + 0x50]
lea r9, [rsp + 0x128]
mov r8d, 0xf003f
mov edx, r14d
mov rcx, rsi
mov qword [rsp + 0x138], rax
call qword [sym.imp.ntoskrnl.exe_IoOpenDeviceRegistryKey]
test eax, eax
js 0x59d48
lea r9, [rsp + 0x128]
lea r8, [rsp + 0x120]
lea rcx, str.Affinity_Policy___Temporal
mov edx, r14d
call fcn.0005a194
test eax, eax
js 0x59d48
lea rdx, str.TargetSet
lea rcx, [rsp + 0x68]
call qword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
mov rcx, qword [rsp + 0x120]
lea rax, [rsp + 0x138]
lea rdx, [rsp + 0x68]
mov r9d, 3
xor r8d, r8d
mov dword [rsp + 0x28], 8
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntoskrnl.exe_ZwSetValueKey]
mov rcx, qword [rsp + 0x120]
call qword [sym.imp.ntoskrnl.exe_ZwClose]
mov dil, r14b
cmp r13d, dword [rsp + 0x60]
jbe 0x59d5e
cmp dword [rbx + 8], 3
movzx r15d, r15b
cmove r15d, r14d
lea rdx, [rsp + 0x130]
lea rcx, [rsp + 0x78]
mov r8b, r14b
call qword [sym.imp.ntoskrnl.exe_RtlGetNextRange]
cmp eax, 0x8000001a
mov ebx, eax
je 0x59d8f
mov r11, qword [rsp + 0x130]
mov rbx, qword [rsp + 0x48]
jmp 0x59c5b
test r13d, r13d
je 0x59ff4
lea r14d, [r13 + r13*2 - 3]
mov ecx, 1
mov r8d, 0x49706341
shl r14d, 4
add r14d, 0x38
mov edx, r14d
call qword [sym.imp.ntoskrnl.exe_ExAllocatePoolWithTag]
test rax, rax
mov rsi, rax
jne 0x59dcb
mov eax, 0xc000009a
jmp 0x59ff6
lea rcx, [rsp + 0x78]
mov rdx, r12
mov r8d, 0x20
mov dword [rax], r13d
call fcn.0003aae0
mov al, r15b
neg al
mov qword [rsp + 0x130], rbp
sbb edi, edi
and edi, r13d
mov rax, qword [rsp + 0x48]
mov rax, qword [rax]
cmp qword [rbp + 0x18], rax
jne 0x59f87
mov edx, dword [rbp]
mov rcx, qword [rsp + 0x40]
mov r12, qword [rbp + 0x10]
lea r9, [rsp + 0x50]
xor r8d, r8d
call fcn.0005755c
test eax, eax
mov ebx, eax
js 0x59fe9
test r15b, r15b
mov ebp, dword [rsp + 0x60]
je 0x59e33
sub edi, ebp
mov eax, dword [r12 + 8]
test eax, eax
jle 0x59fb6
cmp eax, 2
jle 0x59f32
cmp eax, 3
jne 0x59fb6
and dword [rsp + 0x120], 0
test ebp, ebp
movsxd rax, edi
je 0x59f7a
mov ebx, dword [rsp + 0x5c]
lea rax, [rax + rax*2]
add rax, rax
mov dword [rsp + 0x128], ebx
lea rax, [rsi + rax*8 + 0x10]
mov qword [rsp + 0x138], rax
mov rcx, qword [r12 + 0x10]
lea r9, [rsp + 0x98]
xor r8d, r8d
mov edx, ebx
call fcn.000574f4
test eax, eax
mov ebx, eax
js 0x59fe9
mov rcx, qword [rsp + 0x138]
lea rdx, [rsp + 0xa0]
mov r8d, 0x30
add rcx, 0xfffffffffffffff8
call fcn.0003aae0
mov ebx, dword [rsp + 0x128]
mov rax, qword [rsp + 0x138]
mov ecx, ebx
mov dword [rax - 4], ebx
call qword [sym.imp.HAL.dll_HalConvertDeviceIdtToIrql]
mov rcx, qword [rsp + 0x138]
add ebx, 1
mov byte [rcx], al
mov eax, dword [r12 + 0x34]
add rcx, 0x30
mov dword [rcx - 0x2c], eax
mov eax, dword [r12 + 0x30]
mov dword [rsp + 0x128], ebx
mov dword [rcx - 0x28], eax
mov rax, qword [r12 + 0x10]
mov qword [rsp + 0x138], rcx
mov qword [rcx - 0x20], rax
mov eax, dword [rsp + 0x120]
add eax, 1
cmp eax, ebp
mov dword [rsp + 0x120], eax
jb 0x59e84
jmp 0x59f7a
mov ecx, dword [rsp + 0x5c]
lea rbx, [rdi + rdi*2]
add rbx, rbx
and dword [rsi + rbx*8 + 8], 0
mov dword [rsi + rbx*8 + 0xc], ecx
call qword [sym.imp.HAL.dll_HalConvertDeviceIdtToIrql]
mov byte [rsi + rbx*8 + 0x10], al
mov eax, dword [r12 + 0x34]
mov dword [rsi + rbx*8 + 0x14], eax
mov eax, dword [r12 + 0x30]
mov dword [rsi + rbx*8 + 0x18], eax
mov rax, qword [r12 + 0x10]
mov qword [rsi + rbx*8 + 0x20], rax
mov rax, qword [rsp + 0x130]
mov ecx, dword [rax]
mov dword [rsi + rbx*8 + 0x28], ecx
test r15b, r15b
jne 0x59f81
add edi, ebp
and dword [r12 + 4], 0xfffffffe
lea rdx, [rsp + 0x130]
lea rcx, [rsp + 0x78]
mov r8b, 1
call qword [sym.imp.ntoskrnl.exe_RtlGetNextRange]
cmp eax, 0x8000001a
je 0x59fbd
cmp edi, r13d
jae 0x59fbd
mov rbp, qword [rsp + 0x130]
jmp 0x59df3
mov eax, 0xc000000d
jmp 0x59ff6
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x30], rsi
lea rdx, [0x0003f0e0]
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], 0x1003
call qword [sym.imp.ntoskrnl.exe_IoSetDevicePropertyData]
mov ebx, eax
xor edx, edx
mov rcx, rsi
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, ebx
add rsp, 0xd8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret