Function at 0x401450
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x14
push ebp
push esi
mov esi, dword [esp + 0x20]
test esi, esi
push edi
je 0x4016db
mov edi, dword [esp + 0x2c]
test edi, edi
je 0x4016db
mov ebp, dword [esp + 0x30]
test ebp, ebp
je 0x4016db
mov eax, dword [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x2c]
push eax
push ebx
call fcn.004013d0
mov ecx, dword [ebp]
add esp, 8
cmp ecx, eax
jge 0x40149e
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x14
ret
mov eax, ebx
cdq
mov ecx, 3
idiv ecx
mov ecx, 0x4c
mov dword [esp + 0x28], 0
mov ebp, 0x13
mov bl, 0xd8
shl eax, 2
mov dword [esp + 0x20], edx
cdq
idiv ecx
mov ecx, eax
xor eax, eax
test ecx, ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], eax
jl 0x4015c3
mov edx, dword [esp + 0x38]
and edx, 2
mov dword [esp + 0x1c], edx
mov bl, 0xfd
cmp eax, ecx
jne 0x4014fe
mov eax, dword [esp + 0x14]
cdq
and edx, 3
add eax, edx
mov ebp, eax
sar ebp, 2
test ebp, ebp
jle 0x401585
mov edx, ebp
jmp 0x401510
mov byte [0x431c80], 0xf0
movzx ecx, byte [esi]
shl ecx, 8
inc esi
mov byte [0x431c80], 0xf0
movzx eax, byte [esi]
or ecx, eax
shl ecx, 8
inc esi
mov byte [0x431c80], 0xf0
movzx eax, byte [esi]
or ecx, eax
shl ecx, 8
mov eax, ecx
shr eax, 0x1a
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [edi], al
shl ecx, 6
mov eax, ecx
shr eax, 0x1a
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [edi + 1], al
inc esi
shl ecx, 6
inc edi
mov eax, ecx
shr eax, 0x1a
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
shr ecx, 0x14
inc edi
mov byte [edi], al
and ecx, 0x3f
mov cl, byte [ecx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc edi
mov byte [edi], cl
inc edi
dec edx
jne 0x401510
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x28]
lea eax, [edx + ebp*4]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
test eax, eax
mov byte [0x431c80], 0x28
jne 0x4015b2
mov eax, dword [esp + 0x28]
mov byte [edi], 0xd
inc edi
mov byte [edi], 0xa
inc edi
add eax, 2
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jle 0x4014ed
mov al, byte [0x431c80]
sub al, 0x31
and bl, al
mov eax, dword [esp + 0x28]
test eax, eax
je 0x4015eb
test byte [esp + 0x38], 2
jne 0x4015eb
mov eax, dword [esp + 0x28]
sub edi, 2
sub eax, 2
mov bl, 0x28
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x20]
xor bl, 0xfa
test ecx, ecx
mov byte [0x431c80], 0x28
je 0x4016c4
lea ebp, [ecx + 1]
test ebp, ebp
je 0x4016c4
mov al, bl
sub al, 0x14
and al, 0x28
mov byte [0x431c80], al
sub al, 0x13
and bl, al
xor eax, eax
test ecx, ecx
jle 0x401625
movzx eax, byte [esi]
inc esi
shl eax, 8
cmp ecx, 1
jle 0x401633
movzx edx, byte [esi]
or eax, edx
inc esi
shl eax, 8
cmp ecx, 2
jle 0x401640
movzx ecx, byte [esi]
or eax, ecx
shl eax, 8
and bl, 0x12
test ebp, ebp
mov byte [0x431c80], 0x20
jle 0x401667
mov esi, ebp
mov edx, eax
shr edx, 0x1a
mov cl, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [edi], cl
inc edi
shl eax, 6
dec esi
jne 0x401653
mov ecx, dword [esp + 0x28]
mov al, byte [esp + 0x38]
mov dl, bl
sub dl, 7
add bl, 2
shl dl, 1
and dl, bl
mov bl, byte [0x431c80]
and bl, dl
add ecx, ebp
test al, 1
mov byte [0x431c80], bl
mov dword [esp + 0x28], ecx
jne 0x4016c4
mov edx, 4
sub edx, ebp
test edx, edx
jle 0x4016b3
mov ecx, edx
mov esi, ecx
shr ecx, 2
mov eax, 0x3d3d3d3d
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x28]
add eax, edx
mov byte [0x431c80], 0
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x28]
pop ebx
pop edi
pop esi
mov dword [eax], ecx
mov eax, 1
pop ebp
add esp, 0x14
ret
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x14
ret