Function at 0x51b550
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x10
mov eax, dword [0x6621f4]
push ebx
push ebp
push esi
mov esi, dword [eax + 0x8c]
xor edx, edx
mov dword [esp + 0x14], esi
push edi
mov eax, dword [esi + 0x40]
mov dword [esp + 0x14], 0
mov dl, byte [eax + 0x50]
mov eax, 0xcccccccd
mul edx
shr edx, 2
mov byte [ecx + 0x274], dl
mov eax, dword [esi + 0x40]
xor edx, edx
mov esi, 5
mov dl, byte [eax + 0x50]
mov eax, edx
xor edx, edx
div esi
xor bl, bl
lea esi, [ecx + 0x2c]
mov byte [esp + 0x10], bl
mov dword [esp + 0x1c], esi
mov byte [ecx + 0x275], dl
mov edi, esi
mov ebp, 5
mov eax, dword [edi]
mov edx, dword [eax + 4]
add edx, 0x40
fld dword [edx]
fld dword [edx + 8]
fld dword [ecx + 0x254]
fxch st(2)
mov edx, dword [eax + 4]
fstp dword [edx + 0x40]
mov edx, dword [eax + 4]
fxch st(1)
fstp dword [edx + 0x44]
mov edx, dword [eax + 4]
fstp dword [edx + 0x48]
mov edx, dword [eax + 4]
and byte [edx + 0x1e], 0xfd
add edx, 0x10
mov edx, dword [eax + 4]
mov edx, dword [edx + 0xa0]
test byte [edx + 3], 3
jne 0x51b653
mov ebx, dword [0x66885c]
mov ebx, dword [ebx + 0xbc]
mov dword [edx + 8], ebx
mov ebx, dword [eax + 4]
mov edx, dword [0x66885c]
mov ebx, dword [ebx + 0xa0]
add edx, 0xbc
mov dword [ebx + 0xc], edx
mov edx, dword [eax + 4]
mov ebx, dword [0x66885c]
mov edx, dword [edx + 0xa0]
mov ebx, dword [ebx + 0xbc]
add edx, 8
mov dword [ebx + 4], edx
mov edx, dword [eax + 4]
mov ebx, dword [0x66885c]
mov edx, dword [edx + 0xa0]
add edx, 8
mov dword [ebx + 0xbc], edx
mov bl, byte [esp + 0x10]
mov edx, dword [eax + 4]
add edi, 4
mov edx, dword [edx + 0xa0]
or byte [edx + 3], 3
mov eax, dword [eax + 4]
mov dl, byte [eax + 3]
or dl, 0xc
dec ebp
mov byte [eax + 3], dl
jne 0x51b5b3
mov al, byte [ecx + 0x274]
cmp bl, al
jae 0x51b6a1
mov eax, dword [esi]
lea edx, [esi + 4]
add eax, 0x10
mov esi, 4
and byte [eax], 0xfd
mov eax, dword [edx]
or byte [eax + 0x10], 2
add eax, 0x10
add edx, 4
dec esi
jne 0x51b690
jmp 0x51b6e9
mov edx, esi
mov esi, 5
jne 0x51b6da
mov eax, dword [edx]
or byte [eax + 0x10], 2
add eax, 0x10
add edx, 4
dec esi
jne 0x51b6aa
mov al, byte [ecx + 0x275]
test al, al
jbe 0x51b6e9
mov ebp, dword [esp + 0x14]
and eax, 0xff
add eax, ebp
mov eax, dword [ecx + eax*4 + 0x2c]
add eax, 0x10
and byte [eax], 0xfd
jmp 0x51b6e9
mov eax, dword [edx]
or byte [eax + 0x10], 2
add eax, 0x10
add edx, 4
dec esi
jne 0x51b6da
mov edx, dword [esp + 0x14]
inc bl
add edx, 5
cmp bl, 6
mov byte [esp + 0x10], bl
mov dword [esp + 0x14], edx
mov esi, edi
jb 0x51b5ac
mov esi, dword [esp + 0x18]
xor edx, edx
mov eax, dword [esi + 0x40]
mov dl, byte [eax + 0x50]
mov eax, 0xcccccccd
mul edx
mov al, byte [ecx + 0x275]
shr edx, 2
test al, al
mov byte [ecx + 0x274], dl
jne 0x51b733
dec dl
mov byte [ecx + 0x274], dl
mov eax, dword [esi + 0x40]
cmp byte [eax + 0x50], 0xf
jae 0x51b973
mov byte [esp + 0x10], 2
mov edi, 0x3c03126f
mov bl, 0x50
mov eax, dword [esp + 0x18]
xor edx, edx
mov esi, dword [esp + 0x10]
mov eax, dword [eax + 0x40]
and esi, 0xff
mov dl, byte [eax + 0x50]
mov eax, 0xcccccccd
mul edx
shr edx, 2
cmp esi, edx
jb 0x51b865
cmp byte [esp + 0x10], 3
ja 0x51b865
lea eax, [esi + esi*4]
lea esi, [ecx + eax*4 + 0x2c]
mov eax, dword [ecx + eax*4 + 0x2c]
and byte [eax + 0x10], 0xfd
add eax, 0x10
mov eax, dword [esi]
mov edx, dword [eax + 4]
add edx, 0x40
fld dword [edx]
fld dword [edx + 4]
fxch st(1)
mov edx, dword [eax + 4]
fstp dword [edx + 0x40]
mov edx, dword [eax + 4]
fstp dword [edx + 0x44]
mov edx, dword [eax + 4]
mov dword [edx + 0x48], edi
mov edx, dword [eax + 4]
add edx, 0x10
mov ebp, dword [edx + 0xc]
and ebp, 0xfffdffff
mov dword [edx + 0xc], ebp
mov edx, dword [eax + 4]
mov edx, dword [edx + 0xa0]
test byte [edx + 3], 3
jne 0x51b82d
mov ebp, dword [0x66885c]
mov ebp, dword [ebp + 0xbc]
mov dword [edx + 8], ebp
mov ebp, dword [eax + 4]
mov edx, dword [0x66885c]
mov ebp, dword [ebp + 0xa0]
add edx, 0xbc
mov dword [ebp + 0xc], edx
mov edx, dword [eax + 4]
mov ebp, dword [0x66885c]
mov edx, dword [edx + 0xa0]
mov ebp, dword [ebp + 0xbc]
add edx, 8
mov dword [ebp + 4], edx
mov edx, dword [eax + 4]
mov ebp, dword [0x66885c]
mov edx, dword [edx + 0xa0]
add edx, 8
mov dword [ebp + 0xbc], edx
mov edx, dword [eax + 4]
mov edx, dword [edx + 0xa0]
or byte [edx + 3], 3
mov eax, dword [eax + 4]
mov dl, byte [eax + 3]
or dl, 0xc
mov byte [eax + 3], dl
mov eax, dword [esi]
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x51b85c
mov edx, dword [eax + 0xc]
mov byte [edx + 7], bl
mov eax, dword [eax + 4]
test eax, eax
jne 0x51b84f
dec byte [esp + 0x10]
jmp 0x51b74c
mov byte [esp + 0x10], 0
mov eax, dword [esp + 0x18]
xor edx, edx
mov esi, dword [esp + 0x10]
mov eax, dword [eax + 0x40]
and esi, 0xff
mov dl, byte [eax + 0x50]
mov eax, 0xcccccccd
mul edx
shr edx, 2
cmp esi, edx
jae 0x51ba59
lea eax, [esi + esi*4]
mov eax, dword [ecx + eax*4 + 0x2c]
mov edx, dword [eax + 4]
mov esi, dword [eax + 0x1c]
add edx, 0x40
fld dword [edx]
fld dword [edx + 4]
fxch st(1)
mov edx, dword [eax + 4]
fstp dword [edx + 0x40]
mov edx, dword [eax + 4]
fstp dword [edx + 0x44]
mov edx, dword [eax + 4]
mov dword [edx + 0x48], 0
mov edx, dword [eax + 4]
add edx, 0x10
mov ebp, dword [edx + 0xc]
and ebp, 0xfffdffff
mov dword [edx + 0xc], ebp
mov edx, dword [eax + 4]
mov edx, dword [edx + 0xa0]
test byte [edx + 3], 3
jne 0x51b93a
mov edi, dword [0x66885c]
mov edi, dword [edi + 0xbc]
mov dword [edx + 8], edi
mov edi, dword [eax + 4]
mov edx, dword [0x66885c]
mov edi, dword [edi + 0xa0]
add edx, 0xbc
mov dword [edi + 0xc], edx
mov edx, dword [eax + 4]
mov edi, dword [0x66885c]
mov edx, dword [edx + 0xa0]
mov edi, dword [edi + 0xbc]
add edx, 8
mov dword [edi + 4], edx
mov edx, dword [eax + 4]
mov edi, dword [0x66885c]
mov edx, dword [edx + 0xa0]
add edx, 8
mov dword [edi + 0xbc], edx
mov edx, dword [eax + 4]
mov edx, dword [edx + 0xa0]
mov bl, byte [edx + 3]
or bl, 3
mov byte [edx + 3], bl
mov eax, dword [eax + 4]
mov dl, byte [eax + 3]
or dl, 0xc
test esi, esi
mov byte [eax + 3], dl
je 0x51b96a
mov eax, dword [esi + 0xc]
mov byte [eax + 7], 0xff
mov esi, dword [esi + 4]
test esi, esi
jne 0x51b95c
inc byte [esp + 0x10]
jmp 0x51b86a
mov esi, dword [esp + 0x1c]
mov edi, 3
mov eax, dword [esi]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 0x1c]
add ecx, 0x40
fld dword [ecx]
fld dword [ecx + 4]
fxch st(1)
mov ecx, dword [eax + 4]
fstp dword [ecx + 0x40]
mov ecx, dword [eax + 4]
fstp dword [ecx + 0x44]
mov ecx, dword [eax + 4]
mov dword [ecx + 0x48], 0
mov ecx, dword [eax + 4]
add ecx, 0x10
mov ebp, dword [ecx + 0xc]
and ebp, 0xfffdffff
mov dword [ecx + 0xc], ebp
mov ecx, dword [eax + 4]
mov ecx, dword [ecx + 0xa0]
test byte [ecx + 3], 3
jne 0x51ba1f
mov ebx, dword [0x66885c]
mov ebx, dword [ebx + 0xbc]
mov dword [ecx + 8], ebx
mov ebx, dword [eax + 4]
mov ecx, dword [0x66885c]
mov ebx, dword [ebx + 0xa0]
add ecx, 0xbc
mov dword [ebx + 0xc], ecx
mov ecx, dword [eax + 4]
mov ebx, dword [0x66885c]
mov ecx, dword [ecx + 0xa0]
mov ebx, dword [ebx + 0xbc]
add ecx, 8
mov dword [ebx + 4], ecx
mov ecx, dword [eax + 4]
mov ebx, dword [0x66885c]
mov ecx, dword [ecx + 0xa0]
add ecx, 8
mov dword [ebx + 0xbc], ecx
mov ecx, dword [eax + 4]
mov ecx, dword [ecx + 0xa0]
mov bl, byte [ecx + 3]
or bl, 3
mov byte [ecx + 3], bl
mov eax, dword [eax + 4]
mov cl, byte [eax + 3]
or cl, 0xc
test edx, edx
mov byte [eax + 3], cl
je 0x51ba4f
mov eax, dword [edx + 0xc]
mov byte [eax + 7], 0xff
mov edx, dword [edx + 4]
test edx, edx
jne 0x51ba41
add esi, 0x14
dec edi
jne 0x51b97c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret