Function at 0x10012ae4
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc0
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x3c], edi
mov eax, dword [edi]
and dword [eax + 8], 0
call fcn.100122e1
mov esi, dword [edi]
mov ebx, dword [esi + 8]
mov dword [ebp - 8], ebx
test eax, eax
jne 0x10012b20
push 0
mov edx, ebx
mov ecx, edi
call fcn.10011a85
pop ecx
jmp 0x10012fa0
cmp ebx, 3
jne 0x10012b4b
cmp dword [edi + 0x47ec], ebx
je 0x10012b3f
cmp dword [edi + 0x47e8], 0
jne 0x10012b4b
cmp dword [edi + 0x47e4], 0
jne 0x10012b4b
mov dword [ebp - 0x1c], 1
mov dword [ebp - 8], ebx
jmp 0x10012b53
and dword [ebp - 0x1c], 0
test ebx, ebx
jle 0x10012b0f
mov ecx, dword [sym.imp.msvcrt.dll_malloc]
lea esi, [ebp - 0xb0]
and dword [ebp - 0xc], 0
lea edx, [edi + 0x46a0]
xorps xmm0, xmm0
mov dword [ebp - 4], esi
movups xmmword [ebp - 0x38], xmm0
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x28], ecx
mov eax, dword [edi]
mov eax, dword [eax]
add eax, 3
push eax
call ecx
pop ecx
mov ecx, dword [ebp - 0x18]
mov dword [ecx + 0x34], eax
test eax, eax
je 0x10012f78
mov eax, dword [edi + 0x4684]
cdq
idiv dword [ecx]
mov dword [esi - 4], eax
mov dword [ebp - 0x14], eax
mov eax, dword [edi + 0x4688]
cdq
idiv dword [ecx + 4]
mov edx, dword [ebp - 4]
mov esi, eax
mov eax, dword [ebp - 0x14]
mov ecx, esi
dec eax
sar ecx, 1
mov dword [edx + 8], ecx
mov ecx, dword [edi]
mov dword [edx], esi
xor edx, edx
add eax, dword [ecx]
div dword [ebp - 0x14]
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 0x18]
and dword [ecx + 0xc], 0
mov dword [ecx + 4], eax
mov eax, dword [edx + 0x28]
mov dword [ecx - 8], eax
mov dword [ecx - 0xc], eax
mov eax, dword [ebp - 0x14]
cmp eax, 1
jne 0x10012bfb
cmp esi, eax
jne 0x10012bef
mov eax, 0x10012400
jmp 0x10012c1e
cmp esi, 2
jne 0x10012c19
mov eax, 0x10012408
jmp 0x10012c1e
cmp eax, 2
jne 0x10012c19
cmp esi, 1
jne 0x10012c0c
mov eax, 0x1001244b
jmp 0x10012c1e
cmp esi, 2
jne 0x10012c19
mov eax, dword [edi + 0x4814]
jmp 0x10012c1e
mov eax, 0x10012734
mov dword [ecx - 0x10], eax
add edx, 0x48
mov eax, dword [ebp - 0xc]
add ecx, 0x20
inc eax
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], eax
mov esi, ecx
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x18], edx
cmp eax, ebx
jl 0x10012b79
mov edx, dword [edi]
push 1
push dword [edx + 4]
mov edx, dword [edx]
push 4
pop ecx
call fcn.1000e89d
mov edx, dword [edi]
mov esi, eax
mov dword [ebp - 0x28], esi
pop ecx
pop ecx
test esi, esi
jne 0x10012c89
mov edx, dword [edx + 8]
mov ecx, edi
push eax
call fcn.10011a85
mov eax, dword fs:[0x2c]
pop ecx
mov ecx, dword [0x1018aee4]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0x9a8], 0x1008f404
jmp 0x10012fa0
xor ecx, ecx
mov dword [ebp - 4], ecx
cmp dword [edx + 4], ecx
jbe 0x10012f54
mov eax, dword [edx]
and dword [ebp - 0x20], 0
imul eax, ecx
lea eax, [esi + eax*4]
mov dword [ebp - 0x24], eax
test ebx, ebx
jle 0x10012d60
lea eax, [edi + 0x46bc]
mov dword [ebp - 0xc], eax
lea esi, [ebp - 0xa8]
mov edi, eax
mov eax, dword [ebp - 0x1c]
lea ecx, [esi - 0x10]
mov dword [ebp - 8], eax
lea edx, [esi - 0x14]
mov dword [ebp - 0x1c], eax
mov eax, dword [esi - 8]
sar eax, 1
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], edx
cmp dword [esi], eax
jl 0x10012cef
mov eax, dword [edx]
mov edx, ecx
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x1c], ecx
jmp 0x10012cfc
mov eax, ecx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x14], eax
mov eax, dword [ecx]
push dword [esi - 0xc]
push dword [esi - 4]
push eax
push dword [edx]
push dword [edi + 0x18]
call dword [esi - 0x18]
mov ecx, dword [ebp - 0x20]
add esp, 0x14
mov dword [ebp + ecx*4 - 0x38], eax
mov eax, dword [esi]
inc eax
mov dword [esi], eax
cmp eax, dword [esi - 8]
jl 0x10012d40
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
and dword [esi], 0
inc dword [esi + 4]
mov edx, dword [edx]
mov dword [eax], edx
mov eax, dword [esi + 4]
cmp eax, dword [edi]
jge 0x10012d40
mov eax, dword [edi + 4]
add eax, edx
mov edx, dword [ebp - 0x14]
mov dword [edx], eax
inc ecx
add esi, 0x20
add edi, 0x48
mov dword [ebp - 0x20], ecx
cmp ecx, ebx
jl 0x10012cbf
mov edi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ebx
mov edx, dword [edi]
cmp dword [edx + 8], 3
jne 0x10012dcc
cmp dword [ebp - 0x1c], 0
je 0x10012db0
xor esi, esi
cmp dword [edx], esi
jbe 0x10012f42
mov ecx, dword [ebp - 0x34]
lea edx, [eax + 2]
mov ebx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x30]
sub ebx, ecx
sub eax, ecx
mov dword [ebp - 0x10], eax
mov al, byte [ecx + ebx]
inc esi
mov byte [edx - 2], al
mov al, byte [ecx]
mov byte [edx - 1], al
mov eax, dword [ebp - 0x10]
mov al, byte [ecx + eax]
inc ecx
mov byte [edx], al
lea edx, [edx + 4]
mov byte [edx - 3], 0xff
mov eax, dword [edi]
cmp esi, dword [eax]
jb 0x10012d89
jmp 0x10012f3c
push 4
push dword [edx]
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp - 0x38]
push eax
call dword [edi + 0x4810]
add esp, 0x18
jmp 0x10012f3f
cmp dword [edx + 8], 4
jne 0x10012f17
mov ecx, dword [edi + 0x47e8]
test ecx, ecx
jne 0x10012e77
and dword [ebp - 0x20], ecx
cmp dword [edx], ecx
jbe 0x10012f3f
mov esi, dword [ebp - 0x2c]
lea ebx, [eax + 2]
mov ecx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
sub ecx, esi
mov dword [ebp - 0x10], ecx
sub eax, esi
mov ecx, dword [ebp - 0x30]
sub ecx, esi
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x24], ecx
movzx ecx, byte [esi + eax]
movzx edx, byte [esi]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 2], al
mov eax, dword [ebp - 0x10]
movzx ecx, byte [esi + eax]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 1], al
mov eax, dword [ebp - 0x24]
movzx ecx, byte [esi + eax]
imul ecx, edx
mov byte [ebx + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0x20]
shr eax, 8
inc ecx
mov byte [ebx], al
inc esi
mov eax, dword [edi]
lea ebx, [ebx + 4]
mov dword [ebp - 0x20], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xc]
jb 0x10012e0d
jmp 0x10012f3c
mov edx, dword [edx]
mov esi, dword [edi + 0x4810]
push 4
push edx
push dword [ebp - 0x30]
push dword [ebp - 0x34]
push dword [ebp - 0x38]
push eax
cmp ecx, 2
jne 0x10012f10
call esi
mov eax, dword [edi]
add esp, 0x18
and dword [ebp - 0x10], 0
cmp dword [eax], 0
jbe 0x10012f3f
mov esi, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x10]
add esi, 2
mov eax, dword [ebp - 0x2c]
movzx edx, byte [ebx + eax]
mov al, byte [esi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
mov al, byte [esi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
mov al, byte [esi]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
inc ebx
mov byte [esi], al
lea esi, [esi + 4]
mov eax, dword [edi]
cmp ebx, dword [eax]
jb 0x10012eae
jmp 0x10012f3c
call esi
jmp 0x10012dc4
xor esi, esi
cmp dword [edx], esi
jbe 0x10012f42
mov ebx, dword [ebp - 0x38]
lea ecx, [eax + 1]
mov al, byte [esi + ebx]
inc esi
mov byte [ecx + 1], al
mov byte [ecx], al
lea ecx, [ecx + 4]
mov byte [ecx - 5], al
mov byte [ecx - 2], 0xff
mov eax, dword [edi]
cmp esi, dword [eax]
jb 0x10012f23
mov ebx, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov edx, dword [edi]
inc ecx
mov esi, dword [ebp - 0x28]
mov dword [ebp - 4], ecx
cmp ecx, dword [edx + 4]
jb 0x10012c97
mov edx, dword [edx + 8]
mov ecx, edi
push 0
call fcn.10011a85
mov eax, dword [edi]
pop ecx
mov ecx, dword [ebp - 0x40]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [edi]
mov ecx, dword [eax + 4]
mov eax, dword [ebp + 8]
mov dword [eax], ecx
mov eax, esi
jmp 0x10012fa2
mov edx, dword [edi]
mov ecx, edi
push 0
mov edx, dword [edx + 8]
call fcn.10011a85
mov eax, dword fs:[0x2c]
pop ecx
mov ecx, dword [0x1018aee4]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0x9a8], 0x1008f3f8
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret