Function at 0x180049d70
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rsi
push r12
push r13
sub rsp, 0x188
mov rax, qword [0x1800ea200]
xor rax, rsp
mov qword [rsp + 0x150], rax
mov rax, qword [rcx]
xor ebx, ebx
mov r12d, dword [rsp + 0x1d0]
mov r13, r9
mov qword [rsp + 0x58], r9
mov rsi, rcx
mov qword [rsp + 0x68], r8
mov dword [rax + 8], ebx
mov qword [rsp + 0x60], rdx
mov qword [rsp + 0x50], rcx
cmp r12d, 4
ja 0x18004a47f
call fcn.18004e650
test eax, eax
jne 0x180049ddc
mov rcx, rsi
call fcn.18004beb0
xor eax, eax
jmp 0x180049fbf
mov qword [rsp + 0x170], r14
mov ecx, 3
mov qword [rsp + 0x168], r15
lea r15d, [rcx - 2]
test r12d, r12d
jne 0x180049e0f
mov rax, qword [rsi]
mov r12d, r15d
cmp dword [rax + 8], ecx
cmovge r12d, ecx
mov dword [rsp + 0x1d0], r12d
mov rax, qword [rsi]
mov ecx, dword [rax + 8]
cmp ecx, 3
jne 0x180049e3c
cmp dword [rsi + 0x4850], ecx
je 0x180049e32
cmp dword [rsi + 0x484c], ebx
jne 0x180049e3c
cmp dword [rsi + 0x4848], ebx
jne 0x180049e3c
mov eax, r15d
mov qword [rsp + 0x38], r15
jmp 0x180049e48
mov qword [rsp + 0x38], rbx
mov eax, ebx
cmp ecx, 3
jne 0x180049e55
cmp r12d, 3
jge 0x180049e55
test eax, eax
jne 0x180049e55
mov ecx, r15d
movsxd r14, ecx
xorps xmm0, xmm0
mov qword [rsp + 0x180], rbp
xorps xmm1, xmm1
mov qword [rsp + 0x40], r14
mov qword [rsp + 0x178], rdi
movdqu xmmword [rsp + 0x70], xmm0
movdqu xmmword [rsp + 0x80], xmm1
test ecx, ecx
jle 0x180049f68
mov rbp, rbx
lea rdi, [rsi + 0x46a4]
lea rbx, [rsp + 0xac]
nop dword [rax]
mov rax, qword [rsi]
mov ecx, dword [rax]
add ecx, 3
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov qword [rdi + 0x44], rax
test rax, rax
je 0x180049f89
mov eax, dword [rsi + 0x4688]
cdq
mov dword [rbx + 0xc], 0
idiv dword [rdi]
mov r9d, eax
mov dword [rbx - 4], eax
mov eax, dword [rsi + 0x468c]
cdq
idiv dword [rdi + 4]
xor edx, edx
mov ecx, eax
mov dword [rbx], eax
sar ecx, 1
mov r8d, eax
mov dword [rbx + 8], ecx
mov rcx, qword [rsi]
mov eax, dword [rcx]
mov rcx, qword [rdi + 0x2c]
dec eax
add eax, r9d
mov qword [rbx - 0xc], rcx
div r9d
mov qword [rbx - 0x14], rcx
mov dword [rbx + 4], eax
cmp r9d, r15d
jne 0x180049f26
cmp r8d, r15d
jne 0x180049f17
lea rax, [0x18004a580]
jmp 0x180049f50
cmp r8d, 2
jne 0x180049f26
lea rax, [0x180057f00]
jmp 0x180049f50
cmp r9d, 2
jne 0x180049f49
cmp r8d, r15d
jne 0x180049f3a
lea rax, [0x180057b50]
jmp 0x180049f50
cmp r8d, 2
jne 0x180049f49
mov rax, qword [rsi + 0x4880]
jmp 0x180049f50
lea rax, [0x180057b10]
mov qword [rbx - 0x1c], rax
inc rbp
add rbx, 0x30
add rdi, 0x60
cmp rbp, r14
jl 0x180049ea0
mov rdx, qword [rsi]
mov r9d, r15d
mov ecx, r12d
mov r8d, dword [rdx + 4]
mov edx, dword [rdx]
call fcn.180052f10
mov qword [rsp + 0x48], rax
mov r14, rax
test rax, rax
jne 0x180049fdd
mov rcx, rsi
call fcn.18004beb0
lea rcx, str.outofmem
call fcn.18004e9d0
xor eax, eax
mov rdi, qword [rsp + 0x178]
mov rbp, qword [rsp + 0x180]
mov r14, qword [rsp + 0x170]
mov r15, qword [rsp + 0x168]
mov rcx, qword [rsp + 0x150]
xor rcx, rsp
call fcn.180059b00
add rsp, 0x188
pop r13
pop r12
pop rsi
pop rbx
ret
mov rcx, qword [rsi]
xor eax, eax
mov dword [rsp + 0x30], eax
cmp dword [rcx + 4], eax
jbe 0x18004a43d
mov r13, qword [rsp + 0x88]
mov rbp, qword [rsp + 0x80]
mov r15, qword [rsp + 0x78]
mov rdi, qword [rsp + 0x70]
nop dword [rax]
imul eax, dword [rcx]
imul eax, r12d
mov ebx, eax
add rbx, r14
xor r14d, r14d
cmp qword [rsp + 0x40], r14
jle 0x18004a0e4
lea rbp, [rsi + 0x46c0]
mov rsi, qword [rsp + 0x40]
lea rdi, [rsp + 0xb4]
nop
mov eax, dword [rdi - 8]
lea r15, [rdi - 0x14]
mov r9d, dword [rdi - 0xc]
lea r12, [rdi - 0x1c]
sar eax, 1
mov r13, r15
cmp dword [rdi], eax
jl 0x18004a061
mov r8, qword [r12]
mov rdx, r15
jmp 0x18004a067
mov r8, qword [r15]
mov rdx, r12
mov rdx, qword [rdx]
mov rcx, qword [rbp + 0x28]
mov dword [rsp + 0x20], r9d
mov r9d, dword [rdi - 4]
call qword [rdi - 0x24]
mov qword [rsp + r14*8 + 0x70], rax
mov eax, dword [rdi]
inc eax
mov dword [rdi], eax
cmp eax, dword [rdi - 8]
jl 0x18004a0ad
inc dword [rdi + 4]
mov eax, dword [rdi + 4]
mov rcx, qword [r13]
mov dword [rdi], 0
mov qword [r12], rcx
cmp eax, dword [rbp]
jge 0x18004a0ad
movsxd rax, dword [rbp + 4]
add rax, rcx
mov qword [r15], rax
inc r14
add rdi, 0x30
add rbp, 0x60
cmp r14, rsi
jl 0x18004a040
mov r13, qword [rsp + 0x88]
mov rbp, qword [rsp + 0x80]
mov r15, qword [rsp + 0x78]
mov rdi, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x50]
mov r12d, dword [rsp + 0x1d0]
mov rax, qword [rsi]
cmp r12d, 3
jl 0x18004a281
mov ecx, dword [rax + 8]
cmp ecx, 3
jne 0x18004a15c
cmp qword [rsp + 0x38], 0
je 0x18004a13a
xor edx, edx
cmp dword [rax], edx
jbe 0x18004a417
movsxd r8, r12d
nop
movzx eax, byte [rdx + rdi]
mov byte [rbx], al
movzx eax, byte [rdx + r15]
mov byte [rbx + 1], al
movzx eax, byte [rdx + rbp]
inc edx
mov byte [rbx + 2], al
mov byte [rbx + 3], 0xff
add rbx, r8
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x18004a110
jmp 0x18004a417
mov eax, dword [rax]
mov r9, rbp
mov dword [rsp + 0x28], r12d
mov r8, r15
mov rdx, rdi
mov dword [rsp + 0x20], eax
mov rcx, rbx
call qword [rsi + 0x4878]
jmp 0x18004a417
cmp ecx, 4
jne 0x18004a247
mov ecx, dword [rsi + 0x484c]
test ecx, ecx
jne 0x18004a1c2
xor r10d, r10d
cmp dword [rax], r10d
jbe 0x18004a417
movsxd r11, r12d
nop
movzx edx, byte [r10 + r13]
movzx ecx, byte [r10 + rdi]
call fcn.18004aad0
mov byte [rbx], al
movzx ecx, byte [r10 + r15]
call fcn.18004aad0
mov byte [rbx + 1], al
movzx ecx, byte [r10 + rbp]
call fcn.18004aad0
mov byte [rbx + 2], al
inc r10d
mov byte [rbx + 3], 0xff
add rbx, r11
mov rax, qword [rsi]
cmp r10d, dword [rax]
jb 0x18004a180
jmp 0x18004a417
mov edx, dword [rax]
cmp ecx, 2
mov rax, qword [rsi + 0x4878]
mov r9, rbp
mov dword [rsp + 0x28], r12d
mov r8, r15
mov dword [rsp + 0x20], edx
mov rcx, rbx
mov rdx, rdi
jne 0x18004a240
call rax
mov rax, qword [rsi]
xor r9d, r9d
cmp dword [rax], r9d
jbe 0x18004a417
movsxd r10, r12d
nop dword [rax]
movzx ecx, byte [rbx]
movzx edx, byte [r9 + r13]
not cl
call fcn.18004aad0
movzx ecx, byte [rbx + 1]
not cl
mov byte [rbx], al
call fcn.18004aad0
movzx ecx, byte [rbx + 2]
not cl
mov byte [rbx + 1], al
call fcn.18004aad0
mov byte [rbx + 2], al
inc r9d
mov rax, qword [rsi]
add rbx, r10
cmp r9d, dword [rax]
jb 0x18004a200
jmp 0x18004a417
call rax
jmp 0x18004a417
xor edx, edx
cmp dword [rax], edx
jbe 0x18004a417
movsxd r8, r12d
nop dword [rax]
nop dword [rax + rax]
movzx ecx, byte [rdx + rdi]
inc edx
mov byte [rbx + 2], cl
mov byte [rbx + 1], cl
mov byte [rbx], cl
mov byte [rbx + 3], 0xff
add rbx, r8
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x18004a260
jmp 0x18004a417
cmp qword [rsp + 0x38], 0
je 0x18004a30e
mov ecx, dword [rax]
xor r9d, r9d
cmp r12d, 1
jne 0x18004a2ca
test ecx, ecx
je 0x18004a417
movzx r8d, byte [r9 + rbp]
movzx edx, byte [r9 + r15]
movzx ecx, byte [r9 + rdi]
call fcn.18004c320
mov byte [rbx], al
lea rbx, [rbx + 1]
mov rax, qword [rsi]
inc r9d
cmp r9d, dword [rax]
jb 0x18004a2a0
jmp 0x18004a417
test ecx, ecx
je 0x18004a417
nop dword [rax]
nop word [rax + rax]
movzx r8d, byte [r9 + rbp]
movzx edx, byte [r9 + r15]
movzx ecx, byte [r9 + rdi]
call fcn.18004c320
mov byte [rbx], al
inc r9d
mov byte [rbx + 1], 0xff
lea rbx, [rbx + 2]
mov rax, qword [rsi]
cmp r9d, dword [rax]
jb 0x18004a2e0
jmp 0x18004a417
cmp dword [rax + 8], 4
jne 0x18004a3c7
mov ecx, dword [rsi + 0x484c]
test ecx, ecx
jne 0x18004a38b
xor r14d, r14d
cmp dword [rax], r14d
jbe 0x18004a417
movsxd r12, r12d
movzx edx, byte [r14 + r13]
movzx ecx, byte [r14 + rbp]
call fcn.18004aad0
movzx ecx, byte [r14 + r15]
movzx r10d, al
call fcn.18004aad0
movzx ecx, byte [r14 + rdi]
movzx r9d, al
call fcn.18004aad0
movzx ecx, al
mov r8d, r10d
mov edx, r9d
call fcn.18004c320
mov byte [rbx], al
inc r14d
mov byte [rbx + 1], 0xff
add rbx, r12
mov rax, qword [rsi]
cmp r14d, dword [rax]
jb 0x18004a331
mov r12d, dword [rsp + 0x1d0]
jmp 0x18004a417
cmp ecx, 2
jne 0x18004a3c7
xor r9d, r9d
cmp dword [rax], r9d
jbe 0x18004a417
movsxd r10, r12d
nop
movzx ecx, byte [r9 + rdi]
movzx edx, byte [r9 + r13]
not cl
call fcn.18004aad0
mov byte [rbx], al
inc r9d
mov byte [rbx + 1], 0xff
add rbx, r10
mov rax, qword [rsi]
cmp r9d, dword [rax]
jb 0x18004a3a0
jmp 0x18004a417
mov ecx, dword [rax]
xor edx, edx
cmp r12d, 1
jne 0x18004a3f2
test ecx, ecx
je 0x18004a417
nop word [rax + rax]
movzx eax, byte [rdx + rdi]
mov byte [rdx + rbx], al
inc edx
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x18004a3e0
jmp 0x18004a417
test ecx, ecx
je 0x18004a417
nop word [rax + rax]
movzx ecx, byte [rdx + rdi]
inc edx
mov byte [rbx], cl
mov byte [rbx + 1], 0xff
lea rbx, [rbx + 2]
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x18004a400
mov eax, dword [rsp + 0x30]
mov rcx, qword [rsi]
inc eax
mov r14, qword [rsp + 0x48]
mov dword [rsp + 0x30], eax
cmp eax, dword [rcx + 4]
jb 0x18004a010
mov r13, qword [rsp + 0x58]
mov r15d, 1
mov rcx, rsi
call fcn.18004beb0
mov rax, qword [rsi]
mov ecx, dword [rax]
mov rax, qword [rsp + 0x60]
mov dword [rax], ecx
mov rax, qword [rsi]
mov ecx, dword [rax + 4]
mov rax, qword [rsp + 0x68]
mov dword [rax], ecx
test r13, r13
je 0x18004a477
mov rax, qword [rsi]
cmp dword [rax + 8], 3
mov eax, 3
cmovge r15d, eax
mov dword [r13], r15d
mov rax, r14
jmp 0x180049f9f
lea rcx, str.bad_req_comp
call fcn.18004e9d0
xor eax, eax
jmp 0x180049fbf