Function at 0x410410
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, edi
mov ebx, dword [ebp + 0xc]
cdq
idiv dword [ebp + 0x18]
mov esi, dword [ebp + 0x10]
mov ecx, eax
mov al, cl
mov byte [ebp - 0x40], cl
dec al
mov byte [ebp - 0x44], al
mov eax, ebx
cdq
idiv dword [ebp + 0x1c]
mov dl, al
mov byte [ebp - 0x3c], al
mov al, byte [ebp + 0x24]
dec dl
test al, al
mov byte [ebp - 0x48], dl
je 0x410779
mov ecx, edi
mov edi, dword [ebp + 0x20]
imul ecx, ebx
imul ecx, esi
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [ebp - 0xc], 0
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [ebp + 0x28]
mov ebx, edi
neg ebx
mov edx, ebx
mov dword [ebp - 0x18], ebx
cmp edx, edi
jg 0x4104f1
mov eax, ebx
cmp eax, edi
jg 0x4104ec
fld dword [ebp + 0x2c]
fmul dword [0x4672a4]
mov ecx, edx
imul ecx, edx
fstp dword [ebp - 0x24]
fld dword [ebp + 0x2c]
fmul dword [ebp + 0x2c]
fadd st(0), st(0)
fstp dword [ebp + 0x24]
fld dword [ebp - 0x24]
fsqrt
fstp dword [ebp - 0x1c]
mov ebx, eax
imul ebx, eax
add ebx, ecx
neg ebx
mov dword [ebp - 0x20], ebx
inc eax
fild dword [ebp - 0x20]
cmp eax, edi
fdiv dword [ebp + 0x24]
fldl2e
fmulp st(1)
fld st(0)
frndint
fxch st(1)
fsub st(1)
f2xm1
fld1
faddp st(1)
fscale
fstp st(1)
fld dword [ebp - 0x1c]
fdivr dword [0x4671b4]
fmulp st(1)
fadd dword [ebp - 0xc]
fstp dword [ebp - 0xc]
jle 0x4104a3
mov ebx, dword [ebp - 0x18]
inc edx
cmp edx, edi
jle 0x410481
mov ecx, ebx
mov dword [ebp - 0x20], 0
cmp ecx, edi
mov dword [ebp - 8], ecx
jg 0x410575
mov eax, ebx
cmp eax, edi
jg 0x41056d
fld dword [ebp + 0x2c]
imul ecx, ecx
fmul dword [0x4672a4]
fstp dword [ebp - 0x24]
fld dword [ebp + 0x2c]
fmul dword [ebp + 0x2c]
fadd st(0), st(0)
fstp dword [ebp + 0x24]
fld dword [ebp - 0x24]
fsqrt
fstp dword [ebp - 0x18]
mov edx, eax
imul edx, eax
add edx, ecx
neg edx
mov dword [ebp - 0x1c], edx
inc eax
fild dword [ebp - 0x1c]
cmp eax, edi
fdiv dword [ebp + 0x24]
fldl2e
fmulp st(1)
fld st(0)
frndint
fxch st(1)
fsub st(1)
f2xm1
fld1
faddp st(1)
fscale
fstp st(1)
fld dword [ebp - 0x18]
fdivr dword [0x4671b4]
fmulp st(1)
fdiv dword [ebp - 0xc]
fadd dword [ebp - 0x20]
fstp dword [ebp - 0x20]
jle 0x410521
mov ecx, dword [ebp - 8]
inc ecx
cmp ecx, edi
mov dword [ebp - 8], ecx
jle 0x410501
mov eax, dword [ebp + 0xc]
xor ecx, ecx
cmp eax, ecx
mov dword [ebp - 0x1c], ecx
jle 0x410771
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
imul eax, esi
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x20], edx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x14], ecx
cmp edx, ecx
jle 0x410757
mov eax, dword [ebp - 0x20]
mov ebx, edi
neg ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x18], eax
jmp 0x4105b3
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov dword [ebp - 4], ecx
mov dword [ebp + 0x10], ecx
xor ecx, ecx
mov dword [ebp - 0x58], ecx
push esi
mov dword [ebp - 0x54], ecx
lea eax, [ebp - 4]
mov dword [ebp - 0x50], ecx
push edx
push eax
mov dword [ebp - 0x4c], ecx
call fcn.00450dd0
mov eax, ebx
add esp, 0xc
cmp eax, edi
mov dword [ebp - 8], eax
jg 0x410738
cmp ebx, edi
mov dword [ebp + 0x14], ebx
jg 0x410726
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x1c]
add ecx, eax
lea edi, [ebx + edx]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x10], edi
jmp 0x410609
mov edi, dword [ebp - 0x10]
mov ebx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x28]
test edi, edi
jge 0x410615
add edi, dword [ebp + 8]
js 0x410610
test ecx, ecx
jge 0x41061e
add ecx, dword [ebp + 0xc]
js 0x410619
mov eax, dword [ebp + 8]
dec eax
cmp edi, eax
jle 0x41062e
mov eax, edi
cdq
idiv dword [ebp + 8]
mov edi, edx
mov edx, dword [ebp + 0xc]
dec edx
cmp ecx, edx
jle 0x41063e
mov eax, ecx
cdq
idiv dword [ebp + 0xc]
mov ecx, edx
fld dword [ebp + 0x2c]
fmul dword [0x4672a4]
fstp dword [ebp - 0x2c]
fld dword [ebp - 0x2c]
fsqrt
fstp dword [ebp - 0x30]
imul ecx, dword [ebp + 8]
mov edx, dword [ebp - 8]
mov eax, ebx
imul eax, ebx
imul edx, edx
add eax, edx
add ecx, edi
neg eax
imul ecx, esi
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x20]
fild dword [ebp - 0x2c]
fld dword [ebp + 0x2c]
fmul dword [ebp + 0x2c]
lea ebx, [ecx + eax]
push esi
lea ecx, [ebp + 0x10]
push ebx
fadd st(0), st(0)
push ecx
fdivp st(1)
fldl2e
fmulp st(1)
fld st(0)
frndint
fxch st(1)
fsub st(1)
f2xm1
fld1
faddp st(1)
fscale
fstp st(1)
fld dword [ebp - 0x30]
fdivr dword [0x4671b4]
fmulp st(1)
fdiv dword [ebp - 0xc]
fstp dword [ebp - 0x34]
call fcn.00450dd0
add esp, 0xc
mov byte [ebp + 0x24], 0
test esi, esi
jle 0x4106fd
xor eax, eax
xor edx, edx
lea edi, [ebp + eax + 0x10]
mov dl, byte [ebp + eax - 4]
xor eax, eax
mov al, byte [edi]
mov dword [ebp - 0x2c], edx
fild dword [ebp - 0x2c]
mov dword [ebp - 0x2c], eax
fmul dword [ebp - 0x34]
fiadd dword [ebp - 0x2c]
call fcn.004518d4
cmp ax, 0xff
jbe 0x4106ec
mov byte [edi], 0xff
jmp 0x4106ee
mov byte [edi], al
inc byte [ebp + 0x24]
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x4106bf
lea ecx, [ebp + 0x10]
push esi
push ecx
push ebx
call fcn.00450dd0
mov eax, dword [ebp + 0x14]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x28]
add esp, 0xc
inc eax
inc edx
cmp eax, ecx
mov dword [ebp + 0x14], eax
mov dword [ebp - 0x10], edx
jle 0x410603
mov edi, ecx
mov eax, dword [ebp - 8]
mov ebx, dword [ebp - 0x24]
inc eax
cmp eax, edi
mov dword [ebp - 8], eax
jle 0x4105e5
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp + 8]
inc eax
add edx, esi
cmp eax, ecx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], edx
jl 0x4105b1
mov eax, dword [ebp - 0x38]
xor ecx, ecx
mov ebx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
add ebx, eax
inc edx
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp + 0xc]
cmp edx, ebx
mov dword [ebp - 0x1c], edx
jl 0x410594
mov edx, dword [ebp + 0x20]
mov dword [ebp + 0x14], edx
jmp 0x41077b
xor ecx, ecx
mov edx, dword [ebp + 0x1c]
xor eax, eax
cmp edx, ecx
mov dword [ebp - 0x20], eax
jle 0x4109c6
mov edx, esi
mov edi, dword [ebp + 0x20]
imul edx, dword [ebp + 0x18]
mov dword [ebp - 0x28], edx
mov dword [ebp + 0x28], edi
cmp dword [ebp + 0x18], ecx
jle 0x4109af
mov ebx, dword [ebp - 0x3c]
mov edx, dword [ebp + 0x18]
and ebx, 0xff
mov dword [ebp + 0x2c], ecx
imul ebx, eax
mov eax, dword [ebp - 0x40]
mov edi, ebx
imul edi, dword [ebp + 8]
and eax, 0xff
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x30], eax
imul eax, esi
imul edi, esi
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x28]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x14]
add edi, eax
mov dword [ebp - 0x24], edx
mov dword [ebp + 0x20], edi
jmp 0x4107ea
mov edi, dword [ebp + 0x20]
xor ecx, ecx
xor eax, eax
mov dword [ebp - 4], ecx
mov dword [ebp - 0x58], eax
mov dword [ebp + 0x10], ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x54], eax
push esi
lea edx, [ebp - 4]
mov dword [ebp - 0x50], eax
push ecx
push edx
mov dword [ebp - 0x4c], eax
call fcn.00450dd0
push esi
lea eax, [ebp + 0x10]
push edi
push eax
call fcn.00450dd0
add esp, 0x18
mov byte [ebp + 0x24], 0
test esi, esi
jle 0x41084a
xor eax, eax
mov edi, dword [ebp + eax*4 - 0x58]
lea ecx, [ebp + eax*4 - 0x58]
xor edx, edx
mov dl, byte [ebp + eax + 0x10]
mov al, byte [ebp + 0x24]
add edi, edx
inc al
mov byte [ebp + 0x24], al
mov dword [ecx], edi
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x410824
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp + 0x2c]
mov edi, dword [ebp - 0x38]
and eax, 0xff
add ecx, eax
mov edx, dword [ebp + 0x14]
add ecx, edi
push esi
imul ecx, esi
add ecx, edx
lea edx, [ebp + 0x10]
push ecx
push edx
mov dword [ebp - 0x34], eax
call fcn.00450dd0
add esp, 0xc
mov byte [ebp + 0x24], 0
test esi, esi
jle 0x4108a5
xor eax, eax
mov edi, dword [ebp + eax*4 - 0x58]
lea ecx, [ebp + eax*4 - 0x58]
xor edx, edx
mov dl, byte [ebp + eax + 0x10]
mov al, byte [ebp + 0x24]
add edi, edx
inc al
mov byte [ebp + 0x24], al
mov dword [ecx], edi
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x41087f
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp + 0x2c]
and eax, 0xff
push esi
add eax, ebx
imul eax, dword [ebp + 8]
lea edi, [eax + ecx]
mov ecx, dword [ebp + 0x14]
mov edx, edi
lea eax, [ebp + 0x10]
imul edx, esi
add edx, ecx
push edx
push eax
call fcn.00450dd0
add esp, 0xc
mov byte [ebp + 0x24], 0
test esi, esi
jle 0x4108ff
xor eax, eax
lea ecx, [ebp + eax*4 - 0x58]
xor edx, edx
mov dl, byte [ebp + eax + 0x10]
mov eax, dword [ecx]
add eax, edx
mov dword [ecx], eax
mov al, byte [ebp + 0x24]
inc al
mov byte [ebp + 0x24], al
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x4108db
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp + 0x14]
add edi, eax
push esi
imul edi, esi
add edi, ecx
lea ecx, [ebp + 0x10]
push edi
push ecx
call fcn.00450dd0
add esp, 0xc
mov byte [ebp + 0x24], 0
test esi, esi
jle 0x41094a
xor eax, eax
mov edi, dword [ebp + eax*4 - 0x58]
lea ecx, [ebp + eax*4 - 0x58]
xor edx, edx
mov dl, byte [ebp + eax + 0x10]
mov al, byte [ebp + 0x24]
add edi, edx
inc al
mov byte [ebp + 0x24], al
mov dword [ecx], edi
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x410924
xor cl, cl
test esi, esi
jle 0x41096e
xor eax, eax
mov edx, dword [ebp + eax*4 - 0x58]
shr edx, 2
inc cl
mov byte [ebp + eax + 0x10], dl
mov byte [ebp + 0x24], cl
mov eax, dword [ebp + 0x24]
and eax, 0xff
cmp eax, esi
jl 0x410952
mov edi, dword [ebp + 0xc]
lea eax, [ebp + 0x10]
push esi
push eax
push edi
call fcn.00450dd0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp + 0x2c]
mov eax, dword [ebp - 0x24]
add edx, ecx
mov ecx, dword [ebp + 0x20]
mov dword [ebp + 0x2c], edx
mov edx, dword [ebp - 0x2c]
add esp, 0xc
add edi, esi
add ecx, edx
dec eax
mov dword [ebp + 0xc], edi
mov dword [ebp + 0x20], ecx
mov dword [ebp - 0x24], eax
jne 0x4107e5
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x20]
xor ecx, ecx
mov ebx, dword [ebp + 0x28]
mov edi, dword [ebp + 0x1c]
inc eax
add ebx, edx
cmp eax, edi
mov dword [ebp - 0x20], eax
mov dword [ebp + 0x28], ebx
jl 0x41079a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret