Function at 0x5140d4
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc8
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov edi, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ebx, dword [eax + 0x10940]
mov eax, ebx
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
cmp edx, 0
jne 0x51410a
cmp eax, 0
jbe 0x514157
jmp 0x51410c
jle 0x514157
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10940]
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
mov esi, ebx
sub esi, eax
mov eax, dword [ebp - 8]
sub eax, esi
cdq
idiv ebx
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 8]
sub eax, esi
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x34]
mov dword [ebp - 0x38], ebx
fild dword [ebp - 0x38]
fdivp st(1)
add esp, 0xfffffff4
fstp xword [esp]
wait
call fcn.00428098
inc eax
mov dword [ebp - 0x14], eax
jmp 0x51417c
xor esi, esi
mov eax, dword [ebp - 8]
cdq
idiv ebx
mov dword [ebp - 0x10], edx
fild dword [ebp - 8]
mov dword [ebp - 0x34], ebx
fild dword [ebp - 0x34]
fdivp st(1)
add esp, 0xfffffff4
fstp xword [esp]
wait
call fcn.00428098
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
sub eax, esi
mov edx, dword [ebp - 4]
mov ecx, dword [edx + 0x10940]
cdq
idiv ecx
mov ebx, eax
mov eax, ecx
add eax, eax
inc eax
imul ebx, eax
test esi, esi
jle 0x5141a2
mov eax, esi
add eax, eax
add ebx, eax
inc ebx
cmp dword [ebp - 0x10], 0
jle 0x5141af
mov eax, dword [ebp - 0x10]
add eax, eax
add ebx, eax
mov eax, dword [ebp + 8]
mov edx, ebx
call fcn.00405678
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0x10940]
mov eax, esi
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
add eax, eax
push eax
mov eax, esi
add eax, eax
inc eax
imul dword [ebp - 0x14]
pop edx
sub eax, edx
test byte [ebp + 0xc], 1
jne 0x5141ea
cmp ebx, eax
je 0x5141ee
xor eax, eax
jmp 0x5141f0
mov al, 1
mov byte [ebp - 0x15], al
test byte [ebp + 0xc], 2
je 0x514245
cmp byte [ebp - 0x15], 0
je 0x514214
mov eax, dword [ebp + 8]
mov eax, dword [eax]
call fcn.00405314
mov edx, eax
dec edx
mov eax, dword [ebp + 8]
call fcn.00405678
mov eax, dword [ebp + 8]
mov eax, dword [eax]
call fcn.00405314
test eax, eax
jle 0x5143df
mov dword [ebp - 0x1c], eax
mov esi, 1
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov word [eax + esi*2 - 2], 0x20
inc esi
dec dword [ebp - 0x1c]
jne 0x51422e
jmp 0x5143df
mov eax, dword [ebp - 8]
dec eax
test eax, eax
jl 0x5142cc
inc eax
mov dword [ebp - 0x1c], eax
xor esi, esi
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10940]
cdq
push edx
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10940]
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
push edx
push eax
mov eax, esi
cdq
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
call fcn.00405cc4
mov edx, esi
add edx, edx
add eax, edx
xor edx, edx
mov dl, byte [edi]
shr edx, 4
mov dx, word [edx*2 + 0x5688ec]
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx]
mov word [ecx + eax*2], dx
mov dl, byte [edi]
and dl, 0xf
and edx, 0xff
mov dx, word [edx*2 + 0x5688ec]
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx]
mov word [ecx + eax*2 + 2], dx
inc edi
inc esi
dec dword [ebp - 0x1c]
jne 0x514253
mov eax, dword [ebp - 0x14]
test eax, eax
jle 0x514317
mov dword [ebp - 0x1c], eax
mov esi, 1
mov eax, dword [ebp - 4]
mov edi, dword [eax + 0x10940]
mov eax, edi
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
add eax, eax
push eax
mov eax, edi
add eax, eax
inc eax
imul esi
pop edx
sub eax, edx
cmp ebx, eax
jl 0x514317
mov edx, dword [ebp + 8]
mov edx, dword [edx]
mov word [edx + eax*2 - 2], 0x20
inc esi
dec dword [ebp - 0x1c]
jne 0x5142db
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x218]
mov edx, dword [eax]
call dword [edx + 0x20]
dec eax
test eax, eax
jl 0x5143c4
inc eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0xc], 0
lea ecx, [ebp - 0x30]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x218]
mov edx, dword [ebp - 0xc]
mov ebx, dword [eax]
call dword [ebx + 0x24]
mov eax, dword [ebp - 0x30]
sub eax, dword [ebp + 0x10]
mov esi, eax
mov edi, eax
add edi, dword [ebp - 0x28]
dec edi
sub edi, esi
jl 0x5143b8
inc edi
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10940]
cdq
push edx
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10940]
cdq
push edx
push eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00405d40
push edx
push eax
mov eax, esi
cdq
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
call fcn.00405cc4
mov edx, esi
add edx, edx
add eax, edx
mov edx, dword [ebp + 8]
mov edx, dword [edx]
mov word [edx + eax*2], 0x3f
mov edx, dword [ebp + 8]
mov edx, dword [edx]
mov word [edx + eax*2 + 2], 0x3f
inc esi
dec edi
jne 0x514360
inc dword [ebp - 0xc]
dec dword [ebp - 0x1c]
jne 0x514339
cmp byte [ebp - 0x15], 0
je 0x5143df
mov eax, dword [ebp + 8]
mov eax, dword [eax]
call fcn.00405314
mov edx, eax
dec edx
mov eax, dword [ebp + 8]
call fcn.00405678
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10