Function at 0x100787c0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9c
mov eax, dword [0x100fc008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ecx]
push ebx
push esi
push edi
test byte [eax + 0x22], 0x20
mov dword [ebp - 0x8c], eax
jne 0x10078a6f
mov edx, dword [eax + 4]
mov dword [ebp - 0x98], edx
mov ebx, dword [edx + 0x18]
test byte [ebx + 0x2c], 0x10
jne 0x10078a6f
cmp dword [edx + 0x50], 0
jne 0x10078a6f
mov edx, dword [edx + 0x38]
lea edi, [eax + 0x148]
mov eax, dword [ecx + 0xc]
xor esi, esi
push esi
push 2
xor ecx, ecx
mov dword [ebp - 0x84], edx
push 0xffffffffffffffff
mov word [eax + 0x1a], cx
lea ecx, [ebp - 0x78]
push edx
mov edx, edi
mov dword [ebp - 0x94], edi
mov dword [ebp - 0x7c], eax
mov dword [eax + 0x24], 0
call fcn.100702a0
mov edx, eax
add esp, 0x10
test edx, edx
je 0x10078877
nop dword [eax + eax]
mov ecx, dword [edx + 0x20]
mov eax, esi
or ecx, dword [edx + 0x24]
mov edi, esi
jne 0x10078862
test byte [edx + 0x12], 2
jne 0x10078879
mov esi, edx
lea ecx, [ebp - 0x78]
test edi, edi
cmovne esi, eax
call fcn.1006fff0
mov edx, eax
test edx, edx
jne 0x10078850
mov edx, esi
mov ecx, 1
test edx, edx
je 0x100788a7
mov esi, dword [ebp - 0x7c]
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x24], 0x1101
mov dword [eax], edx
mov eax, 0x21
mov word [esi + 0x28], cx
mov word [esi + 0x18], cx
mov word [esi + 0x14], ax
jmp 0x1007896a
mov edi, dword [ebx + 8]
mov dword [ebp - 0x80], edi
test edi, edi
je 0x10078a4d
cmp byte [edi + 0x36], 0
je 0x10078954
cmp dword [edi + 0x24], 0
jne 0x10078954
movzx eax, word [edi + 0x32]
cmp eax, 4
ja 0x10078954
xor ecx, ecx
xor ebx, ebx
cmp cx, ax
jae 0x10078948
nop
mov eax, dword [edi + 4]
lea ecx, [ebp - 0x78]
mov edx, dword [ebp - 0x94]
xor esi, esi
push edi
push 2
movsx eax, word [eax + ebx*2]
push eax
push dword [ebp - 0x84]
call fcn.100702a0
add esp, 0x10
test eax, eax
je 0x1007892d
mov ecx, dword [eax + 0x20]
mov edx, esi
or ecx, dword [eax + 0x24]
mov edi, esi
jne 0x1007891a
test byte [eax + 0x12], 2
jne 0x1007892f
mov esi, eax
lea ecx, [ebp - 0x78]
test edi, edi
cmovne esi, edx
call fcn.1006fff0
test eax, eax
jne 0x10078908
mov eax, esi
mov edi, dword [ebp - 0x80]
test eax, eax
je 0x10078948
mov ecx, dword [ebp - 0x7c]
mov ecx, dword [ecx + 0x2c]
mov dword [ecx + ebx*4], eax
inc ebx
movzx eax, word [edi + 0x32]
cmp ebx, eax
jl 0x100788e0
movzx eax, word [edi + 0x32]
cmp ebx, eax
je 0x100789ff
mov edi, dword [edi + 0x14]
mov dword [ebp - 0x80], edi
test edi, edi
jne 0x100788b5
mov esi, dword [ebp - 0x7c]
mov ecx, 1
cmp dword [esi + 0x24], 0
je 0x10078a6f
mov edi, dword [ebp - 0x8c]
xor eax, eax
mov ebx, dword [ebp - 0x84]
mov word [esi + 0x16], cx
mov dword [edi + 0x318], esi
mov edx, dword [edi + 0x44]
test edx, edx
jle 0x100789a6
lea ecx, [edi + 0x48]
cmp dword [ecx], ebx
je 0x10078a55
inc eax
add ecx, 4
cmp eax, edx
jl 0x10078996
xorps xmm0, xmm0
movlpd qword [ebp - 0x90], xmm0
mov edx, dword [ebp - 0x8c]
mov ecx, dword [ebp - 0x90]
mov dword [esi + 0xc], edx
mov edx, 1
mov dword [esi + 8], ecx
mov dword [edi + 0x2e4], ebx
mov eax, dword [edi + 8]
mov word [edi + 0x20], dx
test eax, eax
je 0x100789de
mov al, byte [eax]
mov byte [edi + 0x24], al
mov ecx, 0x400
test word [edi + 0x22], cx
je 0x100789ec
mov byte [edi + 0x28], dl
mov eax, edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100baa39
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x7c]
mov dword [esi + 0x24], 0x1201
test byte [edi + 0x38], 0x20
jne 0x10078a2a
mov ecx, edi
call fcn.10076270
mov ecx, dword [ebp - 0x98]
not eax
not edx
and eax, dword [ecx + 0x48]
and edx, dword [ecx + 0x4c]
or eax, edx
jne 0x10078a31
mov dword [esi + 0x24], 0x1241
movzx eax, bx
mov word [esi + 0x28], ax
mov word [esi + 0x18], ax
mov eax, 0x27
mov dword [esi + 0x1c], edi
mov word [esi + 0x14], ax
jmp 0x10078965
mov esi, dword [ebp - 0x7c]
jmp 0x1007896a
xor ecx, ecx
xor edx, edx
bts ecx, eax
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
cmovae edx, ecx
jmp 0x100789bd
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100baa39
mov esp, ebp
pop ebp
ret