Function at 0x1002ca60
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 4]
push esi
mov esi, dword [ebx]
push edi
mov edi, dword [esi + 0x10]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
cmp eax, dword [ebx + 8]
jae 0x1002cb70
mov eax, dword [ebp + 0xc]
lea ecx, [edi + eax*8 + 5]
mov dword [esp + 0x18], ecx
mov cl, byte [ecx]
mov byte [esp + 0xf], cl
cmp cl, 0x55
jne 0x1002cafd
mov dl, byte [edi + eax*8 + 2]
and dl, 0x1f
cmp dl, 0x13
jne 0x1002cafd
mov ecx, dword [ebx + 0x10]
and ecx, 0xf000
mov esi, 4
cmp ecx, 0x1000
ja 0x1002cad5
mov edx, dword [ebp + 0x10]
movzx eax, word [edi + eax*8]
inc edx
push edx
push eax
push ebx
call fcn.1002c970
add esp, 0xc
jmp 0x1002cae2
movzx ecx, word [edi + eax*8]
mov edx, dword [esp + 0x10]
mov dword [edx], ecx
add dword [ebx + 4], esi
cmp dword [ebx + 0x14], 0x15
jne 0x1002caf4
mov eax, dword [ebx + 4]
mov dword [eax], 0x20000
add dword [ebx + 4], esi
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp cl, 0x1b
jne 0x1002cb7c
test dword [ebx + 0x10], 0xf000
mov ecx, dword [edi + eax*8]
fld qword [ecx]
jne 0x1002cb51
fld st(0)
call fcn.1004cc26
mov ecx, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
fild qword [esp + 0x18]
fucompp
fnstsw ax
test ah, 0x44
jp 0x1002cb70
mov edx, dword [esp + 0x10]
mov dword [edx], 0x30000
mov esi, 4
add dword [ebx + 4], esi
mov eax, dword [ebx + 4]
mov dword [eax], ecx
add dword [ebx + 4], esi
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
fld qword [0x1004e1c8]
fadd st(1)
fstp qword [esp + 0x18]
mov ecx, dword [esp + 0x18]
movsx eax, cx
cmp ecx, eax
jne 0x1002cb6e
fild dword [esp + 0x18]
jmp 0x1002cb25
fstp st(0)
mov eax, 0xa
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dl, byte [esi + 0x75]
movzx ecx, dl
movzx esi, word [esi + ecx*2 + 0x10c]
mov byte [esp + 0xe], dl
cmp esi, eax
jbe 0x1002cbd3
movzx ecx, word [edi + esi*8]
cmp ecx, eax
jne 0x1002cbca
cmp dl, 0x56
je 0x1002cc28
movzx ecx, word [edi + esi*8 + 2]
xor ecx, dword [ebx + 0x10]
test ecx, 0xfff
jne 0x1002cbca
mov ecx, dword [ebx]
mov dl, byte [edi + esi*8 + 4]
mov cl, byte [ecx + 0x74]
and dl, 0x80
and cl, 0x80
cmp dl, cl
jae 0x1002cc28
mov dl, byte [esp + 0xe]
movzx esi, word [edi + esi*8 + 6]
cmp esi, eax
ja 0x1002cb92
mov cl, byte [esp + 0xf]
cmp cl, 0x28
je 0x1002cbe5
cmp cl, 0x29
jne 0x1002cce5
mov esi, dword [ebx + 0x10]
mov ecx, esi
and ecx, 0xf000
cmp ecx, 0x2000
jne 0x1002cc04
cmp dword [ebp + 0x10], 0
jle 0x1002cc04
add esi, 0x1000
mov edi, eax
mov eax, dword [ebx]
call fcn.1002c940
test eax, eax
je 0x1002cc3b
movzx edx, word [eax + 2]
mov eax, dword [esp + 0x10]
mov dword [eax], edx
add dword [ebx + 4], 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
mov dword [edx], esi
add dword [ebx + 4], 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0x14], 0x15
jne 0x1002cc7b
mov edi, dword [ebp + 0xc]
mov eax, dword [ebx]
mov esi, 0x226e
call fcn.1002c940
test eax, eax
je 0x1002cc7b
movzx ecx, word [eax + 2]
mov edx, dword [esp + 0x10]
mov dword [edx], ecx
mov esi, 4
add dword [ebx + 4], esi
mov eax, dword [ebx + 4]
mov dword [eax], 0x20000
add dword [ebx + 4], esi
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x10]
inc edi
cmp edi, 0x64
jge 0x1002cce2
mov eax, dword [esp + 0x14]
mov ecx, dword [ebp + 0xc]
movzx edx, word [eax + ecx*8]
push edi
push edx
push ebx
call fcn.1002ca60
push edi
mov edi, dword [ebp + 0xc]
mov esi, eax
mov eax, dword [esp + 0x24]
movzx ecx, word [eax + edi*8 + 2]
push ecx
push ebx
call fcn.1002ca60
add esi, eax
add esp, 0x18
cmp esi, dword [ebx + 0xc]
jg 0x1002ccdb
mov edx, dword [esp + 0x18]
movzx eax, byte [edx]
mov ecx, dword [ebx + 4]
shl eax, 8
or eax, dword [ebx + 0x14]
shl eax, 0x10
add eax, edi
mov dword [ecx], eax
add dword [ebx + 4], 4
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
mov dword [ebx + 4], edx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebx + 4]
add eax, 0x10000
pop edi
mov dword [ecx], eax
add dword [ebx + 4], 4
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret