$result = "";
for ($i = 0; $i < $iterations; $i++) {
    $guess = pack('H*', implode(keyMaker($guessArray)));
    $plaintext = mcrypt_decrypt(MCRYPT_DES, $guess, $cipher, MODE, $iv);
    //echo implode(keyMaker($guessArray))."\n";
    if (strstr($plaintext, $needle)) {
        $result = array();
        $result["key"] = implode(keyMaker($guessArray));
        $result["plainText"] = $plaintext;
        $result["hashCheck"] = md5(trim($plaintext)) == $hash;
        $result["hash"] = md5(trim($plaintext));
        //        file_put_contents("result.json", str_replace('\u0000', "", json_encode($result)));
        die("found it" . str_replace('\\u0000', "", json_encode($result)));
        break;
    }
    $guessArray = updateKey($guessArray);
}
//file_put_contents("result.json", "{\"result\": \"no\"}");
die("didnt find");
function keyMaker($keyArray)
{
    $key = array();
    for ($i = 0; $i < 16; $i++) {
        switch ($keyArray[$i]) {
            case 10:
                $key[$i] = "A";
                break;
            case 11:
                $key[$i] = "B";
                break;
            case 12:
Beispiel #2
0
$basePath = strstr($_SERVER['PHP_SELF'], "/index.php") ? "." : "..";
if (isset($_GET['success'])) {
    // We were redirected here from PayPal after the buyer approved/cancelled
    // the payment
    if ($_GET['success'] == 'true' && isset($_GET['PayerID']) && isset($_GET['orderid'])) {
        $orderinfo = getOrderInfo();
        $orderId = trim($_GET['orderid']);
        $payerId = $_GET['PayerID'];
        if (strcmp($orderId, $orderinfo['id']) != 0) {
            $messageType = "error";
            $message = "Session time out!Payment was cancelled.!";
        } else {
            try {
                $extent = "";
                if (isset($orderinfo["key"])) {
                    $keyresult = updateKey($orderinfo["key"], $orderinfo["daylimit"], $orderinfo["price"], $payerId);
                    $extent = "had been extentsion successfull!";
                } else {
                    $keyresult = insertKey($orderinfo["email"], $orderinfo["ime"], $orderinfo["deviceid"], $orderinfo["devicetype"], $payerId, $orderinfo['daylimit'], $orderinfo['price']);
                }
                if (!$keyresult) {
                    throw new Exception("Error when processing! Please contact admin");
                }
                $payment = executePayment($orderinfo['payment_id'], $payerId);
                $messageType = "success";
                $message = "Your payment was successful. Your license key is <strong style='color:red'> {$keyresult}</strong>";
                if ($extent != "") {
                    $message .= " " . $extent;
                }
            } catch (\PayPal\Exception\PPConnectionException $ex) {
                $message = parseApiError($ex->getData());
        $i = 0;
        $j++;
        $out = "";
    }
    $out .= "Arguments = " . implode(keyMaker($keyArray)) . " " . $jobSize . "\n";
    $out .= "Queue\n\n";
    echo implode(keyMaker($keyArray)) . "\n";
    if ($keyArray == array(15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) {
        $out .= "Arguments = " . implode(keyMaker($keyArray)) . " " . $jobSize . "\n";
        $out .= "Queue\n\n";
        $j++;
        write($out, $j);
        die("done");
    }
    $then = microtime();
    $keyArray = updateKey($keyArray);
    $now = microtime();
    $updateTime = ($now - $then + $updateTime) / 2;
    //echo $updateTime . "\n";
    $i++;
}
function write($out, $j)
{
    global $base;
    $out = $base . $out;
    file_put_contents("./sub/des." . $j . ".submit", $out);
    //die("done");
}
function updateKey($keyArray)
{
    $keyArray[14]++;