Function at 0x475c10
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x8840
call fcn.004b6550
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 edi, eax
mov eax, ecx
cdq
idiv dword [esp + 0x8860]
mov ecx, dword [esp + 0x8854]
mov dword [esp + 0x28], edi
mov esi, eax
lea eax, [edi + ecx]
test eax, eax
mov dword [esp + 0x24], esi
mov dword [esp + 0x48], eax
jl 0x4761fa
mov eax, dword [0x62bdbc]
sub ecx, edi
cmp ecx, eax
mov dword [esp + 0x4c], ecx
jge 0x4761fa
mov edx, dword [esp + 0x8858]
lea eax, [esi + edx]
test eax, eax
jl 0x4761fa
mov eax, dword [0x62bdb8]
sub edx, esi
cmp edx, eax
mov dword [esp + 0x34], edx
jge 0x4761fa
mov eax, edi
neg eax
cmp eax, edi
mov dword [esp + 0x3c], eax
jge 0x475cf3
mov esi, eax
lea ecx, [eax + edi]
imul esi, ebx
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 + 0x4c], edx
mov dword [esp + ecx + 0x44c], eax
dec edi
jne 0x475cb3
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x34]
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x28]
mov ecx, ebp
imul ecx, ebp
test edi, edi
mov dword [esp + 0x44], ecx
jle 0x475d02
mov eax, edi
add eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [0x62bd84]
cmp eax, 8
jne 0x475f52
lea ecx, [esp + 0x850]
mov dword [esp + 0x10], ecx
mov ecx, esi
neg ecx
cmp ecx, esi
mov dword [esp + 0x1c], ecx
jge 0x475e9e
mov esi, ecx
imul esi, dword [esp + 0x8860]
mov dword [esp + 0x14], esi
mov eax, esi
mov ebx, dword [esp + 0x3c]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov edx, eax
imul edx, eax
imul eax, dword [esp + 0x8868]
shl eax, 1
cmp ebx, edi
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
jge 0x475e7a
mov eax, dword [esp + 0x44]
add edi, ebx
sub eax, edx
mov dword [esp + 0x38], eax
shl edi, 2
jmp 0x475d85
mov eax, dword [esp + 0x38]
mov ebp, dword [esp + edi + 0x50]
sub eax, ebp
js 0x475dca
mov esi, dword [esp + 0x8868]
xor ecx, ecx
mov cl, byte [eax + 0x4c792c]
mov eax, dword [esp + edi + 0x450]
cdq
add ecx, esi
idiv ecx
mov edx, dword [esp + 0x8854]
mov esi, eax
mov eax, dword [esp + 0x2c]
add esi, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x8858]
add eax, ecx
mov ecx, 1
jmp 0x475ddf
mov edx, dword [esp + 0x8854]
mov eax, dword [esp + 0x8858]
add eax, ecx
xor ecx, ecx
lea esi, [ebx + edx]
cmp esi, dword [0x62bdbc]
jae 0x475e54
cmp eax, dword [0x62bdb8]
jae 0x475e54
mov edx, dword [0x62bdc0]
imul edx, eax
add edx, dword [0x62bdc4]
test ecx, ecx
mov al, byte [edx + esi]
mov byte [esp + 0x20], al
je 0x475e47
mov ecx, dword [esp + 0x30]
xor eax, eax
mov al, byte [ecx + ebp + 0x4c792c]
mov ecx, dword [esp + 0x8864]
mov edx, eax
mov eax, ecx
sub eax, edx
shl eax, 4
cdq
idiv ecx
cmp eax, 0xf
jl 0x475e33
mov eax, 0xf
mov ecx, dword [esp + 0x20]
shl eax, 8
and ecx, 0xff
mov al, byte [eax + ecx + 0x61b380]
mov ecx, dword [esp + 0x10]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x10], ecx
jmp 0x475e60
mov eax, dword [esp + 0x10]
mov byte [eax], 0
inc eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x1c]
inc ebx
add edi, 4
cmp ebx, eax
jl 0x475d81
mov esi, dword [esp + 0x14]
mov edi, eax
mov edx, dword [esp + 0x8860]
mov eax, dword [esp + 0x24]
inc ecx
add esi, edx
cmp ecx, eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], esi
jl 0x475d3f
mov edx, dword [esp + 0x34]
mov esi, eax
mov ebx, dword [esp + 0x18]
mov eax, edx
xor ecx, ecx
add esi, esi
test eax, eax
jge 0x475eb4
mov ecx, eax
add esi, eax
neg ecx
xor eax, eax
mov edx, dword [0x62bdb8]
lea edi, [esi + eax]
cmp edi, edx
jl 0x475ec5
sub edx, eax
mov esi, edx
mov edx, dword [0x62bdc0]
mov ebp, dword [esp + 0x18]
imul edx, eax
imul ecx, ebp
mov eax, dword [0x62bdc4]
mov edi, dword [esp + 0x4c]
add edx, eax
add edx, edi
mov eax, edx
lea edx, [esp + ecx + 0x850]
test edi, edi
jge 0x475ef8
sub eax, edi
lea ebx, [edi + ebp]
sub edx, edi
jmp 0x475f0a
mov ecx, dword [0x62bdbc]
mov ebp, dword [esp + 0x48]
cmp ebp, ecx
jl 0x475f0a
sub ecx, edi
mov ebx, ecx
mov ecx, esi
dec esi
test ecx, ecx
jle 0x4761fa
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 [0x62bdc0]
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
add eax, edi
add edx, esi
dec ecx
mov dword [esp + 0x14], ecx
jne 0x475f1a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8840
ret
mov ecx, dword [0x4d1228]
mov edi, dword [0x4d121c]
mov eax, ecx
mov ebp, dword [esp + 0x24]
shr eax, 2
and eax, ecx
mov ecx, dword [0x4d1210]
mov dword [esp + 0x20], eax
mov eax, edi
shr eax, 3
and eax, edi
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, ebp
neg ecx
cmp ecx, ebp
mov dword [esp + 0x40], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x1c], ecx
jge 0x476147
mov esi, ecx
imul esi, dword [esp + 0x8860]
mov dword [esp + 0x14], esi
mov eax, esi
mov ebx, dword [esp + 0x3c]
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 + 0x2c], eax
mov eax, dword [esp + 0x28]
cmp ebx, eax
mov dword [esp + 0x30], edx
jge 0x47612d
lea ebp, [ebx + eax]
shl ebp, 2
jmp 0x475ffd
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x44]
mov esi, dword [esp + ebp + 0x50]
sub eax, esi
sub eax, edx
js 0x476048
mov esi, dword [esp + 0x8868]
xor ecx, ecx
mov cl, byte [eax + 0x4c792c]
mov eax, dword [esp + ebp + 0x450]
cdq
add ecx, esi
idiv ecx
mov edx, dword [esp + 0x8854]
mov esi, eax
mov eax, dword [esp + 0x2c]
add esi, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x8858]
add eax, ecx
mov ecx, 1
jmp 0x47605e
mov eax, dword [esp + 0x8854]
mov edx, dword [esp + 0x8858]
lea esi, [ebx + eax]
lea eax, [ecx + edx]
xor ecx, ecx
cmp esi, dword [0x62bdbc]
jae 0x476101
cmp eax, dword [0x62bdb8]
jae 0x476101
mov edx, dword [0x62bdc0]
imul edx, eax
mov eax, dword [0x62bdc4]
add eax, edx
test ecx, ecx
mov ax, word [eax + esi*2]
je 0x4760f1
mov ecx, dword [0x4d1228]
and eax, 0xffff
mov edx, eax
mov esi, dword [esp + 0x38]
and edx, ecx
mov ecx, dword [esp + 0x20]
and ecx, 0xffff
and esi, 0xffff
sub edx, ecx
mov ecx, eax
and ecx, edi
add ecx, esi
mov esi, dword [0x4d1210]
and eax, esi
mov esi, dword [esp + 0x40]
and esi, 0xffff
add eax, esi
cmp edi, ecx
mov esi, edi
jb 0x4760d5
mov esi, ecx
mov ecx, dword [0x4d1210]
cmp ecx, eax
jae 0x4760e1
mov eax, ecx
xor ecx, ecx
test edx, edx
setl cl
dec ecx
and ecx, edx
or ecx, eax
or ecx, esi
mov eax, ecx
mov ecx, dword [esp + 0x10]
mov word [ecx], ax
add ecx, 2
mov dword [esp + 0x10], ecx
jmp 0x476111
mov eax, dword [esp + 0x10]
mov word [eax], 0
add eax, 2
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x28]
inc ebx
add ebp, 4
cmp ebx, eax
jl 0x475ff5
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x24]
mov edx, dword [esp + 0x8860]
inc ecx
add esi, edx
cmp ecx, ebp
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], esi
jl 0x475fb8
mov eax, dword [esp + 0x34]
mov edi, dword [esp + 0x18]
xor ecx, ecx
lea ebx, [ebp + ebp]
test eax, eax
jge 0x476161
mov ecx, eax
add ebx, eax
neg ecx
xor eax, eax
mov edx, dword [0x62bdb8]
lea esi, [ebx + eax]
cmp esi, edx
jl 0x476172
sub edx, eax
mov ebx, edx
imul eax, dword [0x62bdc0]
imul ecx, dword [esp + 0x18]
mov ebp, dword [esp + 0x4c]
mov edx, dword [0x62bdc4]
lea esi, [ebp + ebp]
add eax, esi
add eax, edx
lea edx, [esp + ecx*2 + 0x850]
test ebp, ebp
jge 0x4761a8
mov ecx, dword [esp + 0x18]
sub eax, esi
sub edx, esi
lea edi, [ecx + ebp]
jmp 0x4761ba
mov ecx, dword [0x62bdbc]
mov esi, dword [esp + 0x48]
cmp esi, ecx
jl 0x4761ba
sub ecx, ebp
mov edi, ecx
mov ecx, ebx
dec ebx
test ecx, ecx
jle 0x4761fa
lea ecx, [edi + edi]
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0x18]
add ecx, ecx
inc ebx
mov dword [esp + 0x20], 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 [0x62bdc0]
mov esi, dword [esp + 0x20]
add eax, edi
add edx, esi
dec ebx
jne 0x4761d3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8840
ret