Function at 0x1007d850
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
push esi
mov esi, dword [edi + 4]
mov eax, esi
cdq
mov ecx, esi
and ecx, 7
and edx, 7
mov ebx, 0x80
add eax, edx
sar ebx, cl
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
sar eax, 3
mov al, byte [eax + edx]
test al, bl
jne 0x1007d88e
mov eax, dword [esp + 0x2c]
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
mov ecx, dword [ebp + 0x28]
test ecx, ecx
jne 0x1007d899
xor eax, eax
jmp 0x1007d8a1
mov eax, dword [ebp + 0x2c]
sub eax, ecx
sar eax, 3
add esi, 1
cmp esi, eax
jne 0x1007d8b1
mov ecx, dword [ebp + 0x58]
mov dword [esp + 0xc], ecx
jmp 0x1007d8b8
mov edx, dword [ebp + 0x54]
mov dword [esp + 0xc], edx
mov eax, dword [esp + 0x34]
mov ebx, dword [esp + 0xc]
push eax
push ebx
mov ecx, edi
lea eax, [esp + 0x3c]
call fcn.1007d5a0
mov cl, byte [eax]
mov edx, dword [esp + 0x44]
add esp, 8
mov byte [esp + 0x1c], cl
mov al, byte [eax + 1]
and edx, 4
mov byte [esp + 0x18], al
mov dword [esp + 0x10], edx
je 0x1007d8ee
test cl, cl
je 0x1007d881
cmp dword [esp + 0x30], 0
jle 0x1007d962
test al, al
jne 0x1007d962
mov esi, dword [esp + 0x28]
mov ecx, dword [esi + 4]
test ecx, ecx
jne 0x1007d908
xor eax, eax
jmp 0x1007d910
mov eax, dword [esi + 8]
sub eax, ecx
sar eax, 2
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x1007d957
xor ebp, ebp
test ebx, ebx
jle 0x1007d957
mov edi, edi
mov ecx, dword [edi + 8]
test dword [ecx + ebp*8 + 4], 0xc000
jne 0x1007d94a
mov eax, dword [edi + 4]
movzx edx, bp
shl edx, 0x13
and eax, 0x7ffff
or edx, eax
lea ebx, [esp + 0x3c]
mov dword [esp + 0x3c], edx
call fcn.1007eb90
add ebp, 1
cmp ebp, dword [esp + 0xc]
jl 0x1007d920
mov ecx, dword [esp + 0x2c]
mov eax, ecx
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
xor ebp, ebp
test ebx, ebx
jle 0x1007da5f
mov ecx, dword [edi + 8]
test dword [ecx + ebp*8 + 4], 0xc000
jne 0x1007da4e
mov eax, dword [edi]
test eax, eax
je 0x1007da16
mov ecx, dword [esp + 0x38]
cmp eax, ecx
je 0x1007da16
cmp byte [esp + 0x18], 0
jne 0x1007da16
test byte [esp + 0x3c], 0x20
je 0x1007da16
sub eax, ecx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jne 0x1007d9df
mov esi, dword [esp + 0x24]
mov eax, esi
call fcn.100603a0
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x1007d957
mov eax, dword [edi + 4]
movzx edx, bp
shl edx, 0x13
and eax, 0x7ffff
or edx, eax
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], edx
call fcn.1007eb90
jmp 0x1007da4e
mov esi, dword [esp + 0x28]
mov eax, esi
call fcn.100603a0
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x1007d957
mov edx, dword [edi + 4]
movzx ecx, bp
shl ecx, 0x13
and edx, 0x7ffff
or ecx, edx
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], ecx
call fcn.1007eb90
jmp 0x1007da4e
mov ecx, dword [edi + 4]
mov esi, dword [esp + 0x20]
movzx eax, bp
shl eax, 0x13
and ecx, 0x7ffff
or eax, ecx
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], eax
call fcn.1007eb90
mov eax, dword [esp + 0x2c]
sub eax, 1
cmp dword [esp + 0x30], 0
mov dword [esp + 0x2c], eax
jg 0x1007da4e
test eax, eax
jle 0x1007da7d
add ebp, 1
cmp ebp, dword [esp + 0xc]
jl 0x1007d96c
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x1007da72
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
test edx, edx
jne 0x1007da7d
mov edx, dword [esp + 0x24]
mov ecx, dword [edx + 4]
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28