Function at 0x10129590
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x28
mov eax, dword [esp + 0x30]
push ebx
push ebp
push esi
mov ecx, dword [eax + 0x28c]
lea ebx, [eax + 8]
mov esi, dword [eax + 0x288]
mov ebp, dword [eax + 0x280]
mov dword [esp + 0x10], ecx
mov ecx, dword [eax + 0x284]
mov dword [esp + 0x18], ecx
mov ecx, dword [eax + 0x314]
push edi
mov edi, dword [eax + 0x290]
mov dword [esp + 0x20], ecx
lea ecx, [eax + 0x94a]
add eax, 0x8b8
mov dword [esp + 0x34], ebx
push ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x1c], eax
call fcn.1012b290
add esp, 4
test eax, eax
je 0x101297cc
cmp esi, dword [esp + 0x3c]
jae 0x10129788
mov dword [esp + 0x30], ebp
test edi, edi
je 0x10129788
cmp dword [ebx + 0xc], 2
mov eax, dword [esp + 0x40]
lea ecx, [eax + 0x294]
mov dword [esp + 0x28], ecx
jb 0x101297a6
mov edi, dword [ebx + 4]
cmp edi, 0x10
jb 0x10129653
mov ecx, dword [ebx + 8]
xor edi, 0x10
movzx edx, word [ebx + 2]
mov dword [ebx], edx
mov dword [ebx + 4], edi
movzx eax, word [ecx]
shl eax, 0x10
or eax, edx
add dword [ebx + 0xc], 0xfffffffe
mov dword [ebx], eax
lea eax, [ecx + 2]
mov dword [ebx + 8], eax
mov eax, dword [ebx]
mov ecx, edi
shr eax, cl
and eax, dword [0x1017642c]
mov ecx, dword [esp + 0x28]
lea ecx, [ecx + eax*4]
movzx eax, byte [ecx]
add edi, eax
mov dword [ebx + 4], edi
movzx edx, word [ecx + 2]
mov dword [esp + 0x28], edi
cmp edx, 0x10
jae 0x101296b8
mov dword [esp + 0x14], 0
test edx, edx
je 0x101296b2
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x1c], edx
mov eax, dword [edi + edx*4]
mov word [ecx + eax*2], si
mov eax, 0x8000
mov ecx, edx
mov dword [edi + edx*4], esi
shr eax, cl
sub dword [esp + 0x10], eax
mov eax, dword [esp + 0x24]
inc word [eax + edx*2]
inc esi
jmp 0x1012977a
xor eax, eax
mov ecx, edi
mov edi, dword [ebx]
cmp edx, 0x10
setne al
shr edi, cl
add eax, 2
mov ecx, dword [eax*4 + 0x10176418]
add eax, dword [esp + 0x28]
and ecx, edi
mov dword [esp + 0x2c], ecx
xor ecx, ecx
cmp edx, 0x10
mov dword [ebx + 4], eax
mov eax, dword [esp + 0x1c]
cmovne eax, ecx
cmp edx, 0x10
setne cl
add ecx, 2
cmp ebp, eax
cmovne ebp, eax
xor edi, edi
cmp dword [esp + 0x30], eax
cmove edi, dword [esp + 0x14]
mov eax, edi
test edi, edi
je 0x1012970d
lea eax, [edi - 2]
shl eax, cl
mov ecx, dword [esp + 0x2c]
add ecx, 3
add eax, ecx
mov edx, eax
mov dword [esp + 0x14], eax
sub edx, edi
lea ecx, [edx + esi]
cmp ecx, dword [esp + 0x3c]
ja 0x1012979f
test ebp, ebp
je 0x10129778
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov eax, dword [eax + ebp*4]
add eax, eax
nop dword [eax + eax]
mov word [eax + ebx], si
mov edi, esi
lea eax, [esi + esi]
inc esi
cmp esi, ecx
jne 0x10129740
mov eax, dword [esp + 0x18]
mov ecx, 0xf
mov ebx, dword [esp + 0x34]
sub ecx, ebp
mov dword [eax + ebp*4], edi
mov eax, edx
mov edi, dword [esp + 0x10]
shl eax, cl
sub edi, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x10], edi
add word [eax + ebp*2], dx
jmp 0x1012977e
mov esi, ecx
mov edi, dword [esp + 0x10]
cmp esi, dword [esp + 0x3c]
jb 0x10129604
mov eax, dword [esp + 0x40]
mov dword [eax + 0x290], edi
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov edi, 0xfffff
jmp 0x10129788
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov dword [eax + 0x288], esi
mov dword [eax + 0x28c], edx
mov dword [eax + 0x284], ecx
mov dword [eax + 0x280], ebp
mov dword [eax + 0x290], edi
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x28
ret