Function at 0x476210
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, dword [esp + 0x18]
mov ecx, dword [0x5adbc0]
sub esp, 0x834
test eax, eax
jge 0x47623a
mov eax, ecx
mov dword [esp + 0x1c], 0x52
neg eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x18], eax
jmp 0x47624a
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], 0x50
lea eax, [ecx*4]
push ebx
and eax, 0x3ff
push ebp
shl ecx, 3
mov eax, dword [eax*4 + 0x4c692c]
and ecx, 0x3ff
cdq
and edx, 0x1fff
push esi
add eax, edx
push edi
mov esi, eax
mov eax, dword [ecx*4 + 0x4c692c]
cdq
mov ecx, dword [esp + 0x858]
and edx, 0x3ff
add eax, edx
sar eax, 0xa
add eax, 0x50
shl ecx, 8
mov dword [esp + 0x40], eax
mov eax, ecx
cdq
idiv dword [esp + 0x850]
sar esi, 0xd
add esi, 0x28
mov dword [esp + 0x85c], esi
mov ebx, eax
mov eax, ecx
cdq
idiv dword [esp + 0x854]
mov ecx, dword [esp + 0x848]
mov dword [esp + 0x38], ebx
mov edi, eax
lea eax, [ebx + ecx]
test eax, eax
mov dword [esp + 0x14], edi
jl 0x476661
mov ebp, dword [0x62bdbc]
mov edx, ecx
sub edx, ebx
cmp edx, ebp
jge 0x476661
mov ebp, dword [esp + 0x84c]
lea edx, [edi + ebp]
test edx, edx
mov dword [esp + 0x18], edx
jl 0x476661
mov edx, dword [0x62bdb8]
sub ebp, edi
cmp ebp, edx
jge 0x476661
mov edx, ebx
neg edx
mov ebp, edx
mov dword [esp + 0x1c], ebp
add ebp, ecx
test ebp, ebp
jge 0x476328
mov ebp, ecx
neg ebp
mov dword [esp + 0x1c], ebp
mov ebp, dword [esp + 0x84c]
neg edi
add ebp, edi
test ebp, ebp
mov ebp, dword [esp + 0x84c]
jge 0x476342
mov edi, ebp
neg edi
mov dword [esp + 0x24], ebx
mov ebx, dword [0x62bdbc]
cmp eax, ebx
jl 0x476356
sub ebx, ecx
mov dword [esp + 0x24], ebx
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
cmp eax, dword [0x62bdb8]
jl 0x47636e
mov ebx, dword [0x62bdb8]
sub ebx, ebp
mov eax, dword [esp + 0x38]
cmp edx, eax
jge 0x4763d6
mov esi, edx
lea ecx, [edx + eax]
imul esi, dword [esp + 0x850]
mov ebp, eax
shl ecx, 2
sub ebp, edx
mov eax, esi
add ecx, 4
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov edx, eax
imul edx, eax
imul eax, dword [esp + 0x85c]
mov dword [esp + ecx + 0x40], edx
mov edx, dword [esp + 0x850]
shl eax, 1
mov dword [esp + ecx + 0x440], eax
add esi, edx
dec ebp
jne 0x47638a
mov ebp, dword [esp + 0x84c]
mov ecx, dword [esp + 0x848]
mov esi, dword [esp + 0x85c]
mov eax, dword [esp + 0x858]
imul eax, eax
mov dword [esp + 0x3c], eax
mov eax, dword [0x62bd84]
cmp eax, 8
jne 0x476525
add ebp, edi
mov edx, dword [0x62bdc4]
imul ebp, dword [0x62bdc0]
mov eax, dword [esp + 0x1c]
add ebp, edx
add ebp, eax
add ebp, ecx
cmp edi, ebx
jge 0x476661
mov ecx, edi
imul ecx, dword [esp + 0x854]
sub ebx, edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x20], ebx
mov eax, ecx
mov edi, dword [esp + 0x24]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov edx, eax
imul edx, eax
imul eax, esi
shl eax, 1
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x1c]
cmp eax, edi
mov dword [esp + 0x14], edx
jge 0x4764f6
mov ecx, dword [esp + 0x38]
mov edi, ebp
lea esi, [eax + ecx]
shl esi, 2
sub eax, ebp
mov dword [esp + 0x18], eax
jmp 0x47646f
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x3c]
mov ebx, dword [esp + esi + 0x44]
sub eax, ebx
sub eax, edx
js 0x4764d9
mov ebx, dword [esp + 0x40]
xor ecx, ecx
mov cl, byte [eax + 0x4c792c]
mov eax, dword [esp + esi + 0x444]
cdq
add ecx, ebx
idiv ecx
mov edx, dword [esp + 0x34]
mov ebx, eax
mov eax, dword [esp + 0x30]
add ebx, edx
cdq
idiv ecx
mov edx, dword [esp + 0x28]
and ebx, 0x7f
add eax, edx
xor edx, edx
and eax, 0x7f
shl eax, 7
mov dl, byte [ebx + eax + 0x5e3ec0]
mov eax, edx
cmp eax, 4
jge 0x4764d9
mov ecx, dword [esp + 0x2c]
add eax, ecx
shl eax, 8
xor edx, edx
mov dl, byte [edi]
mov al, byte [eax + edx + 0x5d3ea0]
mov byte [edi], al
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
add esi, 4
inc edi
add ecx, edi
cmp ecx, eax
jl 0x47646b
mov esi, dword [esp + 0x85c]
mov ecx, dword [esp + 0x10]
mov edi, dword [0x62bdc0]
mov edx, dword [esp + 0x854]
mov eax, dword [esp + 0x20]
add ebp, edi
add ecx, edx
dec eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x20], eax
jne 0x476427
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x834
ret
lea edx, [edi + ebp]
mov eax, dword [esp + 0x1c]
imul edx, dword [0x62bdc0]
add eax, ecx
mov ecx, dword [0x62bdc4]
add ecx, edx
cmp edi, ebx
lea edx, [ecx + eax*2]
mov dword [esp + 0x10], edx
jge 0x476661
mov ebp, edi
imul ebp, dword [esp + 0x854]
sub ebx, edi
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], ebx
mov eax, ebp
mov ecx, dword [esp + 0x24]
cdq
and edx, 0xff
mov edi, dword [esp + 0x10]
add eax, edx
sar eax, 8
mov ebx, eax
imul ebx, eax
imul eax, esi
shl eax, 1
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x1c]
cmp eax, ecx
jge 0x476636
mov edx, dword [esp + 0x38]
lea esi, [eax + edx]
shl esi, 2
sub ecx, eax
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + esi + 0x44]
sub eax, edx
sub eax, ebx
js 0x476616
mov ebp, dword [esp + 0x40]
xor ecx, ecx
mov cl, byte [eax + 0x4c792c]
mov eax, dword [esp + esi + 0x444]
cdq
add ecx, ebp
idiv ecx
mov edx, dword [esp + 0x34]
mov ebp, eax
mov eax, dword [esp + 0x30]
add ebp, edx
cdq
idiv ecx
mov edx, dword [esp + 0x28]
and ebp, 0x7f
xor ecx, ecx
add eax, edx
and eax, 0x7f
shl eax, 7
mov cl, byte [eax + ebp + 0x5e3ec0]
mov eax, ecx
cmp eax, 4
jge 0x476616
mov edx, dword [esp + 0x2c]
mov cx, word [edi]
add eax, edx
mov edx, dword [0x61c764]
shr cx, 1
and ecx, edx
mov dx, word [eax*4 + 0x5eef40]
add dx, cx
mov word [edi], dx
mov eax, dword [esp + 0x20]
add esi, 4
add edi, 2
dec eax
mov dword [esp + 0x20], eax
jne 0x4765a0
mov esi, dword [esp + 0x85c]
mov ebp, dword [esp + 0x18]
mov eax, dword [0x62bdc0]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x854]
add edx, eax
mov eax, dword [esp + 0x14]
add ebp, ecx
dec eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], eax
jne 0x476560
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x834
ret