Function at 0x407a00
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x308
xor eax, eax
mov ecx, 0xc0
push ebx
push ebp
mov ebp, dword [esp + 0x314]
push esi
push edi
lea edi, [esp + 0x18]
cmp word [ebp + 0x50], ax
mov dword [ebp + 0x54], 0
rep stosd dword es:[edi], eax
je 0x407ea3
mov esi, dword [ebp + 0x188]
mov ax, word [esi + 0xc]
test eax, 0x3f0
jne 0x407ea3
mov cl, byte [ebp + 0x1c]
mov ebx, 1
shl ebx, cl
cmp ax, 1
mov dword [esp + 0x10], ebx
jne 0x407a87
mov byte [esp + 0x218], 0
mov byte [esp + 0x118], 0
mov byte [esp + 0x18], 0
mov byte [esp + 0x219], 0xff
mov byte [esp + 0x119], 0xff
mov byte [esp + 0x19], 0xff
jmp 0x407b0c
cmp ax, 2
jne 0x407ace
mov ax, word [esi + 0x1c]
xor edi, edi
test ax, ax
jle 0x407b0c
movsx ecx, di
movsx ebp, ax
mov eax, ecx
dec ebp
shl eax, 8
sub eax, ecx
cdq
idiv ebp
inc edi
mov byte [esp + ecx + 0x218], al
mov byte [esp + ecx + 0x118], al
mov byte [esp + ecx + 0x18], al
mov ax, word [esi + 0x1c]
cmp di, ax
jl 0x407a98
mov ebp, dword [esp + 0x31c]
jmp 0x407b0c
xor edi, edi
cmp word [esi + 0x1c], di
jle 0x407b0c
mov ecx, dword [esi + 0x20]
movsx eax, di
inc edi
mov dl, byte [eax + ecx]
mov byte [esp + eax + 0x18], dl
mov ecx, dword [esi + 0x20]
mov dl, byte [eax + ecx + 0x100]
mov byte [esp + eax + 0x118], dl
mov ecx, dword [esi + 0x20]
mov dl, byte [eax + ecx + 0x200]
mov byte [esp + eax + 0x218], dl
cmp di, word [esi + 0x1c]
jl 0x407ad6
test byte [ebp + 0x50], 1
je 0x407b50
test bx, bx
jle 0x407b50
lea eax, [esp + 0x118]
movsx esi, bx
mov dl, byte [eax - 0x100]
or cl, 0xff
sub cl, dl
or dl, 0xff
mov byte [eax - 0x100], cl
mov cl, byte [eax]
sub dl, cl
or cl, 0xff
mov byte [eax], dl
mov dl, byte [eax + 0x100]
sub cl, dl
mov byte [eax + 0x100], cl
inc eax
dec esi
jne 0x407b21
mov ax, word [ebp + 0x52]
mov esi, 1
mov cl, al
shl esi, cl
mov cl, byte [ebp + 0x50]
dec esi
test cl, 0xe
jne 0x407b73
cmp ax, 8
lea eax, [ebx + ebx*2]
jle 0x407b76
shl eax, 1
jmp 0x407b76
lea eax, [ebx + ebx]
movsx edx, ax
push 1
push edx
call fcn.004b26c8
add esp, 8
mov dword [ebp + 0x54], eax
test eax, eax
jne 0x407b9a
pop edi
pop esi
pop ebp
mov ax, 1
pop ebx
add esp, 0x308
ret
mov cx, word [ebp + 0x50]
test cl, 2
je 0x407bc0
lea ecx, [esp + 0x18]
push ebx
push ecx
push eax
call fcn.00407ec0
add esp, 0xc
xor ax, ax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x308
ret
test cl, 4
je 0x407be2
lea edx, [esp + 0x18]
push ebx
push edx
push eax
call fcn.00407f80
add esp, 0xc
xor ax, ax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x308
ret
test cl, 8
je 0x407c04
lea ecx, [esp + 0x18]
push ebx
push ecx
push eax
call fcn.00408060
add esp, 0xc
xor ax, ax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x308
ret
test cl, 0x10
je 0x407d62
cmp word [ebp + 0x52], 8
jg 0x407cdf
and ecx, 0x200
test cx, cx
je 0x407c32
movsx ecx, bx
mov dword [esp + 0x14], eax
lea ebp, [ecx + eax]
lea ebx, [ecx + ebp]
jmp 0x407c43
movsx ecx, word [esp + 0x10]
mov ebx, eax
lea ebp, [ecx + ebx]
lea edx, [ecx + ebp]
mov dword [esp + 0x14], edx
cmp word [esp + 0x10], 0
jle 0x407ea3
movsx edi, si
lea esi, [esp + 0x118]
mov dword [esp + 0x10], ecx
xor ecx, ecx
mov eax, 0x80808081
mov cl, byte [esi - 0x100]
imul ecx, edi
imul ecx
add edx, ecx
xor ecx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x80808081
mov byte [ebx], dl
mov cl, byte [esi]
imul ecx, edi
imul ecx
add edx, ecx
mov eax, 0x80808081
sar edx, 7
mov ecx, edx
inc ebx
shr ecx, 0x1f
add edx, ecx
xor ecx, ecx
mov byte [ebp], dl
mov cl, byte [esi + 0x100]
imul ecx, edi
imul ecx
add edx, ecx
inc ebp
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [esp + 0x14]
mov byte [eax], dl
inc eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
inc esi
dec eax
mov dword [esp + 0x10], eax
jne 0x407c5d
pop edi
pop esi
pop ebp
xor ax, ax
pop ebx
add esp, 0x308
ret
and ecx, 0x200
test cx, cx
je 0x407cf7
movsx ecx, bx
mov edi, eax
lea esi, [edi + ecx*2]
lea ebp, [esi + ecx*2]
jmp 0x407d03
movsx ecx, bx
mov ebp, eax
lea esi, [ebp + ecx*2]
lea edi, [esi + ecx*2]
test bx, bx
jle 0x407ea3
lea eax, [esp + 0x118]
mov edx, ecx
movzx cx, byte [eax - 0x100]
xor ebx, ebx
add ebp, 2
mov bh, cl
add esi, 2
or ebx, ecx
add edi, 2
mov word [ebp - 2], bx
xor ebx, ebx
movzx cx, byte [eax]
mov bh, cl
or ebx, ecx
mov word [esi - 2], bx
xor ebx, ebx
movzx cx, byte [eax + 0x100]
mov bh, cl
or ebx, ecx
inc eax
mov word [edi - 2], bx
dec edx
jne 0x407d15
pop edi
pop esi
pop ebp
xor ax, ax
pop ebx
add esp, 0x308
ret
cmp word [ebp + 0x52], 8
jg 0x407e38
and ecx, 0x200
test cx, cx
je 0x407d84
lea ebp, [eax + 1]
mov dword [esp + 0x14], eax
lea ebx, [ebp + 1]
jmp 0x407d90
mov ebx, eax
lea ebp, [ebx + 1]
lea ecx, [ebp + 1]
mov dword [esp + 0x14], ecx
cmp word [esp + 0x10], 0
jle 0x407ea3
movsx edx, word [esp + 0x10]
movsx edi, si
lea esi, [esp + 0x118]
mov dword [esp + 0x10], edx
xor ecx, ecx
mov eax, 0x80808081
mov cl, byte [esi - 0x100]
add ebx, 3
imul ecx, edi
imul ecx
add edx, ecx
xor ecx, ecx
sar edx, 7
mov eax, edx
add ebp, 3
shr eax, 0x1f
add edx, eax
mov eax, 0x80808081
mov byte [ebx - 3], dl
mov cl, byte [esi]
imul ecx, edi
imul ecx
add edx, ecx
mov eax, 0x80808081
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
xor ecx, ecx
mov byte [ebp - 3], dl
mov cl, byte [esi + 0x100]
imul ecx, edi
imul ecx
add edx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [esp + 0x14]
inc esi
mov byte [eax], dl
add eax, 3
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x407daf
pop edi
pop esi
pop ebp
xor ax, ax
pop ebx
add esp, 0x308
ret
and ecx, 0x200
test cx, cx
je 0x407e4d
mov ebp, eax
lea esi, [ebp + 4]
lea edi, [esi + 4]
jmp 0x407e55
mov edi, eax
lea esi, [edi + 4]
lea ebp, [esi + 4]
test bx, bx
jle 0x407ea3
lea eax, [esp + 0x118]
movsx edx, bx
movzx cx, byte [eax - 0x100]
xor ebx, ebx
add edi, 6
mov bh, cl
add esi, 6
or ebx, ecx
add ebp, 6
mov word [edi - 6], bx
xor ebx, ebx
movzx cx, byte [eax]
mov bh, cl
or ebx, ecx
mov word [esi - 6], bx
xor ebx, ebx
movzx cx, byte [eax + 0x100]
mov bh, cl
or ebx, ecx
inc eax
mov word [ebp - 6], bx
dec edx
jne 0x407e64
pop edi
pop esi
pop ebp
xor ax, ax
pop ebx
add esp, 0x308
ret