Function at 0x540788
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x5ac640]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov bh, byte [eax + 8]
mov dword [ebp - 0x38], esi
cmp bh, 3
je 0x5409f7
mov bl, byte [eax + 9]
push edi
movzx edi, bl
mov edx, edi
test bh, 2
je 0x5407f9
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x30], 3
movzx ecx, byte [eax]
mov dword [ebp - 0x2c], ecx
sub edx, ecx
mov dword [ebp - 0x24], ecx
movzx ecx, byte [eax + 1]
mov eax, edi
sub eax, ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x10]
movzx ecx, byte [eax + 2]
mov eax, edi
sub eax, ecx
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x2c]
jmp 0x54080f
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x30], 1
movzx eax, byte [ecx + 3]
mov dword [ebp - 0x2c], eax
sub edx, eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x3c], edx
test bh, 4
je 0x54083b
mov edx, dword [ebp - 0x30]
movzx eax, byte [ecx + 4]
sub edi, eax
mov dword [ebp + edx*4 - 0x24], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp + edx*4 - 0x14], edi
inc edx
mov dword [ebp - 0x30], edx
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x2c], eax
mov edi, dword [ebp + 8]
cmp bl, 8
jae 0x5408e2
mov cl, byte [ecx + 3]
mov edi, dword [edi + 4]
mov dword [ebp - 0x34], edi
cmp cl, 1
jne 0x540860
cmp bl, 2
jne 0x540860
mov byte [ebp - 0x25], 0x55
jmp 0x540872
cmp bl, 4
jne 0x54086e
mov byte [ebp - 0x25], 0x11
cmp cl, 3
je 0x540872
mov byte [ebp - 0x25], 0xff
test edi, edi
je 0x5409f6
mov edi, dword [ebp - 0x2c]
mov ecx, eax
neg ecx
mov dword [ebp - 0x30], ecx
mov al, byte [esi]
mov ebx, edx
mov byte [ebp - 0x26], al
movzx eax, al
mov dword [ebp - 0x2c], eax
mov byte [esi], 0
cmp edx, ecx
jle 0x5408d3
mov dl, byte [ebp - 0x25]
xor cl, cl
mov dh, byte [ebp - 0x26]
mov esi, eax
mov byte [ebp - 0x26], cl
test ebx, ebx
jle 0x5408b1
mov al, dh
mov ecx, ebx
shl al, cl
jmp 0x5408bc
mov cl, bl
mov eax, esi
neg cl
shr ax, cl
and al, dl
mov cl, byte [ebp - 0x26]
sub ebx, edi
or cl, al
cmp ebx, dword [ebp - 0x30]
jg 0x5408a2
mov esi, dword [ebp - 0x38]
mov edx, dword [ebp - 0x3c]
mov byte [esi], cl
mov ecx, dword [ebp - 0x30]
inc esi
sub dword [ebp - 0x34], 1
mov dword [ebp - 0x38], esi
jne 0x540884
jmp 0x5409f6
mov edi, dword [edi]
xor eax, eax
mov ecx, dword [ebp - 0x30]
imul edi, ecx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x3c], edi
cmp bl, 8
jne 0x54095f
test edi, edi
je 0x5409f6
xor edx, edx
mov bh, byte [esi]
div ecx
movzx eax, bh
mov dword [ebp - 0x38], eax
mov byte [esi], 0
mov eax, dword [ebp + edx*4 - 0x14]
mov edx, dword [ebp + edx*4 - 0x24]
mov dword [ebp - 0x2c], edx
neg edx
mov dword [ebp - 0x40], edx
cmp eax, edx
jle 0x54094e
mov edi, dword [ebp - 0x38]
xor bl, bl
test eax, eax
jle 0x540933
mov dl, bh
mov ecx, eax
shl dl, cl
jmp 0x54093c
mov cl, al
mov edx, edi
neg cl
shr dx, cl
sub eax, dword [ebp - 0x2c]
or bl, dl
cmp eax, dword [ebp - 0x40]
jg 0x540927
mov edi, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x30]
mov byte [esi], bl
mov eax, dword [ebp - 0x34]
inc eax
inc esi
mov dword [ebp - 0x34], eax
cmp eax, edi
jb 0x5408ff
jmp 0x5409f6
test edi, edi
je 0x5409f6
xor edx, edx
lea ebx, [esi + 1]
div ecx
movzx ecx, byte [esi]
mov eax, 0x100
imul ecx, eax
movzx eax, byte [ebx]
mov dword [ebp - 0x48], ebx
mov ebx, dword [ebp + edx*4 - 0x14]
add cx, ax
movzx eax, cx
xor ecx, ecx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + edx*4 - 0x24]
mov dword [ebp - 0x44], eax
neg eax
mov dword [ebp - 0x2c], eax
cmp ebx, eax
jle 0x5409d4
mov edi, dword [ebp - 0x40]
mov esi, eax
movzx edx, cx
test ebx, ebx
jle 0x5409b4
mov ax, di
mov ecx, ebx
shl ax, cl
jmp 0x5409bd
mov cl, bl
mov eax, edi
neg cl
shr ax, cl
sub ebx, dword [ebp - 0x44]
movzx eax, ax
or edx, eax
movzx eax, dx
mov ecx, eax
cmp ebx, esi
jg 0x5409a3
mov esi, dword [ebp - 0x38]
mov edi, dword [ebp - 0x3c]
mov eax, ecx
shr eax, 8
mov byte [esi], al
mov esi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x34]
mov byte [esi], cl
inc esi
mov ecx, dword [ebp - 0x30]
inc eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], eax
cmp eax, edi
jb 0x540967
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.007dac04
leave
ret