Function at 0x5890a8
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], ecx
mov ebx, dword [esp + 0x60]
cmp dword [eax + 0x1c], ebx
je 0x5892b4
add ebx, 2
mov dword [esp + 0x2c], ebx
mov edx, dword [esp + 0x3c]
mov ebp, dword [edx + 0x2c]
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
call fcn.00588620
mov esi, dword [esp + 0x64]
test esi, esi
je 0x5890f5
mov ebx, dword [esp + 0x64]
mov dword [ebx], 0
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
cmp ecx, dword [edx + 0x18]
je 0x5892c4
mov ecx, dword [esp + 0x34]
mov cx, word [ecx - 2]
mov word [esp + 0x10], cx
movzx edx, ch
mov edx, dword [ebp + edx*4 + 0xe0]
movzx ecx, byte [esp + 0x10]
movsx edx, word [edx + ecx*2]
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], ecx
mov dword [esp + 4], ecx
mov dword [esp], edx
mov ecx, eax
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
call fcn.005889cc
mov esi, eax
test eax, eax
je 0x589358
mov ecx, dword [esp + 0x34]
mov dword [eax + 0x14], ecx
mov eax, dword [esp + 0x38]
test byte [eax + 8], 8
je 0x589230
mov ecx, dword [esp + 0x34]
cmp dword [esp + 0x2c], ecx
jbe 0x58935f
mov ebx, ecx
add ebx, 2
jmp 0x589186
mov dword [eax + 0x14], ebx
add ebx, 2
mov esi, eax
cmp dword [esp + 0x2c], edi
jbe 0x5891d8
lea eax, [ebx - 2]
mov dword [esp + 0x30], eax
mov edi, ebx
mov dx, word [ebx - 2]
movzx eax, dh
mov eax, dword [ebp + eax*4 + 0xe0]
movzx edx, byte [ebx - 2]
movsx edx, word [eax + edx*2]
mov eax, dword [esi + 0x18]
mov eax, dword [eax + edx*4]
test eax, eax
jne 0x589178
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
mov dword [esp], edx
mov ecx, esi
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
call fcn.005889cc
test eax, eax
jne 0x589178
mov edi, dword [esp + 0x30]
lea esi, [esi]
mov eax, dword [esp + 0x38]
cmp dword [eax + 0x1c], edi
je 0x5892e8
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 0x30]
mov ecx, edx
mov edx, dword [edx + 0x14]
mov ecx, dword [ecx + 4]
test ecx, ecx
jle 0x58921b
test byte [edx + 8], 2
je 0x589215
mov ebx, dword [edx + 0x14]
cmp ebx, eax
je 0x589215
test eax, eax
je 0x5892a0
cmp eax, ebx
jb 0x5892a0
add edx, 0x20
dec ecx
jne 0x5891f8
test eax, eax
je 0x589358
sub eax, 2
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, ecx
add ebx, 2
mov edi, ecx
cmp dword [esp + 0x2c], ecx
ja 0x58924e
jmp 0x5891d8
mov dword [eax + 0x14], ebx
add ebx, 2
mov esi, eax
cmp dword [esp + 0x2c], edi
jbe 0x5891d8
lea eax, [ebx - 2]
mov dword [esp + 0x30], eax
mov edi, ebx
mov dx, word [ebx - 2]
movzx eax, dh
mov eax, dword [ebp + eax*4 + 0xe0]
movzx edx, byte [ebx - 2]
movsx edx, word [eax + edx*2]
mov eax, dword [esi + 0x18]
mov eax, dword [eax + edx*4]
test eax, eax
jne 0x589240
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
mov dword [esp], edx
mov ecx, esi
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
call fcn.005889cc
test eax, eax
jne 0x589240
jmp 0x5891d1
mov eax, ebx
add edx, 0x20
dec ecx
jne 0x5891f8
jmp 0x58921b
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x2c], ebx
jmp 0x5890cf
mov edx, dword [esp + 0x3c]
mov ecx, dword [edx + 0x28]
mov ebx, dword [esp + 0x38]
mov edx, dword [ebx + 8]
and edx, 1
xor edx, 1
add edx, 8
movsx edx, word [ecx + edx*2 + 4]
jmp 0x589126
cmp dword [esp + 0x60], edi
jne 0x5891e5
mov ebx, dword [esp + 0x64]
test ebx, ebx
je 0x589304
mov ebx, dword [esp + 0x64]
mov dword [ebx], 1
mov ecx, dword [esp + 0x34]
mov dword [esp + 8], ecx
mov ebx, dword [esp + 0x60]
mov dword [esp + 4], ebx
mov edx, dword [esp + 0x3c]
mov eax, dword [edx + 0x28]
mov ecx, dword [esp + 0x38]
xor edx, edx
test byte [ecx + 8], 2
sete dl
add edx, 8
movsx eax, word [eax + edx*2 + 8]
mov dword [esp], eax
mov ecx, esi
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
call fcn.005889cc
test eax, eax
je 0x5891e5
test byte [eax + 8], 2
jne 0x589368
mov dword [eax + 0x14], ebx
jmp 0x5891e5
xor eax, eax
jmp 0x589226
mov edi, dword [esp + 0x34]
jmp 0x5891d8
mov eax, dword [esp + 0x60]
jmp 0x589226