Function at 0x461af8
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x60
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
mov ebp, dword [esp + 0x94]
movsx eax, byte [0x59b7dc]
mov dword [esp + 0x48], eax
test eax, eax
je 0x461bf3
mov eax, 0x3fa00000
mov dword [0x872af4], eax
mov dword [0x872af8], eax
movsx edx, byte [0x872afc]
test edx, edx
jne 0x461bf3
mov byte [0x872afc], 1
xor edx, edx
fld qword [0x579d70]
fld qword [0x579d68]
mov dword [esp + 0x30], edx
fild dword [esp + 0x30]
fsub st(1)
fld qword [0x579d70]
fmul st(1)
fadd st(2)
fnstcw word [esp]
movzx eax, word [esp]
or eax, 0xc00
mov dword [esp + 8], eax
fldcw word [esp + 8]
fistp dword [esp + 0x28]
fldcw word [esp]
mov eax, dword [esp + 0x28]
test eax, eax
jl 0x461b9d
cmp eax, 0xff
jle 0x461b9f
mov eax, 0xff
jmp 0x461b9f
xor eax, eax
mov byte [edx + 0x8220c0], al
fmul st(2)
fadd st(1)
fnstcw word [esp]
movzx eax, word [esp]
or eax, 0xc00
mov dword [esp + 8], eax
fldcw word [esp + 8]
fistp dword [esp + 0x28]
fldcw word [esp]
mov eax, dword [esp + 0x28]
test eax, eax
jl 0x461bda
cmp eax, 0xff
jle 0x461bdc
mov eax, 0xff
jmp 0x461bdc
xor eax, eax
mov byte [edx + 0x8221c0], al
inc edx
cmp edx, 0x100
jl 0x461b58
fstp st(0)
fstp st(0)
mov eax, 0x51eb851f
mov ebp, dword [esp + 0x20]
imul ebp
sar edx, 5
mov eax, ebp
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x3c], edx
lea eax, [edx + edx]
add eax, eax
sub eax, edx
lea ecx, [edx + eax*8]
add ecx, ecx
add ecx, ecx
neg ecx
add ecx, ebp
mov esi, dword [esp + 0x80]
mov eax, 0x51eb851f
imul esi
sar edx, 5
mov eax, esi
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x38], edx
lea eax, [edx + edx]
add eax, eax
sub eax, edx
lea ebx, [edx + eax*8]
add ebx, ebx
add ebx, ebx
neg ebx
add ebx, esi
mov esi, dword [esp + 0x9c]
mov eax, 0x51eb851f
imul esi
sar edx, 5
mov eax, esi
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x4c], edx
mov edi, dword [esp + 0xa0]
mov eax, 0x51eb851f
imul edi
sar edx, 5
sar edi, 0x1f
sub edx, edi
mov dword [esp + 0x54], edx
shl ecx, 8
mov eax, 0x51eb851f
imul ecx
mov edi, edx
sar edi, 5
sar ecx, 0x1f
sub edi, ecx
mov dword [esp + 0x44], edi
shl ebx, 8
mov eax, 0x51eb851f
imul ebx
sar edx, 5
sar ebx, 0x1f
sub edx, ebx
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x24], edx
mov eax, dword [esp + 0x84]
sub eax, ebp
mov dword [esp + 0x40], eax
cmp esi, eax
mov ecx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x94]
jge 0x461cde
xor eax, eax
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x9c]
mov edx, dword [esp + 0x40]
cmp eax, edx
jl 0x461cf3
xor eax, eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x88]
sub eax, dword [esp + 0x80]
mov dword [esp + 0x5c], eax
mov edx, dword [esp + 0xa0]
cmp edx, eax
jge 0x461d16
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0xa0]
mov edx, dword [esp + 0x5c]
cmp eax, edx
jl 0x461d2b
xor eax, eax
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0xa0]
lea eax, [eax - 0x64]
mov edi, dword [esp + 0x9c]
add edi, 0xffffff9c
jne 0x461d46
mov edi, 0x64
test eax, eax
jne 0x461d4f
mov eax, 0x64
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x461dba
xor esi, esi
mov dword [esp + 0xc], esi
cdq
mov esi, edx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], edi
mov dword [esp + 0x58], eax
mov dword [esp + 0x3c], ecx
mov ebx, dword [esp + 0xc]
mov ebp, dword [esp + 0x24]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x5c]
imul ebp
push esi
mov ecx, dword [esp + 0x5c]
push ecx
push edx
push eax
call fcn.00470bf0
add eax, edi
mov dword [ebx*4 + 0x7e1cc0], eax
add ebp, 0x100
inc ebx
mov ecx, dword [esp + 0x54]
cmp ebx, ecx
jl 0x461d7c
mov ebx, dword [esp + 0x4c]
mov edi, dword [esp + 0x50]
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x94]
mov edx, dword [esp + 0x48]
test edx, edx
je 0x461dfa
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x461dfa
xor esi, esi
mov ebp, edx
mov edx, dword [esi*4 + 0x7e1cc0]
movzx eax, dl
and edx, 0xffffff00
movzx eax, byte [eax + 0x8221c0]
or edx, eax
mov dword [esi*4 + 0x7e1cc0], edx
inc esi
cmp esi, ebp
jl 0x461dce
mov ebp, dword [esp + 0x94]
test ebx, ebx
jle 0x461eab
xor esi, esi
mov dword [esp + 0xc], esi
mov eax, edi
cdq
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x58], edx
mov dword [esp + 0x50], edi
mov dword [esp + 0x3c], ecx
mov ebx, esi
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x40]
imul ebp
mov ecx, dword [esp + 0x58]
push ecx
mov esi, dword [esp + 0x54]
push esi
push edx
push eax
call fcn.00470bf0
mov edx, dword [esp + 0x44]
add eax, edx
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x461e57
movzx edx, al
and eax, 0xffffff00
movzx ecx, byte [edx + 0x8220c0]
or eax, ecx
movzx edx, al
mov edi, edx
shl edi, 0x10
add edi, edx
xor ecx, ecx
shld ecx, edx, 0x10
mov esi, edx
shl esi, 0x10
add esi, edx
adc ecx, 0
add edi, ecx
mov dword [ebx*8 + 0x801ec0], esi
mov dword [ebx*8 + 0x801ec4], edi
sar eax, 8
add eax, eax
add eax, eax
mov dword [ebx*4 + 0x7f1dc0], eax
add ebp, 0x100
inc ebx
mov eax, dword [esp + 0x4c]
cmp ebx, eax
jl 0x461e21
mov ebx, eax
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x94]
mov eax, dword [esp + 0x54]
mov dword [esp + 0x24], eax
test eax, eax
jle 0x46210f
xor esi, esi
xor eax, eax
mov dword [esp + 0x3c], ecx
mov edi, dword [esp + 0x54]
mov ecx, dword [esp + 0x38]
mov ebp, dword [esp + 0x98]
mov edx, dword [eax*4 + 0x7e1cc0]
sar edx, 8
add edx, ecx
test edx, edx
jge 0x461ee5
lea esi, [eax + 1]
cmp edx, ebp
jge 0x4620fb
inc eax
cmp eax, edi
jl 0x461ed2
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x94]
mov dword [esp + 0x5c], ebx
test ebx, ebx
jle 0x4620f4
xor edi, edi
xor eax, eax
mov edx, dword [eax*4 + 0x7f1dc0]
sar edx, 2
add edx, ecx
test edx, edx
jge 0x461f20
lea edi, [eax + 1]
cmp edx, ebp
jge 0x4620eb
inc eax
cmp eax, ebx
jl 0x461f0d
mov eax, dword [esp + 0x24]
cmp esi, eax
jge 0x461f3d
mov eax, dword [esp + 0x5c]
cmp edi, eax
jl 0x461f5c
add ebx, ebx
add ebx, ebx
mov eax, dword [esp + 0x54]
imul eax, ebx
push eax
mov edx, dword [esp + 0x1c]
push edx
call dword [0x5b8560]
add esp, 0x68
pop ebx
pop ebp
pop esi
pop edi
ret
add ebx, ebx
add ebx, ebx
mov eax, esi
imul eax, ebx
push eax
mov edx, dword [esp + 0x1c]
push edx
call dword [0x5b8560]
mov ecx, dword [esp + 0x2c]
mov edx, ecx
imul edx, ebx
add edx, dword [esp + 0x20]
mov eax, dword [esp + 0x5c]
imul eax, ebx
neg ecx
imul ecx, ebx
add eax, ecx
push eax
push edx
call dword [0x5b8560]
add esp, 0x10
movsx ecx, byte [0x59b730]
test ecx, ecx
jle 0x4620c2
xor ebx, ebx
mov eax, dword [esp + 0x24]
sub eax, esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x40], edi
mov dword [esp + 0x14], esi
lea ebp, [ebx + ebx]
add ebp, ebp
sub ebp, ebx
lea edi, [ebx + ebp*8]
mov dword [edi*4 + 0x7d9d24], 0x15
mov eax, ebx
imul eax, dword [esp + 0x24]
cdq
idiv ecx
mov esi, dword [esp + 0x14]
add eax, esi
mov dword [edi*4 + 0x7d9d28], eax
lea ebp, [ebx + 1]
mov eax, dword [esp + 0x24]
imul eax, ebp
cdq
idiv ecx
add eax, esi
mov dword [edi*4 + 0x7d9d2c], eax
mov ecx, dword [esp + 0x40]
mov dword [edi*4 + 0x7d9d30], ecx
mov eax, dword [esp + 0x5c]
mov dword [edi*4 + 0x7d9d34], eax
mov eax, dword [esp + 0x20]
mov dword [edi*4 + 0x7d9d38], eax
mov eax, dword [esp + 0x80]
mov dword [edi*4 + 0x7d9d3c], eax
mov eax, dword [esp + 0x84]
mov dword [edi*4 + 0x7d9d40], eax
mov eax, dword [esp + 0x88]
mov dword [edi*4 + 0x7d9d44], eax
mov eax, dword [esp + 0x94]
mov dword [edi*4 + 0x7d9d48], eax
mov eax, dword [esp + 0x98]
mov dword [edi*4 + 0x7d9d4c], eax
mov eax, dword [esp + 0x9c]
mov dword [edi*4 + 0x7d9d50], eax
mov eax, dword [esp + 0xa0]
mov dword [edi*4 + 0x7d9d54], eax
mov eax, dword [esp + 0x18]
mov dword [edi*4 + 0x7d9d58], eax
mov eax, dword [esp + 0x1c]
mov dword [edi*4 + 0x7d9d5c], eax
push dword [ebx*4 + 0x7db620]
call dword [sym.imp.kernel32.dll_SetEvent]
push 0xffffffffffffffff
push dword [ebx*4 + 0x7db720]
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov ebx, ebp
movsx ecx, byte [0x59b730]
cmp ebp, ecx
jl 0x461fba
test ecx, ecx
jle 0x4620e3
xor ebx, ebx
push 0xffffffffffffffff
push dword [ebx*4 + 0x7db820]
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
inc ebx
movsx eax, byte [0x59b730]
cmp ebx, eax
jl 0x4620c8
add esp, 0x60
pop ebx
pop ebp
pop esi
pop edi
ret
mov dword [esp + 0x5c], eax
jmp 0x461f2d
xor edi, edi
jmp 0x461f2d
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x94]
mov dword [esp + 0x24], eax
jmp 0x461efd
xor esi, esi
jmp 0x461efd