Function at 0xd22a20
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x12c
mov edi, dword [ebp + 8]
mov word [ebp - 0x24], 0x400
mov word [ebp - 0x30], 0x400
lea eax, [edi + 0x14]
movsx edx, word [edi + 2]
mov dword [ebp - 0xb0], eax
movsx eax, word [edi + 0x14]
mov ebx, dword [ebp - 0xb0]
lea ecx, [edx + eax]
sub edx, eax
sar ecx, 2
sar edx, 2
sub cx, 0x400
add dx, 0x400
mov word [ebp - 0x22], cx
mov word [ebp - 0x2e], dx
movsx eax, word [edi + 4]
movsx esi, word [ebx - 2]
lea ebx, [eax + esi]
sub eax, esi
sar ebx, 2
sub bx, cx
mov ecx, dword [ebp - 0xb0]
sar eax, 2
add edx, eax
mov word [ebp - 0x20], bx
mov word [ebp - 0x2c], dx
movsx eax, word [edi + 6]
movsx esi, word [ecx - 4]
lea ecx, [eax + esi]
sub eax, esi
sar ecx, 2
sub cx, bx
mov ebx, dword [ebp - 0xb0]
sar eax, 2
add edx, eax
mov word [ebp - 0x2a], dx
mov word [ebp - 0x1e], cx
movsx eax, word [edi + 8]
movsx esi, word [ebx - 6]
lea ebx, [eax + esi]
sub eax, esi
mov esi, dword [ebp - 0xb0]
sar eax, 2
sar ebx, 2
add edx, eax
sub bx, cx
mov word [ebp - 0x1c], bx
mov word [ebp - 0x28], dx
movsx eax, word [edi + 0xa]
movsx ecx, word [esi - 8]
lea esi, [eax + ecx]
sub eax, ecx
sar eax, 2
add edx, eax
movzx eax, word [0x12ef280]
sar esi, 2
sub si, bx
mov word [ebp - 0x1a], si
movsx esi, si
mov word [ebp - 0x26], dx
movsx edi, ax
mov word [ebp - 0x5a], ax
movsx edx, word [ebp - 0x22]
mov eax, edi
shl eax, 0xa
shl edx, 0xe
add edx, eax
mov eax, edx
shr eax, 0x10
movsx ecx, ax
mov ebx, ecx
shl eax, 0xf
sar edx, 1
imul ebx, edi
sub dx, ax
movsx eax, word [ebp - 0x20]
movsx edx, dx
mov dword [ebp - 0x80], ecx
mov ecx, edx
add edx, edx
imul ecx, edi
shl eax, 0xe
shl dword [ebp - 0x80], 0x10
sar ecx, 0xf
add ecx, ebx
lea ecx, [eax + ecx*4 - 0x1000000]
mov eax, ecx
shr eax, 0x10
movsx ebx, ax
mov dword [ebp - 0x7c], ebx
imul ebx, edi
shl eax, 0xf
sar ecx, 1
sub cx, ax
movsx eax, word [ebp - 0x1e]
movsx ecx, cx
mov dword [ebp - 0x84], ebx
mov ebx, ecx
imul ebx, edi
shl eax, 0xe
sub eax, dword [ebp - 0x80]
shl dword [ebp - 0x7c], 0x10
sar ebx, 0xf
add ebx, dword [ebp - 0x84]
sub eax, edx
lea ebx, [eax + ebx*4]
mov eax, ebx
shr eax, 0x10
movsx edx, ax
sar ebx, 1
shl eax, 0xf
sub bx, ax
movsx ebx, bx
mov eax, ebx
imul eax, edi
mov dword [ebp - 0xbc], edx
imul edx, edi
sar eax, 0xf
add eax, edx
movsx edx, word [ebp - 0x1c]
mov dword [ebp - 0x11c], eax
mov eax, dword [ebp - 0x7c]
shl edx, 0xe
lea ecx, [eax + ecx*2]
sub edx, ecx
mov ecx, dword [ebp - 0x11c]
lea eax, [edx + ecx*4]
mov edx, eax
shr edx, 0x10
movsx ecx, dx
sar eax, 1
shl edx, 0xf
imul ecx, edi
sub ax, dx
cwde
add ebx, ebx
imul eax, edi
shl dword [ebp - 0xbc], 0x10
shl esi, 0xd
sub esi, dword [ebp - 0xbc]
sar eax, 0xf
add eax, ecx
sub esi, ebx
lea edx, [esi + eax*2]
lea eax, [edx + 0x2000000]
cmp eax, 0x3fffffe
ja 0xd232e3
shr edx, 0xa
mov word [ebp - 0x58], dx
movsx esi, word [ebp - 0x22]
lea eax, [ebp - 0x20]
movsx edx, word [ebp - 0x20]
lea ecx, [ebp - 0x1e]
movsx ebx, word [ebp - 0x1e]
mov word [ebp - 0xfc], 0
mov word [ebp - 0xfa], 0
mov dword [ebp - 0xac], 0
mov dword [ebp - 0x104], esi
mov dword [ebp - 0x110], eax
mov dword [ebp - 0x108], edx
mov dword [ebp - 0x114], ecx
mov dword [ebp - 0x10c], ebx
jmp 0xd22cd0
movsx eax, word [ebp - 0x58]
shr ecx, 0xa
movsx edx, cx
mov word [ebp - 0xf8], cx
imul edx, eax
test edx, edx
jle 0xd22e4c
movzx esi, word [ebp - 0x78]
movzx eax, word [ebp - 0xf8]
mov word [ebp - 0x5a], si
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0xac]
cmp word [ebp - 0xfc], 9
setle dl
add eax, 1
cmp ax, 0x3b
setle al
add dword [ebp - 0xac], 1
test dl, al
je 0xd231ca
mov esi, dword [ebp - 0xac]
mov eax, dword [ebp - 0x104]
movzx esi, word [esi + esi + 0x12ef282]
shl eax, 0xe
mov dword [ebp - 0xb4], eax
mov word [ebp - 0x78], si
movsx esi, si
mov edx, esi
shl edx, 0xa
add edx, eax
mov eax, edx
shr eax, 0x10
movsx edi, ax
sar edx, 1
mov ebx, edi
shl eax, 0xf
sub dx, ax
mov eax, dword [ebp - 0x108]
movsx edx, dx
mov ecx, edx
add edx, edx
imul ecx, esi
imul ebx, esi
shl eax, 0xe
sub eax, 0x1000000
sar ecx, 0xf
add ecx, ebx
lea ecx, [eax + ecx*4]
mov dword [ebp - 0x98], eax
mov eax, ecx
shr eax, 0x10
movsx ebx, ax
mov dword [ebp - 0x88], ebx
imul ebx, esi
shl eax, 0xf
sar ecx, 1
sub cx, ax
mov eax, dword [ebp - 0x10c]
movsx ecx, cx
mov dword [ebp - 0x94], ebx
mov ebx, ecx
imul ebx, esi
shl eax, 0xe
shl edi, 0x10
mov dword [ebp - 0x8c], eax
sub eax, edi
sar ebx, 0xf
sub eax, edx
add ebx, dword [ebp - 0x94]
lea ebx, [eax + ebx*4]
mov eax, ebx
shr eax, 0x10
movsx edi, ax
sar ebx, 1
mov edx, edi
shl eax, 0xf
sub bx, ax
movsx ebx, bx
mov eax, ebx
imul eax, esi
imul edx, esi
sar eax, 0xf
add eax, edx
mov edx, dword [ebp - 0x114]
add ecx, ecx
shl dword [ebp - 0x88], 0x10
add ebx, ebx
shl edi, 0x10
movsx edx, word [edx + 2]
shl edx, 0xe
mov dword [ebp - 0x90], edx
sub edx, dword [ebp - 0x88]
sub edx, ecx
lea eax, [edx + eax*4]
mov edx, eax
shr edx, 0x10
movsx ecx, dx
sar eax, 1
shl edx, 0xf
sub ax, dx
cwde
imul eax, esi
imul ecx, esi
sar eax, 0xf
add eax, ecx
mov ecx, dword [ebp - 0x110]
movsx ecx, word [ecx + 6]
shl ecx, 0xd
mov edx, ecx
sub edx, edi
sub edx, ebx
mov dword [ebp - 0xb8], ecx
lea ecx, [edx + eax*2]
lea eax, [ecx + 0x2000000]
cmp eax, 0x3fffffe
jbe 0xd22c76
cmp ecx, 0x2000000
mov eax, 0xffff8000
mov ebx, 0x7fff
mov edx, 0x7fff
cmovl ebx, eax
mov eax, 0xffff8000
cmovl edx, eax
movsx eax, word [ebp - 0x58]
mov word [ebp - 0xf8], bx
imul edx, eax
test edx, edx
jg 0xd22c92
movzx edx, word [ebp - 0x5a]
movzx ecx, word [ebp - 0x58]
mov word [ebp - 0xfe], 4
mov word [ebp - 0xe8], dx
mov word [ebp - 0x48], cx
movzx edx, word [ebp - 0xe8]
movzx eax, word [ebp - 0x78]
sar dx, 1
sar ax, 1
add edx, eax
movsx esi, dx
mov ebx, esi
shl ebx, 0xa
add ebx, dword [ebp - 0xb4]
mov word [ebp - 0xd8], dx
mov eax, ebx
shr eax, 0x10
movsx edi, ax
sar ebx, 1
mov ecx, edi
shl eax, 0xf
sub bx, ax
mov eax, dword [ebp - 0x98]
movsx ebx, bx
mov edx, ebx
imul edx, esi
imul ecx, esi
shl edi, 0x10
lea ebx, [edi + ebx*2]
sar edx, 0xf
add edx, ecx
lea edx, [eax + edx*4]
mov eax, edx
shr eax, 0x10
movsx ecx, ax
mov dword [ebp - 0x9c], ecx
imul ecx, esi
shl eax, 0xf
sar edx, 1
sub dx, ax
mov eax, dword [ebp - 0x8c]
movsx edx, dx
mov dword [ebp - 0xa0], ecx
mov ecx, edx
imul ecx, esi
sub eax, ebx
shl dword [ebp - 0x9c], 0x10
sar ecx, 0xf
add ecx, dword [ebp - 0xa0]
lea ecx, [eax + ecx*4]
mov eax, ecx
shr eax, 0x10
movsx edi, ax
sar ecx, 1
mov ebx, edi
shl eax, 0xf
sub cx, ax
movsx ecx, cx
mov eax, ecx
imul eax, esi
imul ebx, esi
sar eax, 0xf
add eax, ebx
mov ebx, dword [ebp - 0x9c]
lea edx, [ebx + edx*2]
mov ebx, dword [ebp - 0x90]
sub ebx, edx
lea eax, [ebx + eax*4]
mov edx, eax
shr edx, 0x10
movsx ebx, dx
sar eax, 1
shl edx, 0xf
sub ax, dx
mov edx, dword [ebp - 0xb8]
cwde
imul eax, esi
imul ebx, esi
shl edi, 0x10
lea ecx, [edi + ecx*2]
sar eax, 0xf
sub edx, ecx
add eax, ebx
lea ecx, [edx + eax*2]
lea eax, [ecx + 0x2000000]
cmp eax, 0x3fffffe
ja 0xd231a5
mov ebx, ecx
shr ebx, 0xa
movsx edx, bx
movsx eax, word [ebp - 0xf8]
movzx ecx, word [ebp - 0x48]
movzx esi, word [ebp - 0xd8]
imul eax, edx
movzx edx, word [ebp - 0xe8]
test eax, eax
cmovg esi, edx
cmovle ecx, ebx
movzx edx, word [ebp - 0xd8]
mov word [ebp - 0xe8], si
movzx esi, word [ebp - 0x78]
mov word [ebp - 0x48], cx
movzx ecx, word [ebp - 0xf8]
cmovg esi, edx
cmovg ecx, ebx
sub word [ebp - 0xfe], 1
mov word [ebp - 0x78], si
mov word [ebp - 0xf8], cx
jne 0xd22e68
movzx edi, word [ebp - 0x48]
mov word [ebp - 0xc2], si
sub di, cx
jne 0xd23264
movsx eax, word [ebp - 0xfc]
movzx edx, word [ebp - 0xc2]
mov esi, dword [ebp + 0xc]
cmp word [ebp - 0xfa], 0
mov word [esi + eax*2], dx
jne 0xd23249
lea ecx, [ebp - 0x30]
mov dword [ebp - 0xc0], ecx
mov eax, ecx
mov ecx, dword [ebp - 0xc0]
mov word [ebp - 0xfa], 1
movsx esi, word [ebp - 0xc2]
add ecx, 4
movsx eax, word [eax + 2]
mov dword [ebp - 0x110], ecx
mov edx, eax
mov dword [ebp - 0x104], eax
mov eax, esi
shl eax, 0xa
shl edx, 0xe
add edx, eax
mov eax, edx
shr eax, 0x10
movsx edi, ax
sar edx, 1
mov ebx, edi
shl eax, 0xf
sub dx, ax
movsx edx, dx
mov ecx, edx
imul ecx, esi
imul ebx, esi
shl edi, 0x10
lea edx, [edi + edx*2]
sar ecx, 0xf
add ecx, ebx
mov ebx, dword [ebp - 0xc0]
movsx ebx, word [ebx + 4]
mov eax, ebx
shl eax, 0xe
lea ecx, [eax + ecx*4 - 0x1000000]
mov eax, dword [ebp - 0xc0]
mov dword [ebp - 0x108], ebx
add eax, 6
mov dword [ebp - 0x114], eax
mov eax, ecx
shr eax, 0x10
movsx ebx, ax
mov dword [ebp - 0xa4], ebx
imul ebx, esi
shl eax, 0xf
sar ecx, 1
sub cx, ax
mov eax, dword [ebp - 0xc0]
movsx ecx, cx
mov dword [ebp - 0xa8], ebx
mov ebx, ecx
imul ebx, esi
movsx eax, word [eax + 6]
sar ebx, 0xf
add ebx, dword [ebp - 0xa8]
mov dword [ebp - 0x10c], eax
shl eax, 0xe
sub eax, edx
lea ebx, [eax + ebx*4]
mov eax, ebx
shr eax, 0x10
movsx edi, ax
sar ebx, 1
mov edx, edi
shl eax, 0xf
sub bx, ax
movsx ebx, bx
mov eax, ebx
imul eax, esi
imul edx, esi
sar eax, 0xf
add eax, edx
mov dword [ebp - 0x11c], eax
mov eax, dword [ebp - 0x114]
movsx edx, word [eax + 2]
shl edx, 0xe
shl dword [ebp - 0xa4], 0x10
mov eax, dword [ebp - 0xa4]
shl edi, 0x10
lea ebx, [edi + ebx*2]
lea ecx, [eax + ecx*2]
sub edx, ecx
mov ecx, dword [ebp - 0x11c]
lea eax, [edx + ecx*4]
mov edx, eax
shr edx, 0x10
movsx ecx, dx
sar eax, 1
shl edx, 0xf
sub ax, dx
cwde
imul ecx, esi
imul eax, esi
mov esi, dword [ebp - 0x110]
movsx edx, word [esi + 6]
sar eax, 0xf
add eax, ecx
shl edx, 0xd
sub edx, ebx
lea edx, [edx + eax*2]
lea eax, [edx + 0x2000000]
cmp eax, 0x3fffffe
ja 0xd2322d
shr edx, 0xa
mov word [ebp - 0x58], dx
movzx ecx, word [ebp - 0xc2]
add word [ebp - 0xfc], 1
mov word [ebp - 0x5a], cx
jmp 0xd22ca5
cmp ecx, 0x2000000
mov eax, 0xffff8000
mov ebx, 0x7fff
mov edx, 0x7fff
cmovl ebx, eax
mov eax, 0xffff8000
cmovl edx, eax
jmp 0xd22f7f
test dl, dl
je 0xd23222
mov ebx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
movzx eax, word [ebx]
mov word [esi], ax
movzx eax, word [ebx + 2]
mov word [esi + 2], ax
movzx eax, word [ebx + 4]
mov word [esi + 4], ax
movzx eax, word [ebx + 6]
mov word [esi + 6], ax
movzx eax, word [ebx + 8]
mov word [esi + 8], ax
movzx eax, word [ebx + 0xa]
mov word [esi + 0xa], ax
movzx eax, word [ebx + 0xc]
mov word [esi + 0xc], ax
movzx eax, word [ebx + 0xe]
mov word [esi + 0xe], ax
movzx eax, word [ebx + 0x10]
mov word [esi + 0x10], ax
movzx eax, word [ebx + 0x12]
mov word [esi + 0x12], ax
add esp, 0x12c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp edx, 0x2000000
mov eax, 0xffff8000
mov edx, 0x7fff
cmovl edx, eax
mov word [ebp - 0x58], dx
jmp 0xd2318d
lea ebx, [ebp - 0x24]
mov eax, ebx
mov ecx, ebx
mov word [ebp - 0xfa], 0
mov dword [ebp - 0xc0], ebx
jmp 0xd23030
mov eax, edi
mov ebx, edi
shr ax, 0xf
sub bx, ax
mov eax, ebx
sar bx, 0xf
xor ebx, eax
movsx ebx, bx
mov dword [esp], ebx
call fcn.00d1ada0
mov dword [esp], 0x3fff
movsx esi, ax
mov ecx, esi
shl ebx, cl
movsx ebx, bx
mov dword [esp + 4], ebx
call fcn.00d194b0
movzx ebx, word [ebp - 0x78]
mov ecx, 0x13
sub word [ebp - 0xe8], bx
sub ecx, esi
movsx edx, word [ebp - 0xe8]
cwde
imul eax, edx
sar eax, cl
mov edx, eax
neg edx
add di, 1
cmovle eax, edx
movsx edx, word [ebp - 0xf8]
cwde
imul eax, edx
sar eax, 0xa
sub bx, ax
mov word [ebp - 0xc2], bx
jmp 0xd22ff3
cmp edx, 0x2000000
mov eax, 0xffff8000
mov ebx, 0x7fff
cmovl ebx, eax
mov word [ebp - 0x58], bx
jmp 0xd22c28