Function at 0x5a4058
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x60]
test eax, eax
js 0x5a42f4
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x18]
mov ebx, eax
sub ebx, edx
sub ebx, dword [ecx + 0x24]
mov dword [esp + 0x24], ebx
xor esi, esi
mov dword [esp + 0x2c], 0xffffffff
mov dword [esp + 0x28], 0
lea eax, [esp + 0x40]
mov dword [esp + 0x14], eax
mov ebp, esi
mov esi, ecx
sub ebx, 8
mov ecx, ebx
add ecx, edx
js 0x5a417c
mov eax, dword [esi]
mov dword [esp + 8], 8
lea edx, [esp + 0x38]
mov dword [esp + 4], edx
mov dword [esp], ebx
mov ecx, esi
call dword [eax + 0xc]
sub esp, 0xc
cmp eax, 8
jne 0x5a428a
mov dl, byte [esp + 0x39]
movzx ecx, byte [esp + 0x3a]
mov byte [esp + 0x1a], cl
movzx eax, dl
shl eax, 8
add eax, ecx
shl eax, 8
movzx ecx, byte [esp + 0x3b]
mov byte [esp + 0x1b], cl
add ecx, eax
mov dword [esp + 0x1c], ecx
lea eax, [esp + 0x3c]
xor ecx, ecx
shl ecx, 8
movzx edi, byte [eax]
add ecx, edi
inc eax
cmp eax, dword [esp + 0x14]
jne 0x5a4103
mov al, byte [esp + 0x38]
mov byte [esp + 0x13], al
and eax, 0xfffffff0
cmp al, 0x90
je 0x5a421c
cmp byte [esp + 0x13], 0x80
je 0x5a424c
xor edi, edi
cmp byte [esp + 0x13], 0x4a
je 0x5a4194
cmp byte [esp + 0x13], 0x4c
je 0x5a4194
xor edx, edx
xor eax, eax
cmp ebp, 2
je 0x5a41bc
cmp ebp, 3
je 0x5a4270
dec ebp
je 0x5a4258
mov eax, edi
test al, al
je 0x5a42b8
sub ebx, ecx
mov dword [esp + 0x24], ebx
xor ebp, ebp
nop
mov edx, dword [esi + 0x18]
sub ebx, 8
mov ecx, ebx
add ecx, edx
jns 0x5a40b0
cmp ebp, 3
je 0x5a40b0
mov ebx, edx
neg ebx
mov ebp, 3
jmp 0x5a40b0
xor dl, byte [esp + 0x13]
cmp dl, 6
jne 0x5a4140
cmp byte [esp + 0x1a], 0x1a
jne 0x5a4140
mov al, byte [esp + 0x1b]
and eax, 0x40
xor edx, edx
cmp al, 1
sbb eax, eax
and eax, 1
cmp ebp, 2
jne 0x5a4149
lea esi, [esi]
test al, al
je 0x5a429c
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx + 0x18]
mov edi, dword [esp + 0x60]
test edi, edi
js 0x5a41fe
lea edx, [ebx + eax]
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x18], edx
mov edx, dword [ecx + 0xc]
test edx, edx
je 0x5a41ec
add edx, ebx
mov dword [ecx + 0xc], edx
sub dword [ecx + 0x14], ebx
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x1c], edx
mov edx, dword [esp + 0x2c]
mov dword [ecx + 0x20], edx
add eax, dword [esp + 0x24]
cmp byte [esp + 0x38], 0x4a
mov ecx, dword [esp + 0x20]
setne byte [ecx + 4]
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret 4
test ecx, ecx
setg al
mov edi, eax
cmp byte [esp + 0x13], 0x80
jne 0x5a4132
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x5a4140
test ecx, ecx
jle 0x5a4140
mov dl, 1
xor eax, eax
jmp 0x5a4144
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x5a42ac
xor edi, edi
jmp 0x5a422e
mov edx, edi
test dl, dl
je 0x5a428a
sub ebx, ecx
add ebx, 8
mov ebp, 2
jmp 0x5a416c
test al, al
je 0x5a427b
cmp byte [esp + 0x1b], 0x80
je 0x5a42d2
add ebx, 0x10
cmp ebx, 0x1000
jle 0x5a416c
mov eax, 0xffffffff
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov ebp, 3
mov ebx, 8
jmp 0x5a416c
test ecx, ecx
setg dl
mov edi, edx
jmp 0x5a4140
test dl, dl
je 0x5a429c
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], ecx
mov ebp, 1
jmp 0x5a416c
lea eax, [esp + 0x3f]
lea ecx, [esp + 0x3b]
mov edx, dword [esp + 0x28]
shl edx, 8
movzx esi, byte [eax]
add edx, esi
dec eax
cmp eax, ecx
jne 0x5a42de
mov dword [esp + 0x28], edx
jmp 0x5a41c4
mov eax, dword [ecx]
call dword [eax + 0x1c]
jmp 0x5a4073