Function at 0x787070
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x2c
mov edi, ecx
mov ecx, dword [esp + 0x44]
mov ebp, 1
shl ebp, cl
mov dword [esp], edx
mov edx, 1
xor esi, esi
shld esi, edx, cl
shl edx, cl
xor ebx, ebx
test cl, 0x20
cmovne esi, edx
cmovne edx, ebx
mov ecx, dword [esp + 0x40]
lea eax, [ecx + ecx]
add eax, 2
add edx, eax
adc esi, 0
add edx, 8
adc esi, 0
mov eax, 0xffffffd2
cmp ecx, 0xff
ja 0x7874a5
cmp dword [esp + 0x4c], edx
sbb ebx, esi
jb 0x7874a5
mov eax, 0xffffffd4
cmp dword [esp + 0x44], 0xc
ja 0x7874a5
mov dword [esp + 8], edi
mov esi, dword [esp + 0x48]
mov edx, 0x8000
mov ecx, dword [esp + 0x44]
shl edx, cl
lea eax, [ebp - 1]
sar edx, 0x10
mov dword [esp + 4], edx
mov ecx, dword [esp + 0x40]
lea edx, [ecx + 1]
test ecx, ecx
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], edx
je 0x78719c
and edx, 0xfffffffe
mov dword [esp + 0x18], edx
mov bp, 1
xor ebx, ebx
mov ecx, eax
jmp 0x787153
mov edx, ebx
inc dl
mov esi, dword [esp + 8]
mov byte [esi + ecx*4 + 6], dl
mov esi, dword [esp + 0x48]
dec ecx
mov dx, 1
mov word [esi + ebx*2 + 2], dx
add ebx, 2
cmp dword [esp + 0x18], ebx
je 0x7871a4
mov edx, dword [esp]
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x787170
cmp dword [esp + 4], edx
mov edi, 0
cmovle ebp, edi
jmp 0x78717d
mov edx, dword [esp + 8]
mov byte [edx + ecx*4 + 6], bl
dec ecx
mov dx, 1
mov word [esi + ebx*2], dx
mov edx, dword [esp]
movsx edx, word [edx + ebx*2 + 2]
cmp edx, 0xffffffff
je 0x787130
cmp dword [esp + 4], edx
mov edi, 0
cmovle ebp, edi
jmp 0x787145
mov bp, 1
xor ebx, ebx
mov ecx, eax
test byte [esp + 0x10], 1
je 0x7871d7
mov edx, dword [esp]
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x7871c6
xor esi, esi
cmp dword [esp + 4], edx
cmovle ebp, esi
mov esi, dword [esp + 0x48]
jmp 0x7871d3
mov edx, dword [esp + 8]
mov byte [edx + ecx*4 + 6], bl
dec ecx
mov dx, 1
mov word [esi + ebx*2], dx
mov edx, dword [esp + 8]
mov esi, dword [esp + 0x44]
mov word [edx], si
mov word [edx + 2], bp
cmp ecx, eax
jne 0x787383
mov esi, dword [esp + 0x48]
mov edi, dword [esp + 0x40]
lea ecx, [esi + edi*2]
add ecx, 2
mov dword [esp + 0x10], ecx
mov edx, dword [esp + 0xc]
mov ecx, edx
shr ecx, 1
shr edx, 3
add ecx, edx
add ecx, 3
mov dword [esp + 0x20], ecx
lea ecx, [esi + edi*2]
add ecx, 0x7a
mov dword [esp + 0x24], ecx
xor esi, esi
xor edx, edx
xor edi, edi
xor ebx, ebx
jmp 0x787257
mov ecx, ebx
mov ebx, dword [esp + 4]
add ebx, ecx
mov esi, dword [esp + 0x18]
lea ecx, [esi + 1]
add edx, 0x1010101
adc edi, 0x1010101
cmp esi, dword [esp + 0x40]
mov esi, ecx
je 0x7873eb
mov ecx, dword [esp]
mov dword [esp + 0x18], esi
movsx ecx, word [ecx + esi*2]
mov esi, dword [esp + 0x10]
mov dword [esi + ebx + 4], edi
mov dword [esp + 4], ebx
mov dword [esi + ebx], edx
mov ebx, ecx
cmp ecx, 9
jl 0x787230
mov dword [esp + 0x14], edx
mov ecx, dword [esp + 4]
mov edx, dword [esp + 0x10]
lea esi, [edx + ecx]
lea edx, [ebx - 9]
mov ecx, 8
cmp edx, 0x18
jb 0x78735f
mov dword [esp + 0x28], ebx
shr edx, 3
lea ecx, [edx + 1]
mov dword [esp + 0x1c], ecx
movd xmm0, dword [esp + 0x14]
movd xmm1, edi
punpckldq xmm0, xmm1
pshufd xmm0, xmm0, 0x44
add edx, 0xfffffffd
mov ecx, edx
shr ecx, 2
inc ecx
mov ebp, edx
mov edx, ecx
and edx, 3
xor ebx, ebx
cmp ebp, 0xc
jb 0x787318
and ecx, 0xfffffffc
mov ebx, dword [esp + 0x24]
mov ebp, dword [esp + 4]
add ebp, ebx
xor ebx, ebx
nop
movdqu xmmword [ebp + ebx*8 - 0x70], xmm0
movdqu xmmword [ebp + ebx*8 - 0x60], xmm0
movdqu xmmword [ebp + ebx*8 - 0x50], xmm0
movdqu xmmword [ebp + ebx*8 - 0x40], xmm0
movdqu xmmword [ebp + ebx*8 - 0x30], xmm0
movdqu xmmword [ebp + ebx*8 - 0x20], xmm0
movdqu xmmword [ebp + ebx*8 - 0x10], xmm0
movdqu xmmword [ebp + ebx*8], xmm0
add ebx, 0x10
add ecx, 0xfffffffc
jne 0x7872e0
mov ecx, dword [esp + 0x1c]
and ecx, 0xfffffffc
test edx, edx
je 0x787346
shl ebx, 3
nop word cs:[eax + eax]
mov ebp, ebx
or ebp, 8
movdqu xmmword [esi + ebp], xmm0
movdqu xmmword [esi + ebp + 0x10], xmm0
add ebx, 0x20
dec edx
jne 0x787330
cmp dword [esp + 0x1c], ecx
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x28]
je 0x787230
lea ecx, [ecx*8 + 8]
mov edx, dword [esp + 0x14]
nop word cs:[eax + eax]
mov dword [esi + ecx], edx
mov dword [esi + ecx + 4], edi
add ecx, 8
cmp ecx, ebx
jl 0x787370
jmp 0x787230
mov ebp, edx
mov esi, dword [esp + 0xc]
mov edx, esi
shr edx, 3
shr esi, 1
add esi, edx
add esi, 3
xor edx, edx
xor ebx, ebx
jmp 0x7873af
lea edi, [ebx + 1]
cmp ebx, dword [esp + 0x40]
mov ebx, edi
je 0x78744f
mov edi, dword [esp]
cmp word [edi + ebx*2], 0
jle 0x7873a0
xor edi, edi
nop dword [eax + eax]
mov byte [ebp + edx*4 + 6], bl
nop word cs:[eax + eax]
add edx, esi
and edx, eax
cmp edx, ecx
ja 0x7873d0
inc edi
mov ebp, dword [esp]
movsx ebp, word [ebp + ebx*2]
cmp edi, ebp
mov ebp, dword [esp + 8]
jl 0x7873c0
jmp 0x7873a0
mov ecx, dword [esp + 0x20]
add ecx, ecx
mov dword [esp], ecx
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x40]
lea ecx, [ecx + edx*2]
add ecx, 3
mov dword [esp + 4], ecx
xor esi, esi
xor edi, edi
mov edx, dword [esp + 4]
mov ebp, dword [esp + 8]
nop word cs:[eax + eax]
mov ebx, edi
and ebx, eax
movzx ecx, byte [edx + esi - 1]
mov byte [ebp + ebx*4 + 6], cl
mov ecx, dword [esp + 0x20]
add ecx, edi
and ecx, eax
movzx ebx, byte [edx + esi]
mov byte [ebp + ecx*4 + 6], bl
mov ecx, dword [esp + 0xc]
add edi, dword [esp]
and edi, eax
add esi, 2
cmp esi, ecx
jb 0x787420
jmp 0x78745c
mov eax, 0xffffffff
test edx, edx
mov ecx, dword [esp + 0xc]
jne 0x7874a5
mov ebx, dword [esp + 0x44]
add ebx, 0xffffffe1
mov dword [esp], ebx
xor edx, edx
mov ebp, dword [esp + 8]
nop dword [eax]
mov eax, ecx
movzx ecx, byte [ebp + edx*4 + 6]
mov ebx, dword [esp + 0x48]
movzx esi, word [ebx + ecx*2]
lea edi, [esi + 1]
mov word [ebx + ecx*2], di
bsr ecx, esi
xor ecx, 0x1f
add ecx, dword [esp]
mov byte [ebp + edx*4 + 7], cl
shl esi, cl
mov ecx, eax
sub esi, eax
mov word [ebp + edx*4 + 4], si
inc edx
cmp eax, edx
jne 0x787470
xor eax, eax
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret