Function at 0x588524
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 0x588730
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.00587a9c
mov esi, dword [esp + 0x64]
test esi, esi
je 0x588571
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 0x588740
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.00587e48
mov esi, eax
test eax, eax
je 0x5887d4
mov ecx, dword [esp + 0x34]
mov dword [eax + 0x14], ecx
mov eax, dword [esp + 0x38]
test byte [eax + 8], 8
je 0x5886ac
mov ecx, dword [esp + 0x34]
cmp dword [esp + 0x2c], ecx
jbe 0x5887db
mov ebx, ecx
add ebx, 2
jmp 0x588602
mov dword [eax + 0x14], ebx
add ebx, 2
mov esi, eax
cmp dword [esp + 0x2c], edi
jbe 0x588654
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 0x5885f4
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.00587e48
test eax, eax
jne 0x5885f4
mov edi, dword [esp + 0x30]
lea esi, [esi]
mov eax, dword [esp + 0x38]
cmp dword [eax + 0x1c], edi
je 0x588764
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 0x588697
test byte [edx + 8], 2
je 0x588691
mov ebx, dword [edx + 0x14]
cmp ebx, eax
je 0x588691
test eax, eax
je 0x58871c
cmp eax, ebx
jb 0x58871c
add edx, 0x20
dec ecx
jne 0x588674
test eax, eax
je 0x5887d4
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 0x5886ca
jmp 0x588654
mov dword [eax + 0x14], ebx
add ebx, 2
mov esi, eax
cmp dword [esp + 0x2c], edi
jbe 0x588654
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 0x5886bc
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.00587e48
test eax, eax
jne 0x5886bc
jmp 0x58864d
mov eax, ebx
add edx, 0x20
dec ecx
jne 0x588674
jmp 0x588697
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x2c], ebx
jmp 0x58854b
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 0x5885a2
cmp dword [esp + 0x60], edi
jne 0x588661
mov ebx, dword [esp + 0x64]
test ebx, ebx
je 0x588780
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.00587e48
test eax, eax
je 0x588661
test byte [eax + 8], 2
jne 0x5887e4
mov dword [eax + 0x14], ebx
jmp 0x588661
xor eax, eax
jmp 0x5886a2
mov edi, dword [esp + 0x34]
jmp 0x588654
mov eax, dword [esp + 0x60]
jmp 0x5886a2