Function at 0x4ba290
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [edx]
mov dword [esp + 0x34], edx
mov eax, dword [eax]
mov edx, dword [ebp + 0x18]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x28]
mov dword [esp + 0x48], eax
push esi
lea eax, [edx + 6]
mov dword [esp + 0x28], ecx
mov dword [esp + 0xc], ebx
mov esi, 0xfffffffe
mov dword [esp + 0x50], ebx
mov dword [esp + 0x10], eax
cmp byte [ebx], 0x7f
push edi
mov edi, dword [ebp + 0x2c]
mov dword [esp + 0x44], ebx
mov dword [esp + 0x30], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x20], esi
jne 0x4ba318
movzx ecx, byte [ebx + 3]
movzx eax, byte [ebx + 4]
shl ecx, 8
or ecx, eax
mov eax, dword [edi + 0x20]
mov dword [esp + 0x48], eax
xor eax, eax
mov word [esp + 0x4e], ax
lea eax, [esp + 0x48]
mov dword [esp + 0x38], ecx
mov word [esp + 0x4c], cx
mov dword [edi + 0x20], eax
mov byte [ebx + 1], 0
add edx, 3
mov eax, dword [esp + 0x10]
mov dword [esp + 0x34], 0
mov byte [eax + 2], 0
mov eax, dword [esp + 0x10]
mov ecx, dword [edi + 0x38]
add eax, edx
cmp dword [ebp + 0x30], 0
lea edx, [esp + 0x14]
mov dword [esp + 0x24], ecx
cmove edx, dword [esp + 0x34]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x34], edx
cmp dword [ebp + 0x14], 0
mov dword [esp + 0x10], eax
je 0x4ba35e
mov dword [edi + 0x38], ecx
cmp dword [ebp + 0x10], 0
je 0x4ba389
mov byte [eax], 0x76
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x30], eax
mov byte [eax], 0
mov eax, dword [esp + 0x10]
mov byte [eax + 1], 0
add dword [esp + 0x10], 2
add dword [esp + 0x14], 3
push edx
push edi
push dword [ebp + 0x1c]
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x3c]
push eax
push dword [ebp + 0xc]
lea eax, [esp + 0x34]
push eax
lea edx, [esp + 0x30]
lea ecx, [esp + 0x4c]
call fcn.004b6ad0
add esp, 0x20
test eax, eax
je 0x4ba513
mov eax, dword [edi + 0x38]
cmp eax, dword [esp + 0x24]
cmovle eax, dword [esp + 0x24]
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x30]
test eax, eax
jne 0x4ba47b
cmp byte [ebx], 0x71
mov eax, dword [esp + 0x28]
je 0x4ba3eb
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x20], eax
jmp 0x4ba42e
mov edx, dword [esp + 0x20]
test edx, edx
js 0x4ba405
cmp edx, eax
je 0x4ba418
test esi, esi
cmovns edx, esi
mov esi, edx
or edx, 0xffffffff
mov dword [esp + 0x20], edx
test eax, eax
js 0x4ba418
mov ecx, dword [esp + 0x1c]
test ecx, ecx
cmovs ecx, eax
mov dword [esp + 0x1c], ecx
jmp 0x4ba41c
mov ecx, dword [esp + 0x1c]
mov eax, ecx
xor eax, esi
test eax, 0xdfffffff
je 0x4ba42c
or esi, 0xffffffff
jmp 0x4ba42e
or esi, ecx
cmp dword [ebp + 0x10], 0
je 0x4ba478
mov eax, dword [esp + 0x10]
mov ecx, ebx
push edi
push 0
mov byte [eax], 0
mov edx, dword [esp + 0x34]
shr edx, 0xb
and edx, 1
call fcn.004b5980
mov ecx, eax
add esp, 8
cmp ecx, 0xfffffffd
jne 0x4ba462
mov dword [edi + 0x5c], 1
jmp 0x4ba478
test ecx, ecx
js 0x4ba4f4
mov edx, dword [esp + 0x30]
mov eax, ecx
sar eax, 8
mov byte [edx], al
mov byte [edx + 1], cl
mov eax, dword [ebp + 0x30]
mov ecx, dword [esp + 0x18]
cmp byte [ecx], 0x7c
jne 0x4ba525
test eax, eax
je 0x4ba4b1
mov eax, dword [esp + 0x3c]
mov edx, dword [ebp + 0x18]
add dword [esp + 0x14], 3
add edx, 3
mov eax, dword [eax]
add eax, edx
mov edx, dword [esp + 0x34]
inc ecx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x40]
jmp 0x4ba351
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x34]
mov byte [eax], 0x71
mov ecx, dword [esp + 0x10]
mov eax, ecx
sub eax, ebx
sar eax, 8
mov byte [ecx + 1], al
mov ecx, dword [esp + 0x10]
mov al, cl
sub al, bl
mov byte [ecx + 2], al
mov eax, dword [esp + 0x10]
mov ebx, eax
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x54], eax
add eax, 3
inc ecx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x40]
jmp 0x4ba351
cmp ecx, 0xfffffffe
jne 0x4ba4fe
lea eax, [ecx + 0x26]
jmp 0x4ba50e
cmp ecx, 0xfffffffc
mov eax, 0x19
mov edx, 0x46
cmove eax, edx
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0x18]
mov dword [edx], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
jne 0x4ba550
mov edx, dword [esp + 0x10]
sub edx, ebx
nop
movzx ecx, byte [ebx + 1]
movzx eax, byte [ebx + 2]
shl ecx, 8
or ecx, eax
mov byte [ebx + 2], dl
mov eax, edx
mov edx, ecx
sar eax, 8
mov byte [ebx + 1], al
sub ebx, edx
test ecx, ecx
jne 0x4ba530
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x44]
mov byte [eax], 0x72
mov ecx, dword [esp + 0x10]
mov eax, ecx
sub eax, ebx
sar eax, 8
mov byte [ecx + 1], al
mov ecx, dword [esp + 0x10]
mov al, cl
sub al, bl
mov byte [ecx + 2], al
mov edx, dword [esp + 0x10]
add edx, 3
cmp dword [esp + 0x38], 0
mov dword [esp + 0x10], edx
jbe 0x4ba60e
mov eax, dword [edi + 0x20]
cmp word [eax + 6], 0
je 0x4ba603
sub edx, ebx
lea eax, [ebx + 3]
push edx
push ebx
push eax
call fcn.004c2440
mov byte [ebx], 0x7b
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, 3
mov dword [esp + 0x10], eax
sub eax, ebx
sar eax, 8
mov byte [ebx + 1], al
mov al, byte [esp + 0x10]
sub al, bl
mov byte [ebx + 2], al
mov eax, dword [esp + 0x10]
mov byte [eax], 0x72
mov ecx, dword [esp + 0x10]
mov eax, ecx
sub eax, ebx
sar eax, 8
mov byte [ecx + 1], al
mov ecx, dword [esp + 0x10]
mov al, cl
sub al, bl
mov byte [ecx + 2], al
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
add edx, 3
mov eax, dword [edi + 0x20]
add ecx, 6
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ecx
mov eax, dword [eax]
mov dword [edi + 0x20], eax
jmp 0x4ba612
mov eax, dword [eax]
mov ecx, dword [esp + 0x14]
mov dword [edi + 0x20], eax
jmp 0x4ba612
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
mov ebx, dword [ebp + 0x30]
mov dword [edi + 0x38], eax
mov eax, dword [esp + 0x3c]
mov dword [eax], edx
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0x18]
mov dword [edx], eax
mov eax, dword [ebp + 0x20]
mov edx, dword [esp + 0x20]
mov dword [eax], edx
mov eax, dword [ebp + 0x24]
mov dword [eax], esi
test ebx, ebx
je 0x4ba661
mov edx, dword [ebx]
mov eax, 0x7fffffeb
sub eax, edx
cmp eax, ecx
jge 0x4ba65c
mov eax, dword [ebp + 0xc]
mov dword [eax], 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [edx + ecx]
mov dword [ebx], eax
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret