Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php function createNewActivationLockBypassCodeOutHash(&$outHash = null) { ..
Decoded Output download
<?php
function createNewActivationLockBypassCodeOutHash(&$outHash = null) {
define('RANDOM_BYTES_LENGTH', 16);
define('SALT_LENGTH', 4);
define('MCBYPASS_CODE_LENGTH', 31);
define('MCBYPASS_CODE_BUFFER_LENGTH', 32);
define('MCBYPASS_RAW_BYTES_LENGTH', 16);
define('MCBYPASS_HASH_LENGTH', 32);
$kSymbols = "0123456789ACDEFGHJKLMNPQRTUVWXYZ";
$kDashPositions = [5, 10, 14, 18, 22];
$rawBytes = random_bytes(RANDOM_BYTES_LENGTH);
$salt = "";
$hash = hash_pbkdf2('sha256', $rawBytes, $salt, 50000, MCBYPASS_HASH_LENGTH, true);
if ($outHash !== null) {
$outHash = bin2hex($hash);
}
$outputCharacterCount = 0;
$nextDashPosition = 0;
$code = '';
$inputCursor = 0;
define('INPUT_BITS', 128);
define('BITS_PER_BYTE', 8);
define('BITS_PER_SYMBOL', 5);
$bitsProcessed = 0;
$bitOffsetIntoByte = 0;
while ($bitsProcessed <= (INPUT_BITS - BITS_PER_SYMBOL)) {
$bitsThisByte = ($bitOffsetIntoByte < BITS_PER_BYTE - BITS_PER_SYMBOL) ? BITS_PER_SYMBOL : BITS_PER_BYTE - $bitOffsetIntoByte;
$bitsNextByte = ($bitsThisByte < BITS_PER_SYMBOL) ? BITS_PER_SYMBOL - $bitsThisByte : 0;
$value = ((ord($rawBytes[$inputCursor]) << $bitOffsetIntoByte) & 0xff) >> (BITS_PER_BYTE - $bitsThisByte);
$bitOffsetIntoByte += BITS_PER_SYMBOL;
if ($bitOffsetIntoByte >= BITS_PER_BYTE) {
$bitOffsetIntoByte -= BITS_PER_BYTE;
$inputCursor++;
}
if ($bitsNextByte) {
$value <<= $bitsNextByte;
$value |= (ord($rawBytes[$inputCursor]) >> (BITS_PER_BYTE - $bitsNextByte));
}
$code .= $kSymbols[$value];
$outputCharacterCount++;
if ($outputCharacterCount == $kDashPositions[$nextDashPosition]) {
$nextDashPosition++;
$code .= '-';
}
$bitsProcessed += BITS_PER_SYMBOL;
}
$bitsRemaining = INPUT_BITS - $bitsProcessed;
if ($bitsRemaining) {
$value = ((ord($rawBytes[$inputCursor]) << $bitOffsetIntoByte) & 0xff) >> (BITS_PER_BYTE - $bitsRemaining);
$code .= $kSymbols[$value];
}
return $code;
} ?>
Did this file decode correctly?
Original Code
<?php
function createNewActivationLockBypassCodeOutHash(&$outHash = null) {
define('RANDOM_BYTES_LENGTH', 16);
define('SALT_LENGTH', 4);
define('MCBYPASS_CODE_LENGTH', 31);
define('MCBYPASS_CODE_BUFFER_LENGTH', 32);
define('MCBYPASS_RAW_BYTES_LENGTH', 16);
define('MCBYPASS_HASH_LENGTH', 32);
$kSymbols = "0123456789ACDEFGHJKLMNPQRTUVWXYZ";
$kDashPositions = [5, 10, 14, 18, 22];
$rawBytes = random_bytes(RANDOM_BYTES_LENGTH);
$salt = "\x00\x00\x00\x00";
$hash = hash_pbkdf2('sha256', $rawBytes, $salt, 50000, MCBYPASS_HASH_LENGTH, true);
if ($outHash !== null) {
$outHash = bin2hex($hash);
}
$outputCharacterCount = 0;
$nextDashPosition = 0;
$code = '';
$inputCursor = 0;
define('INPUT_BITS', 128);
define('BITS_PER_BYTE', 8);
define('BITS_PER_SYMBOL', 5);
$bitsProcessed = 0;
$bitOffsetIntoByte = 0;
while ($bitsProcessed <= (INPUT_BITS - BITS_PER_SYMBOL)) {
$bitsThisByte = ($bitOffsetIntoByte < BITS_PER_BYTE - BITS_PER_SYMBOL) ? BITS_PER_SYMBOL : BITS_PER_BYTE - $bitOffsetIntoByte;
$bitsNextByte = ($bitsThisByte < BITS_PER_SYMBOL) ? BITS_PER_SYMBOL - $bitsThisByte : 0;
$value = ((ord($rawBytes[$inputCursor]) << $bitOffsetIntoByte) & 0xff) >> (BITS_PER_BYTE - $bitsThisByte);
$bitOffsetIntoByte += BITS_PER_SYMBOL;
if ($bitOffsetIntoByte >= BITS_PER_BYTE) {
$bitOffsetIntoByte -= BITS_PER_BYTE;
$inputCursor++;
}
if ($bitsNextByte) {
$value <<= $bitsNextByte;
$value |= (ord($rawBytes[$inputCursor]) >> (BITS_PER_BYTE - $bitsNextByte));
}
$code .= $kSymbols[$value];
$outputCharacterCount++;
if ($outputCharacterCount == $kDashPositions[$nextDashPosition]) {
$nextDashPosition++;
$code .= '-';
}
$bitsProcessed += BITS_PER_SYMBOL;
}
$bitsRemaining = INPUT_BITS - $bitsProcessed;
if ($bitsRemaining) {
$value = ((ord($rawBytes[$inputCursor]) << $bitOffsetIntoByte) & 0xff) >> (BITS_PER_BYTE - $bitsRemaining);
$code .= $kSymbols[$value];
}
return $code;
}
Function Calls
None |
Stats
MD5 | 75b3013cfeac3e35502f831466fc2dc7 |
Eval Count | 0 |
Decode Time | 66 ms |