Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
if (!empty($chk)) { $data_vers = json_decode($chk, true); $last_vers = $data_ver..
Decoded Output download
<? if (!empty($chk)) {
$data_vers = json_decode($chk, true);
$last_vers = $data_vers["v"];
$rx = mysqli_query($db, "SHOW COLUMNS FROM `setting` LIKE 'v'");
$check = mysqli_num_rows($rx);
if ($check == 0) {
mysqli_query($db, "ALTER TABLE `setting` ADD `v` INT NOT NULL AFTER `user_id`;");
$v = 0;
} else {
$v = get_setting("v");
}
if ($v < $last_vers) {
$update_all = 0;
$columns = query_get("https://cdn.tposter.pro/update_x.info");
$columns_data = json_decode($columns, true);
$colums_add = '';
$table_add = 0;
foreach ($columns_data as $table => $cols) {
foreach ($cols as $name => $type) {
$r = mysqli_query($db, "SHOW TABLES LIKE '{$table}'");
$is_table = mysqli_num_rows($r);
if ($is_table > 0) {
$rx = mysqli_query($db, "SHOW COLUMNS FROM `{$table}` LIKE '{$name}'");
$exist = mysqli_num_rows($rx);
if ($exist == 0) {
mysqli_query($db, "ALTER TABLE `{$table}` ADD `{$name}` {$type} NOT NULL");
$update_all++;
}
} else {
if ($name == "user_id") {
$def = " DEFAULT '1'";
} else {
$def = '';
}
$colums_add .= "`{$name}` {$type} NOT NULL {$def},";
}
}
if ($is_table == 0) {
mysqli_query($db, "CREATE TABLE `{$table}` (`id` int NOT NULL AUTO_INCREMENT,{$colums_add} PRIMARY KEY (id)) \xa\x9 \x9 \x9 \x9 \x9\x9 \x9\x9ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");
$table_add++;
}
}
mysqli_query($db, "UPDATE `setting` SET `v` = '{$last_vers}'");
}
} ?>
Did this file decode correctly?
Original Code
if (!empty($chk)) {
$data_vers = json_decode($chk, true);
$last_vers = $data_vers["\166"];
$rx = mysqli_query($db, "\123\x48\117\127\x20\103\x4f\114\125\x4d\116\123\40\106\122\117\115\x20\x60\x73\x65\x74\x74\151\x6e\147\140\x20\x4c\x49\x4b\x45\40\47\x76\x27");
$check = mysqli_num_rows($rx);
if ($check == 0) {
mysqli_query($db, "\101\x4c\x54\105\x52\x20\124\101\x42\114\x45\x20\x60\x73\x65\164\164\151\156\x67\x60\x20\x41\x44\x44\x20\x60\166\x60\x20\111\x4e\124\40\116\x4f\x54\40\116\x55\x4c\114\x20\101\106\124\x45\122\x20\x60\x75\163\x65\x72\137\151\x64\140\x3b");
$v = 0;
} else {
$v = get_setting("\166");
}
if ($v < $last_vers) {
$update_all = 0;
$columns = query_get("\150\164\164\x70\x73\x3a\57\x2f\143\x64\156\x2e\164\160\x6f\x73\164\145\162\x2e\160\162\157\57\165\x70\144\141\164\x65\137\x78\x2e\x69\x6e\x66\x6f");
$columns_data = json_decode($columns, true);
$colums_add = '';
$table_add = 0;
foreach ($columns_data as $table => $cols) {
foreach ($cols as $name => $type) {
$r = mysqli_query($db, "\x53\x48\x4f\x57\40\124\x41\x42\114\105\x53\40\114\x49\x4b\x45\x20\x27{$table}\47");
$is_table = mysqli_num_rows($r);
if ($is_table > 0) {
$rx = mysqli_query($db, "\x53\110\x4f\127\x20\103\x4f\114\x55\x4d\x4e\123\40\106\x52\x4f\x4d\x20\140{$table}\140\40\114\x49\x4b\x45\40\x27{$name}\x27");
$exist = mysqli_num_rows($rx);
if ($exist == 0) {
mysqli_query($db, "\101\x4c\124\x45\122\x20\124\101\102\114\105\40\x60{$table}\140\40\101\x44\104\40\140{$name}\140\40{$type}\40\116\117\x54\x20\x4e\x55\x4c\x4c");
$update_all++;
}
} else {
if ($name == "\x75\163\145\162\x5f\151\144") {
$def = "\40\104\105\106\x41\125\x4c\x54\x20\x27\61\47";
} else {
$def = '';
}
$colums_add .= "\x60{$name}\140\x20{$type}\40\x4e\x4f\x54\40\116\x55\114\x4c\x20{$def}\54";
}
}
if ($is_table == 0) {
mysqli_query($db, "\103\x52\x45\101\124\105\x20\x54\x41\102\x4c\105\x20\140{$table}\x60\x20\50\140\151\144\140\40\x69\x6e\x74\40\x4e\x4f\124\x20\x4e\125\x4c\114\40\101\x55\124\x4f\x5f\x49\x4e\103\122\x45\x4d\105\116\124\x2c{$colums_add}\x20\x50\x52\x49\x4d\101\122\x59\40\x4b\105\x59\40\50\x69\x64\x29\51\40\xa\x9\11\x9\11\x9\11\x9\11\11\x9\x9\11\x9\x9\x45\116\107\111\x4e\105\75\111\156\x6e\157\104\x42\40\x44\x45\x46\101\x55\x4c\x54\40\x43\x48\101\122\x53\x45\124\x3d\x75\x74\x66\70\x6d\x62\x34\40\x43\117\x4c\114\x41\x54\x45\x3d\165\164\x66\70\155\x62\x34\x5f\x67\145\x6e\x65\162\141\x6c\x5f\143\x69");
$table_add++;
}
}
mysqli_query($db, "\125\120\104\x41\124\105\x20\x60\163\145\164\x74\151\x6e\147\140\40\x53\105\124\x20\x60\x76\x60\40\x3d\x20\x27{$last_vers}\47");
}
}
Function Calls
None |
Stats
MD5 | d432854af7ca4b2903a33db9566a8220 |
Eval Count | 0 |
Decode Time | 37 ms |