Example #1
0
function PrepareScript($testname, $obfu, $subs)
{
    if (is_array($subs)) {
        // Keys from the argument will overwrite those from the base array.
        $subs = array_merge(GetBaseSubs(), $subs);
    } else {
        if ($subs) {
            // A truthy value indicates that the base array should be used.
            $subs = GetBaseSubs();
        }
    }
    if (is_string($obfu)) {
        $code = GetObfuscatedPayload($testname, $obfu, $subs);
    } else {
        $code = GetPayload($testname, $subs);
    }
    return urlencode('<script>' . $code . '</script>');
}
Example #2
0
function PrepareScript($testname, $obfu, $subs)
{
    if (is_array($subs)) {
        // Keys from the argument will overwrite those from the base array.
        $subs = array_merge(GetBaseSubs(), $subs);
    } else {
        if ($subs) {
            // A truthy value indicates that the base array should be used.
            $subs = GetBaseSubs();
        }
    }
    if (is_string($obfu)) {
        $code = GetObfuscatedPayload($testname, $obfu, $subs);
    } else {
        $code = GetPayload($testname, $subs);
    }
    $code = str_replace(array("\\", "'", "\n", "\r"), array("\\\\", "\\'", '\\n', '\\r'), $code);
    return $code;
}
Example #3
0
function PrepareScript($testname, $obfu, $subs)
{
    if (is_array($subs)) {
        // Keys from the argument will overwrite those from the base array.
        $subs = array_merge(GetBaseSubs(), $subs);
    } else {
        if ($subs) {
            // A truthy value indicates that the base array should be used.
            $subs = GetBaseSubs();
        }
    }
    if (is_string($obfu)) {
        $code = GetObfuscatedPayload($testname, $obfu, $subs);
    } else {
        $code = GetPayload($testname, $subs);
    }
    // No further processing needed to directly return a script.
    return $code;
}