Function at 0x140010850
Capabilities:
Encrypt data using rc4 via systemfunction033

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0xf0
mov rbx, rdx
lea rsi, str.1.2.840.113556.1.4.90
mov r14, rcx
xor edi, edi
mov rdx, qword [rsi]
lea r8, [rbp - 0x71]
lea r8, [r8 + rdi*4]
xor r9d, r9d
mov rcx, r14
call fcn.140010c0c
test eax, eax
je 0x140010aa2
inc edi
add rsi, 8
cmp edi, 8
jb 0x14001087b
test rbx, rbx
je 0x140010a92
cmp qword [rbx + 0x20], 0
mov rax, qword [rbx]
mov qword [rsp + 0x30], rax
je 0x140010a86
xor r15d, r15d
cmp dword [rbx + 0x18], r15d
jbe 0x140010a86
mov rax, qword [rbx + 0x20]
lea r14, [r15 + r15*2]
xor edx, edx
lea rcx, [rbp - 0x71]
mov r8d, dword [rax + r14*8]
cmp dword [rcx], r8d
je 0x1400108f4
inc edx
add rcx, 4
cmp edx, 8
jb 0x1400108df
jmp 0x140010a74
cmp qword [rax + r14*8 + 0x10], 0
je 0x140010a74
xor r12d, r12d
cmp dword [rax + r14*8 + 8], r12d
jbe 0x140010a74
mov rsi, qword [rax + r14*8 + 0x10]
mov edi, r12d
add rdi, rdi
mov r13, qword [rsi + rdi*8 + 8]
mov qword [rbp + 0x77], r13
test r13, r13
je 0x140010a62
cmp qword [0x140145c80], 0
lea rax, [rbp + 0xf]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x38], 0x10
mov dword [rsp + 0x3c], 0x10
je 0x140010a99
cmp dword [0x140145c78], 0
je 0x140010a99
cmp dword [rsi + rdi*8], 0x14
jb 0x140010a99
lea rcx, [rbp - 0x49]
call qword [sym.imp.cryptdll.dll_MD5Init]
mov r8d, dword [0x140145c78]
lea rcx, [rbp - 0x49]
mov rdx, qword [0x140145c80]
call qword [sym.imp.cryptdll.dll_MD5Update]
mov r8d, 0x10
lea rcx, [rbp - 0x49]
mov rdx, r13
call qword [sym.imp.cryptdll.dll_MD5Update]
lea rcx, [rbp - 0x49]
call qword [sym.imp.cryptdll.dll_MD5Final]
mov eax, dword [rsi + rdi*8]
lea rdx, [rsp + 0x38]
sub eax, 0x10
lea rcx, [rsp + 0x48]
mov dword [rbp - 0x7d], eax
mov dword [rsp + 0x48], eax
lea rax, [r13 + 0x10]
mov qword [rbp + 0x7f], rax
mov qword [rbp - 0x79], rax
call qword [sym.imp.ADVAPI32.dll_SystemFunction033]
test eax, eax
js 0x140010a99
mov r13d, dword [rsi + rdi*8]
lea r9, [rbp + 0x6f]
mov rax, qword [rbp + 0x77]
sub r13d, 0x14
add rax, 0x14
mov dword [rsp + 0x20], 4
mov r8d, r13d
mov qword [rbp + 0x77], rax
mov rdx, rax
mov ecx, 0x8000
call fcn.1400036a8
test eax, eax
je 0x140010a99
mov rax, qword [rbp + 0x7f]
mov eax, dword [rax]
cmp dword [rbp + 0x6f], eax
jne 0x140010a99
mov rax, qword [rsi + rdi*8 + 8]
mov ecx, 0x40
mov edx, r13d
mov qword [rbp + 0x7f], rax
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsi + rdi*8 + 8], rax
test rax, rax
je 0x140010aae
mov rdx, qword [rbp + 0x77]
mov rcx, rax
mov r8d, r13d
call fcn.1400e84c0
mov rax, qword [rbp + 0x7f]
mov dword [rsi + rdi*8], r13d
test rax, rax
je 0x140010a62
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rax, qword [rbx + 0x20]
inc r12d
cmp r12d, dword [rax + r14*8 + 8]
jb 0x14001090e
inc r15d
cmp r15d, dword [rbx + 0x18]
jb 0x1400108cd
mov rax, qword [rsp + 0x30]
mov rbx, rax
test rax, rax
jne 0x1400108ad
mov eax, 1
jmp 0x140010ab0
lea rcx, str.BigBad_:_kull_m_rpc_drsr_ProcessGetNCChangesReply_decrypt___ERROR
jmp 0x140010aa9
lea rcx, str.BigBad_:_kull_m_rpc_drsr_ProcessGetNCChangesReply___ERROR
call fcn.14000b9e4
xor eax, eax
mov rbx, qword [rsp + reloc.WLDAP32.dll_Ordinal_304]
add rsp, 0xf0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret