Обойти лицензию или создать кейген [требует правки]

262
26 февраля 2017, 10:39

Всем привет. Декодировал скрипт закрытый ioncude, в php не силен, но очень нужно обойти лицензию, или создать кейген, если есть тут мудрые люди, которые могут помочь, буду очень рад. Вот код скрипта. В идеале лучше конечно создать кейген, чтобы генерить лицензию, но тоже не знаю как.

<?php 
    function xorcoding($text, $key, $shift = 0, $type = '') { 
        if ($type == 'decode') { 
            $text = base64_decode( $text ); 
        } 
 
 
        if (!is_array( $shift )) { 
            $shift = array( $shift ); 
        } 
 
        foreach ($shift as $v) { 
            $v = (int)$v; 
 
            if (( 255 < $v || $v < 0 - 255 )) { 
                return false; 
            } 
        } 
 
        $output = ''; 
        $klng = strlen( $key ); 
        $tlng = strlen( $text ); 
        $shlng = sizeof( $shift ); 
 
        if ($type == 'encode') { 
            $i = 409; 
            $j = 409; 
 
            while ($i < $tlng) { 
                if ($shlng <= $j) { 
                    $j = 409; 
                } 
 
                $code = ord( $text[$i] ) + $shift[$j]; 
 
                if (255 < $code) { 
                    $code -= 665; 
                } 
 
 
                if ($code < 0) { 
                    $code += 665; 
                } 
 
                $text[$i] = chr( $code ); 
                ++$i; 
                ++$j; 
            } 
        } 
 
        $i = 409; 
        $j = 409; 
 
        while ($i < $tlng) { 
            if ($klng <= $j) { 
                $j = 409; 
            } 
 
            $output .= chr( ord( $key[$j] ) ^ ord( $text[$i] ) ); 
            ++$i; 
            ++$j; 
        } 
 
 
        if ($type == 'decode') { 
            $i = 409; 
            $j = 409; 
 
            while ($i < $tlng) { 
                if ($shlng <= $j) { 
                    $j = 409; 
                } 
 
                $code = ord( $output[$i] ) - $shift[$j]; 
 
                if (255 < $code) { 
                    $code -= 665; 
                } 
 
 
                if ($code < 0) { 
                    $code += 665; 
                } 
 
                $output[$i] = chr( $code ); 
                ++$i; 
                ++$j; 
            } 
        } 
 
 
        if ($type == 'encode') { 
            $output = base64_encode( $output ); 
        } 
 
        return $output; 
    } 
 
    session_start(  ); 
    require_once( 'config.php' ); 
 
    if (( ( isset( $_REQUEST['activate'] ) && isset( $_REQUEST['license'] ) ) && $_REQUEST['license'] )) { 
        $php = file_get_contents( 'config.php' ); 
        $php = str_replace( '$license = \'\';', '$license = \'' . $_REQUEST['license'] . '\';', $php ); 
        file_put_contents( 'config.php', $php ); 
        header( 'Location: index.php' ); 
        exit(  ); 
    } 
 
    ob_start(  ); 
    phpinfo(  ); 
    $html = ob_get_contents(  ); 
    ob_end_clean(  ); 
    $parser = new Parser(  ); 
    $host = $parser->parse_string( $html, '|<tr><td class="e">HTTP_HOST </td><td class="v">(.*?)</td></tr>|' ); 
 
    if (!$host) { 
        $host = $_SERVER['HTTP_HOST'] . ' '; 
    } 
 
    $shift_scr = array( 52, 0 - 61, 17, 0 - 92, 49 ); 
    $shift_lic = array( 48, 12, 0 - 10, 57, 29, 0 - 8 ); 
    $key_scr = 'kiui543hi73412fyhrt'; 
    $key_lic = 'tyunkio7w435yujasduie'; 
 
    if ($license) { 
        $license = xorcoding( $license, $key_lic, $shift_lic, 'decode' ); 
        $hostl = $license; 
 
        if ($hostl !== $host) { 
            exit( 'Лицензия неверна!!! Лицензию для текущего домена можно сгенерировать в админке скрипта!' ); 
        } 
    } 
else { 
        $key = '' . $host; 
        $key = xorcoding( $key, $key_scr, $shift_scr, 'encode' ); 
        $smarty->assign( 'key', $key ); 
        $smarty->assign( 'host', $host ); 
        $errors = $application->check_perms( true ); 
        $smarty->assign( 'errors', $errors ); 
        $content = $smarty->fetch( 'activate.tpl' ); 
        $smarty->assign( 'content', $content ); 
        $smarty->display( 'index.tpl' ); 
        exit(  ); 
    } 
 
    $cms = new CMS( '..' ); 
    $log = (isset( $_SESSION['login'] ) ? $_SESSION['login'] : get_req_var( 'login' )); 
 
    if (isset( $_SESSION['password'] )) { 
        $pass = $_SESSION['password']; 
    } 
else { 
        $pass = get_req_var( 'password' ); 
 
        if ($cms->cms == 'dle') { 
            md5( md5( $pass ) ); 
            $pass = $_SESSION['password']; 
        } 
else { 
            if ($cms->cms == 'drupal') { 
                $pass = Drupal::password_hash( $pass ); 
            } 
else { 
                md5( $pass ); 
                $pass = $_SESSION['password']; 
            } 
        } 
    } 
 
 
    if (( $log && $pass )) { 
        $auth = $cms->authorize_user( $log, $pass ); 
 
        if ($auth) { 
            $_SESSION['login'] = $log; 
            $_SESSION['password'] = $pass; 
        } 
else { 
            $smarty->assign( 'error', 'Неверная пара логин / пароль!' ); 
            $content = $smarty->fetch( 'auth.tpl' ); 
            $smarty->assign( 'content', $content ); 
            $smarty->display( 'index.tpl' ); 
            exit(  ); 
        } 
    } 
else { 
        $smarty->assign( 'error', '' ); 
        $content = $smarty->fetch( 'auth.tpl' ); 
        $smarty->assign( 'content', $content ); 
        $smarty->display( 'index.tpl' ); 
        exit(  ); 
    } 
 
    $smarty->assign( 'menu', 1 ); 
    $do = get_req_var( 'do', 'settings' ); 
    switch ($do) { 
        case 'settings': { 
            $cms = new CMS( ROOT . '/..' ); 
            $cats = $cms->get_cats( 'video' ); 
            $smarty->assign( 'cats', $cats ); 
            $smarty->assign( 'settings', $settings ); 
            $smarty->assign( 'page', 'settings' ); 
            $smarty->assign( 'page_title', 'Настройки' ); 
            $content = $smarty->fetch( 'settings.tpl' ); 
            break; 
        } 
 
        case 'requests': { 
            $total = 649; 
            $page = get_req_var( 'page', 1 ); 
            $requests = $cms->driver->db->selectPage( $total, 'SELECT * FROM ?_requests LIMIT ?d, ?d', ( $page - 1 ) * 100, 100 ); 
            $smarty->assign( 'requests', $requests ); 
            $smarty->assign( 'pages', ceil( $total / 100 ) ); 
            $smarty->assign( 'cur_page', $page ); 
            $smarty->assign( 'page', 'requests' ); 
            $smarty->assign( 'page_title', 'Запросы' ); 
            $content = $smarty->fetch( 'requests.tpl' ); 
            break; 
        } 
 
        default: { 
            $smarty->assign( 'page', '' ); 
            $smarty->assign( 'page_title', '' ); 
            $content = $smarty->fetch( 'main.tpl' ); 
            break; 
        } 
    } 
 
    $smarty->assign( 'content', $content ); 
    $smarty->display( 'index.tpl' );

READ ALSO
mysql упорядочить по возрастанию

mysql упорядочить по возрастанию

есть база данных с таблицей user, в ней в столбце rsite отображается информация с какого сайта пришел пользователейпытаюсь сделать вывод количества...

314
Как определить, какой шаблон подключён в данный момент?

Как определить, какой шаблон подключён в данный момент?

ЗдравствуйтеДопустим в админке wordpress для главной страницы магазина назначен определённый шаблон, т

205