Function at 0x476880
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x8840
call fcn.004b8770
push ebx
push ebp
mov ebp, dword [esp + 0x885c]
mov ebx, dword [esp + 0x8854]
mov ecx, ebp
push esi
shl ecx, 8
mov eax, ecx
push edi
cdq
idiv ebx
mov esi, eax
mov eax, ecx
cdq
idiv dword [esp + 0x8860]
mov ecx, dword [esp + 0x8854]
mov dword [esp + 0x20], esi
mov edx, eax
lea eax, [esi + ecx]
test eax, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x48], eax
jl 0x476e6f
mov eax, dword [0x60879c]
sub ecx, esi
cmp ecx, eax
mov dword [esp + 0x2c], ecx
jge 0x476e6f
mov ecx, dword [esp + 0x8858]
lea eax, [edx + ecx]
test eax, eax
jl 0x476e6f
mov edi, dword [0x608798]
sub ecx, edx
cmp ecx, edi
mov dword [esp + 0x34], ecx
jge 0x476e6f
mov eax, esi
neg eax
cmp eax, esi
mov dword [esp + 0x44], eax
jge 0x47696a
mov edi, dword [esp + 0x20]
mov esi, eax
imul esi, ebx
lea ecx, [edi + eax]
shl ecx, 2
sub edi, eax
mov eax, esi
add ecx, 4
cdq
and edx, 0xff
add esi, ebx
add eax, edx
sar eax, 8
mov edx, eax
imul edx, eax
imul eax, dword [esp + 0x8868]
shl eax, 1
mov dword [esp + ecx + 0x44c], edx
mov dword [esp + ecx + 0x4c], eax
dec edi
jne 0x476928
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x34]
mov edi, dword [0x608798]
mov edx, dword [esp + 0x24]
mov esi, ebp
imul esi, ebp
mov dword [esp + 0x4c], esi
mov esi, dword [esp + 0x20]
test esi, esi
jle 0x47697d
mov eax, esi
add eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [0x608764]
cmp eax, 8
jne 0x476bd5
mov esi, edx
lea eax, [esp + 0x850]
neg esi
cmp esi, edx
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], esi
jge 0x476b25
mov ecx, esi
imul ecx, dword [esp + 0x8860]
mov dword [esp + 0x14], ecx
mov eax, ecx
mov edi, dword [esp + 0x44]
cdq
and edx, 0xff
add eax, edx
mov edx, dword [esp + 0x20]
sar eax, 8
mov ebx, eax
imul ebx, eax
imul eax, dword [esp + 0x8868]
shl eax, 1
cmp edi, edx
mov dword [esp + 0x3c], eax
jge 0x476afb
add edx, edi
shl edx, 2
mov dword [esp + 0x28], edx
mov ebp, dword [esp + edx + 0x450]
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + edx + 0x50]
sub ecx, ebp
sub ecx, ebx
js 0x476a45
mov esi, dword [esp + 0x8868]
xor edx, edx
mov dl, byte [ecx + 0x4cb918]
mov ecx, edx
cdq
add ecx, esi
idiv ecx
mov edx, dword [esp + 0x8854]
mov esi, eax
mov eax, dword [esp + 0x3c]
add esi, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x8858]
mov edx, dword [esp + 0x28]
add eax, ecx
mov ecx, 1
jmp 0x476a5e
mov eax, dword [esp + 0x8854]
mov ecx, dword [esp + 0x8858]
lea esi, [edi + eax]
mov eax, dword [esp + 0x1c]
add eax, ecx
xor ecx, ecx
cmp esi, dword [0x60879c]
jae 0x476ad3
cmp eax, dword [0x608798]
jae 0x476ad3
imul eax, dword [0x6087a0]
add eax, esi
mov esi, dword [0x6087a4]
test ecx, ecx
mov al, byte [eax + esi]
mov byte [esp + 0x30], al
je 0x476ac6
xor ecx, ecx
mov cl, byte [ebx + ebp + 0x4cb918]
mov edx, ecx
mov ecx, dword [esp + 0x8864]
mov eax, ecx
sub eax, edx
shl eax, 4
cdq
idiv ecx
cmp eax, 0xf
jl 0x476aae
mov eax, 0xf
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x28]
shl eax, 8
and ecx, 0xff
mov al, byte [eax + ecx + 0x5f7d60]
mov ecx, dword [esp + 0x10]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x10], ecx
jmp 0x476adf
mov eax, dword [esp + 0x10]
mov byte [eax], 0
inc eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
inc edi
add edx, 4
cmp edi, eax
mov dword [esp + 0x28], edx
jl 0x4769f4
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x8860]
mov eax, dword [esp + 0x24]
inc esi
add ecx, edx
cmp esi, eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x14], ecx
jl 0x4769ba
mov ecx, dword [esp + 0x34]
mov edi, dword [0x608798]
mov edx, eax
mov ebx, dword [esp + 0x18]
mov eax, ecx
xor ecx, ecx
lea esi, [edx + edx]
test eax, eax
jge 0x476b3c
mov ecx, eax
add esi, eax
neg ecx
xor eax, eax
lea edx, [esi + eax]
cmp edx, edi
jl 0x476b47
sub edi, eax
mov esi, edi
imul eax, dword [0x6087a0]
mov edi, dword [esp + 0x2c]
mov edx, dword [0x6087a4]
add eax, edi
mov edi, dword [esp + 0x18]
imul ecx, edi
add eax, edx
lea edx, [esp + ecx + 0x850]
mov ecx, dword [esp + 0x2c]
test ecx, ecx
jge 0x476b7b
sub eax, ecx
lea ebx, [ecx + edi]
sub edx, ecx
jmp 0x476b8d
mov edi, dword [0x60879c]
mov ebp, dword [esp + 0x48]
cmp ebp, edi
jl 0x476b8d
sub edi, ecx
mov ebx, edi
mov ecx, esi
dec esi
test ecx, ecx
jle 0x476e6f
inc esi
mov dword [esp + 0x14], esi
mov ecx, ebx
mov esi, edx
mov ebp, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x6087a0]
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
add eax, edi
add edx, esi
dec ecx
mov dword [esp + 0x14], ecx
jne 0x476b9d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8840
ret
mov ecx, dword [0x4d4b98]
mov ebp, dword [0x4d4b8c]
mov eax, ecx
mov esi, dword [esp + 0x24]
shr eax, 2
and eax, ecx
mov ecx, dword [0x4d4b80]
mov dword [esp + 0x28], eax
mov eax, ebp
shr eax, 3
and eax, ebp
mov dword [esp + 0x38], eax
mov eax, 0xaaaaaaab
mul ecx
shr edx, 1
mov eax, edx
lea edx, [esp + 0x850]
and eax, ecx
mov ecx, esi
neg ecx
cmp ecx, esi
mov dword [esp + 0x40], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x1c], ecx
jge 0x476dba
mov ebx, ecx
imul ebx, dword [esp + 0x8860]
mov dword [esp + 0x14], ebx
mov eax, ebx
mov edi, dword [esp + 0x44]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov edx, eax
imul edx, eax
imul eax, dword [esp + 0x8868]
shl eax, 1
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x20]
cmp edi, eax
mov dword [esp + 0x30], edx
jge 0x476da0
lea ebx, [eax + edi]
shl ebx, 2
jmp 0x476c7c
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x4c]
mov esi, dword [esp + ebx + 0x450]
mov eax, dword [esp + ebx + 0x50]
sub ecx, esi
sub ecx, edx
js 0x476cc9
mov esi, dword [esp + 0x8868]
xor edx, edx
mov dl, byte [ecx + 0x4cb918]
mov ecx, edx
cdq
add ecx, esi
idiv ecx
mov edx, dword [esp + 0x8854]
mov esi, eax
mov eax, dword [esp + 0x3c]
add esi, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x8858]
mov edx, 1
add eax, ecx
jmp 0x476ce3
mov eax, dword [esp + 0x8854]
mov ecx, dword [esp + 0x8858]
mov edx, dword [esp + 0x1c]
lea esi, [edi + eax]
lea eax, [edx + ecx]
xor edx, edx
cmp esi, dword [0x60879c]
jae 0x476d74
cmp eax, dword [0x608798]
jae 0x476d74
imul eax, dword [0x6087a0]
mov ecx, dword [0x6087a4]
add ecx, eax
test edx, edx
mov cx, word [ecx + esi*2]
je 0x476d6b
mov edx, dword [0x4d4b98]
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x38]
and ecx, 0xffff
and edx, ecx
and eax, 0xffff
sub edx, eax
mov eax, ebp
and eax, ecx
and esi, 0xffff
add eax, esi
mov esi, dword [0x4d4b80]
and esi, ecx
mov ecx, dword [esp + 0x40]
and ecx, 0xffff
add esi, ecx
cmp ebp, eax
jae 0x476d51
mov eax, ebp
mov ecx, dword [0x4d4b80]
cmp ecx, esi
jae 0x476d5d
mov esi, ecx
xor ecx, ecx
test edx, edx
setl cl
dec ecx
and ecx, edx
or ecx, esi
or ecx, eax
mov eax, dword [esp + 0x10]
mov word [eax], cx
jmp 0x476d7d
mov eax, dword [esp + 0x10]
mov word [eax], 0
add eax, 2
inc edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
add ebx, 4
cmp edi, eax
jl 0x476c78
mov esi, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x8860]
inc ecx
add ebx, edx
cmp ecx, esi
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], ebx
jl 0x476c3b
mov eax, dword [esp + 0x34]
mov ebx, dword [esp + 0x18]
xor ecx, ecx
lea edi, [esi + esi]
test eax, eax
jge 0x476dd3
mov ecx, eax
add edi, eax
neg ecx
xor eax, eax
mov edx, dword [0x608798]
lea esi, [edi + eax]
cmp esi, edx
jl 0x476de4
sub edx, eax
mov edi, edx
imul eax, dword [0x6087a0]
imul ecx, dword [esp + 0x18]
mov ebp, dword [esp + 0x2c]
mov edx, dword [0x6087a4]
add eax, edx
lea edx, [esp + ecx*2 + 0x850]
lea esi, [ebp + ebp]
add eax, esi
test ebp, ebp
jge 0x476e1b
mov ecx, dword [esp + 0x18]
sub eax, esi
sub edx, esi
lea ebx, [ebp + ecx]
jmp 0x476e2d
mov ecx, dword [0x60879c]
mov esi, dword [esp + 0x48]
cmp esi, ecx
jl 0x476e2d
sub ecx, ebp
mov ebx, ecx
mov ecx, edi
dec edi
test ecx, ecx
jle 0x476e6f
lea ecx, [ebx + ebx]
lea ebx, [edi + 1]
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0x18]
add ecx, ecx
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x40]
mov esi, edx
mov ebp, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [0x6087a0]
mov esi, dword [esp + 0x38]
add eax, edi
add edx, esi
dec ebx
jne 0x476e48
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8840
ret