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 $path = "\56\x2e\x2f\56\56\57\x2e\56\x2f\56\56\57"; require_once $path . "\57\x63\..

Decoded Output download

<?php 
 $path = "../../../../"; require_once $path . "/components/vdv/database/model/ini.inc.php"; require_once $path . "/components/vdv/database/model/ini.db.open.php"; require_once $path . "/components/vdv/database/model/ini_vdv_prepare_query.php"; function executeSQL($sql, $sqlType) { global $Host, $Portnumber, $DbName; if ($sqlType == "create" || $sqlType == "alter") { $U = "db_robot_super"; $P = "vdvPg95a78Hj"; $newdb = new PDO("mysql:host={$Host};port={$Portnumber};dbname={$DbName}", $U, $P); $cTstmt = $newdb->prepare($sql); $cTstmt->execute(); } else { global $db; global $db_type; $query = $sql; $parameters = array("query" => $query, "db" => $db, "db_type" => $db_type); $stmt = vdv_prepare_query($parameters); $stmt->execute(); } } function findSQLFiles($dirPath) { $fileList = array(); foreach (glob($dirPath . "sql.json") as $filename) { $jsonComponentString = file_get_contents($filename); } } function validateSQL($stringToValidate, $category, &$result) { if ($result == 1) { $valid = null; switch ($category) { case "col_name": $pattern = "/^[a-zA-Z0-9_][a-zA-Z0-9_]*$/"; $valid = preg_match($pattern, $stringToValidate); break; case "col_type": $pattern = "/(INT|TINYINT|SMALLINT|MEDIUMINT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATE|DATETIME|TIMESTAMP|TIME|YEAR|CHAR|VARCHAR|BLOB|TEXT|TINYBLOB|TINYTEXT|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM)/i"; $valid = preg_match($pattern, $stringToValidate); break; default: break; } $result = $valid; } } function parseAlter($index, $val, $option) { $validColumn = true; $validType = true; $sqlArray = array(); foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $method = $valueRoot->method; $sql = "ALTER TABLE " . $table; switch ($method) { case "add": foreach ($valueRoot->fields as $key => $value) { if ($option == "validate") { validateSQL($value->col_name, "col_name", $validColumn); validateSQL($value->col_type, "col_type", $validType); } $sql .= " ADD COLUMN " . $value->col_name . " " . $value->col_type; if ($value->null == false) { $sql .= " NOT NULL"; } if (isset($value->default_value)) { $sql .= " DEFAULT '" . $value->default_value . "'"; } $sql .= ", "; } $sql = substr_replace($sql, '', -2); break; case "changeType": foreach ($valueRoot->fields as $key => $value) { if ($option == "validate") { validateSQL($value->col_name, "col_name", $validColumn); validateSQL($value->col_type, "col_type", $validType); } $sql .= " MODIFY " . $value->col_name . " " . $value->col_type; if ($value->null == false) { $sql .= " NOT NULL"; } $sql .= ", "; } $sql = substr_replace($sql, '', -2); break; } $sqlArray[] = $sql; } if ($option == "validate") { if ($validColumn && $validType) { return true; } else { return false; } } if ($option == "construct") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "alter"); } } } function parseInsert($index, $val, $option) { $sqlArray = array(); $validColumn = true; foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $sql = "INSERT INTO " . $table . "("; foreach ($valueRoot->fields as $key => $value) { if ($option == "validate") { validateSQL($value->col_name, "col_name", $validColumn); } $sql .= $value->col_name . ", "; } $sql = substr_replace($sql, '', -2); $sql .= ") VALUES ("; foreach ($valueRoot->fields as $key => $value) { switch (gettype($value->value)) { case "boolean": $sql .= $value->value; break; case "integer": case "double": $sql .= $value->value; break; case "string": $sql .= "'" . $value->value . "'"; break; } $sql .= ", "; } $sql = substr_replace($sql, '', -2); $sql .= ")"; $sqlArray[] = $sql; } if ($option == "validate") { if ($validColumn) { return true; } } if ($option == "construct") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "insert"); } } } function parseUpdate($index, $val, $option) { $sqlArray = array(); if ($option == "construct") { foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $field = $valueRoot->field; $newValue = $valueRoot->newValue; $sql = "UPDATE " . $table . " SET " . $field . "=" . $newValue . " WHERE "; foreach ($valueRoot->conditionals as $conditionalKey => $conditionalValue) { $sql .= $conditionalKey . "=" . $conditionalValue . " AND "; } $sql = substr_replace($sql, '', -5); $sqlArray[] = $sql; } foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "update"); } } else { return true; } } function parseCreate($index, $val, $option) { $validColumn = true; $validType = true; $sqlArray = array(); foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $sql = "CREATE TABLE " . $table . " ("; foreach ($valueRoot->fields as $key => $value) { if ($option == "validate") { validateSQL($value->col_name, "col_name", $validColumn); validateSQL($value->col_type, "col_type", $validType); } $sql .= $value->col_name . " " . $value->col_type; if (isset($value->null)) { if ($value->null == false) { $sql .= " NOT NULL"; } } if (isset($value->default_value)) { $sql .= " DEFAULT '" . $value->default_value . "'"; } if (isset($value->auto_increment)) { if ($value->auto_increment == true) { $sql .= " AUTO_INCREMENT"; } } $sql .= ", "; } if (isset($valueRoot->primary_key) || isset($valueRoot->index)) { if (isset($valueRoot->primary_key)) { $sql .= " PRIMARY KEY("; foreach ($valueRoot->primary_key as $i => $j) { $sql .= $j . ","; } $sql .= ")"; } } else { $sql = substr_replace($sql, '', -2); } $sql = substr_replace($sql, '', -2); $sql .= ")"; $sql .= ")"; $sqlArray[] = $sql; } if ($option == "validate") { if ($validColumn && $validType) { return true; } } if ($option == "construct") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "create"); } } } function isJson($jsonString) { json_decode($jsonString); if (json_last_error() == JSON_ERROR_NONE) { return true; } else { return false; } } function parseSQL($dirPath, $option, $currentVer) { $valid = true; $validCreate = true; $validAlter = true; $validInsert = true; $validUpdate = true; $fileName = $dirPath . "sql.json"; if (file_exists($fileName)) { $jsonComponentString = file_get_contents($fileName); if (isJson($jsonComponentString)) { $jsonData = json_decode($jsonComponentString); foreach ($jsonData->sql as $key => $value) { if (isset($value->create) && version_compare($key, $currentVer) > 0) { $validCreate = parseCreate($key, $value->create, $option); } if (isset($value->alter) && version_compare($key, $currentVer) > 0) { $validAlter = parseAlter($key, $value->alter, $option); } if (isset($value->insert) && version_compare($key, $currentVer) > 0) { $validInsert = parseInsert($key, $value->insert, $option); } if (isset($value->update) && version_compare($key, $currentVer) > 0) { $validUpdate = parseUpdate($key, $value->update, $option); } } } } $valid = null; if ($validCreate != true || $validInsert != true || $validAlter != true || $validUpdate != true) { $valid = false; } else { $valid = true; } if ($option == "validate") { return $valid; } if ($option == "execute") { } } ?> 

Did this file decode correctly?

Original Code

<?php
 $path = "\56\x2e\x2f\56\56\57\x2e\56\x2f\56\56\57"; require_once $path . "\57\x63\x6f\155\x70\157\x6e\x65\x6e\x74\163\57\166\x64\166\57\144\141\164\x61\142\141\163\145\x2f\155\x6f\144\145\x6c\x2f\151\x6e\151\x2e\151\x6e\143\x2e\160\150\160"; require_once $path . "\57\143\157\x6d\x70\x6f\x6e\145\156\164\163\57\166\x64\x76\57\x64\141\164\x61\x62\141\163\x65\57\155\x6f\x64\145\x6c\57\x69\156\x69\x2e\144\x62\56\x6f\160\x65\x6e\56\160\150\x70"; require_once $path . "\57\x63\157\x6d\x70\x6f\156\x65\x6e\164\163\x2f\x76\x64\x76\x2f\x64\x61\164\x61\x62\141\x73\145\57\x6d\x6f\144\145\154\57\151\x6e\x69\137\166\x64\x76\137\x70\162\x65\x70\141\162\145\137\161\165\x65\162\x79\x2e\x70\x68\160"; function executeSQL($sql, $sqlType) { global $Host, $Portnumber, $DbName; if ($sqlType == "\x63\162\145\141\164\145" || $sqlType == "\x61\x6c\x74\x65\x72") { $U = "\x64\142\137\162\157\x62\157\x74\x5f\163\165\x70\x65\x72"; $P = "\x76\x64\x76\x50\147\71\65\141\67\70\x48\152"; $newdb = new PDO("\155\x79\163\161\154\x3a\x68\x6f\x73\x74\75{$Host}\x3b\x70\x6f\x72\x74\x3d{$Portnumber}\x3b\x64\142\x6e\x61\x6d\145\75{$DbName}", $U, $P); $cTstmt = $newdb->prepare($sql); $cTstmt->execute(); } else { global $db; global $db_type; $query = $sql; $parameters = array("\161\x75\145\x72\x79" => $query, "\144\142" => $db, "\x64\142\137\x74\x79\x70\x65" => $db_type); $stmt = vdv_prepare_query($parameters); $stmt->execute(); } } function findSQLFiles($dirPath) { $fileList = array(); foreach (glob($dirPath . "\x73\x71\154\56\152\x73\x6f\x6e") as $filename) { $jsonComponentString = file_get_contents($filename); } } function validateSQL($stringToValidate, $category, &$result) { if ($result == 1) { $valid = null; switch ($category) { case "\x63\x6f\154\137\x6e\141\155\x65": $pattern = "\57\136\133\141\x2d\x7a\x41\55\x5a\60\x2d\x39\137\135\133\x61\x2d\172\x41\55\132\x30\x2d\71\137\135\52\x24\x2f"; $valid = preg_match($pattern, $stringToValidate); break; case "\143\x6f\154\x5f\x74\171\160\145": $pattern = "\57\x28\111\x4e\x54\x7c\124\x49\116\131\111\116\x54\174\123\x4d\x41\114\114\x49\116\x54\174\x4d\x45\x44\111\125\x4d\111\116\124\x7c\102\x49\107\111\x4e\124\174\106\x4c\x4f\x41\124\174\104\x4f\x55\102\114\x45\174\x44\105\x43\x49\115\101\114\x7c\x44\101\124\105\x7c\x44\x41\x54\105\124\x49\115\x45\174\124\x49\115\x45\123\x54\x41\115\x50\x7c\x54\x49\x4d\105\174\131\105\x41\122\x7c\103\x48\x41\x52\x7c\126\101\122\x43\x48\101\x52\x7c\102\114\x4f\102\x7c\124\x45\130\124\174\x54\x49\116\x59\102\x4c\x4f\x42\174\124\x49\x4e\131\x54\105\x58\x54\174\x4d\105\x44\111\x55\x4d\102\114\x4f\102\x7c\115\x45\x44\x49\125\115\x54\105\130\124\174\x4c\117\116\107\102\114\117\102\174\114\x4f\116\x47\124\x45\x58\x54\174\x45\116\x55\x4d\x29\x2f\x69"; $valid = preg_match($pattern, $stringToValidate); break; default: break; } $result = $valid; } } function parseAlter($index, $val, $option) { $validColumn = true; $validType = true; $sqlArray = array(); foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $method = $valueRoot->method; $sql = "\101\114\x54\x45\x52\40\124\x41\102\114\x45\x20" . $table; switch ($method) { case "\141\144\x64": foreach ($valueRoot->fields as $key => $value) { if ($option == "\x76\x61\x6c\151\x64\x61\164\145") { validateSQL($value->col_name, "\x63\157\x6c\137\x6e\x61\x6d\145", $validColumn); validateSQL($value->col_type, "\143\x6f\154\x5f\x74\171\160\x65", $validType); } $sql .= "\40\x41\x44\104\40\103\117\114\125\115\116\40" . $value->col_name . "\40" . $value->col_type; if ($value->null == false) { $sql .= "\x20\116\x4f\x54\x20\116\x55\114\114"; } if (isset($value->default_value)) { $sql .= "\x20\x44\x45\106\x41\125\x4c\x54\x20\x27" . $value->default_value . "\47"; } $sql .= "\54\40"; } $sql = substr_replace($sql, '', -2); break; case "\x63\150\x61\x6e\147\x65\x54\171\160\x65": foreach ($valueRoot->fields as $key => $value) { if ($option == "\166\x61\x6c\151\144\x61\164\145") { validateSQL($value->col_name, "\143\157\154\137\156\141\x6d\x65", $validColumn); validateSQL($value->col_type, "\x63\157\x6c\x5f\x74\171\x70\145", $validType); } $sql .= "\40\x4d\117\x44\111\x46\131\40" . $value->col_name . "\x20" . $value->col_type; if ($value->null == false) { $sql .= "\x20\x4e\x4f\124\x20\116\x55\114\114"; } $sql .= "\x2c\40"; } $sql = substr_replace($sql, '', -2); break; } $sqlArray[] = $sql; } if ($option == "\166\141\x6c\151\x64\x61\x74\145") { if ($validColumn && $validType) { return true; } else { return false; } } if ($option == "\143\x6f\x6e\163\x74\162\165\143\164") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "\141\x6c\x74\145\162"); } } } function parseInsert($index, $val, $option) { $sqlArray = array(); $validColumn = true; foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $sql = "\x49\x4e\123\105\122\124\40\x49\116\124\x4f\x20" . $table . "\50"; foreach ($valueRoot->fields as $key => $value) { if ($option == "\x76\x61\154\x69\144\x61\x74\x65") { validateSQL($value->col_name, "\x63\157\x6c\x5f\156\x61\155\x65", $validColumn); } $sql .= $value->col_name . "\54\x20"; } $sql = substr_replace($sql, '', -2); $sql .= "\51\x20\126\x41\x4c\x55\x45\x53\x20\x28"; foreach ($valueRoot->fields as $key => $value) { switch (gettype($value->value)) { case "\x62\157\x6f\154\x65\141\x6e": $sql .= $value->value; break; case "\151\x6e\x74\145\x67\x65\162": case "\x64\x6f\165\142\x6c\145": $sql .= $value->value; break; case "\x73\x74\162\x69\x6e\x67": $sql .= "\x27" . $value->value . "\x27"; break; } $sql .= "\x2c\40"; } $sql = substr_replace($sql, '', -2); $sql .= "\x29"; $sqlArray[] = $sql; } if ($option == "\166\x61\154\151\144\141\x74\145") { if ($validColumn) { return true; } } if ($option == "\x63\x6f\x6e\163\x74\162\165\143\x74") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "\x69\x6e\163\145\x72\164"); } } } function parseUpdate($index, $val, $option) { $sqlArray = array(); if ($option == "\143\x6f\x6e\163\164\162\165\143\x74") { foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $field = $valueRoot->field; $newValue = $valueRoot->newValue; $sql = "\125\x50\104\101\124\x45\x20" . $table . "\40\123\105\124\40" . $field . "\x3d" . $newValue . "\40\127\x48\105\122\105\x20"; foreach ($valueRoot->conditionals as $conditionalKey => $conditionalValue) { $sql .= $conditionalKey . "\75" . $conditionalValue . "\40\101\116\x44\40"; } $sql = substr_replace($sql, '', -5); $sqlArray[] = $sql; } foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "\x75\160\144\x61\164\145"); } } else { return true; } } function parseCreate($index, $val, $option) { $validColumn = true; $validType = true; $sqlArray = array(); foreach ($val as $keyRoot => $valueRoot) { $table = $valueRoot->table; $sql = "\x43\122\x45\101\x54\105\40\124\x41\102\114\105\40" . $table . "\40\x28"; foreach ($valueRoot->fields as $key => $value) { if ($option == "\x76\x61\154\x69\144\x61\164\x65") { validateSQL($value->col_name, "\143\x6f\154\137\156\141\155\145", $validColumn); validateSQL($value->col_type, "\x63\x6f\154\x5f\x74\171\160\145", $validType); } $sql .= $value->col_name . "\x20" . $value->col_type; if (isset($value->null)) { if ($value->null == false) { $sql .= "\x20\116\117\124\40\116\125\114\x4c"; } } if (isset($value->default_value)) { $sql .= "\40\104\x45\106\101\125\114\124\x20\x27" . $value->default_value . "\47"; } if (isset($value->auto_increment)) { if ($value->auto_increment == true) { $sql .= "\40\x41\125\x54\x4f\x5f\x49\116\103\x52\105\115\105\x4e\124"; } } $sql .= "\54\40"; } if (isset($valueRoot->primary_key) || isset($valueRoot->index)) { if (isset($valueRoot->primary_key)) { $sql .= "\40\x50\x52\111\x4d\x41\122\x59\x20\113\x45\131\50"; foreach ($valueRoot->primary_key as $i => $j) { $sql .= $j . "\x2c"; } $sql .= "\x29"; } } else { $sql = substr_replace($sql, '', -2); } $sql = substr_replace($sql, '', -2); $sql .= "\51"; $sql .= "\x29"; $sqlArray[] = $sql; } if ($option == "\166\x61\x6c\151\x64\x61\x74\x65") { if ($validColumn && $validType) { return true; } } if ($option == "\x63\x6f\x6e\163\164\162\x75\x63\164") { foreach ($sqlArray as $key => $sqlString) { executeSQL($sqlString, "\x63\x72\145\x61\x74\145"); } } } function isJson($jsonString) { json_decode($jsonString); if (json_last_error() == JSON_ERROR_NONE) { return true; } else { return false; } } function parseSQL($dirPath, $option, $currentVer) { $valid = true; $validCreate = true; $validAlter = true; $validInsert = true; $validUpdate = true; $fileName = $dirPath . "\163\161\x6c\x2e\x6a\163\x6f\156"; if (file_exists($fileName)) { $jsonComponentString = file_get_contents($fileName); if (isJson($jsonComponentString)) { $jsonData = json_decode($jsonComponentString); foreach ($jsonData->sql as $key => $value) { if (isset($value->create) && version_compare($key, $currentVer) > 0) { $validCreate = parseCreate($key, $value->create, $option); } if (isset($value->alter) && version_compare($key, $currentVer) > 0) { $validAlter = parseAlter($key, $value->alter, $option); } if (isset($value->insert) && version_compare($key, $currentVer) > 0) { $validInsert = parseInsert($key, $value->insert, $option); } if (isset($value->update) && version_compare($key, $currentVer) > 0) { $validUpdate = parseUpdate($key, $value->update, $option); } } } } $valid = null; if ($validCreate != true || $validInsert != true || $validAlter != true || $validUpdate != true) { $valid = false; } else { $valid = true; } if ($option == "\x76\x61\154\151\x64\141\164\145") { return $valid; } if ($option == "\145\x78\145\x63\165\164\x65") { } } ?>

Function Calls

None

Variables

$path ../../../../

Stats

MD5 c0c7bf607ab8be821c194ddc30947826
Eval Count 0
Decode Time 240 ms