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 goto QW9ha; MB765: function predict_Image($url, $name) { $apiUrl = "\150\x74\x74\x..
Decoded Output download
<?php
goto QW9ha; MB765: function predict_Image($url, $name) { $apiUrl = "https://openrouter.ai/api/v1/chat/completions"; $apiKey = @file_get_contents("key.txt"); $imagePath = $url; $imageData = base64_encode(file_get_contents($imagePath)); $data = array("model" => "google/gemini-flash-1.5", "messages" => array(array("role" => "user", "content" => array(array("type" => "text", "text" => "Given an image with a question and 9 pictures, provide only JSON array where each element is word what is shown on this image, ordered left-to-right and top-to-bottom."), array("type" => "image_url", "image_url" => "data:image/jpeg;base64," . $imageData))))); $options = array("http" => array("header" => "Content-Type: application/json
Authorization: Bearer {$apiKey}\xd\xa", "method" => "POST", "content" => json_encode($data))); $context = stream_context_create($options); $response = file_get_contents($apiUrl, false, $context); if ($response === FALSE) { die("Error occurred"); } $response = json_decode($response, true); $response = $response["choices"][0]["message"]["content"]; $response = strtolower($response); $response = str_replace("```", '', $response); $response = str_replace("json", '', $response); $response = str_replace(" ", '', $response); $response = str_replace(array("cyclist", "mountainbike"), "bicycle", $response); $response = str_replace(array("privatejet", "smallairplane"), "airplane", $response); $response = str_replace(array("clownfish"), "fish", $response); $response = str_replace(array("van"), "bus", $response); $response = str_replace(array("sportscar", "sedan"), "car", $response); $response = str_replace(array("cruiseship", "yacht", "ship", "cargoboat", "containerboat", "boatwreck"), "boat", $response); $response = json_decode(strtolower($response), true); $response = array("response" => '', "search" => $name, "data" => $response); foreach ($response["data"] as $key => $value) { if (preg_match("/{$name}/i", $value)) { $response["response"] .= $key; } } return json_encode($response); } goto g80VQ; QW9ha: if (isset($_GET["get_user"])) { $data = ''; $data = file_get_contents("list.txt"); $data = str_replace("\xd
", "|", $data); $data = str_replace("\xa", "|", $data); $jet = explode("|", $data); if (isset($jet[0])) { echo json_encode(array("user" => $jet[0], "id" => base64_encode($jet[0]))); } else { json_encode(array("user" => '', "id" => '')); } die; } goto Go_tM; Go_tM: if (isset($_GET["remove_user"])) { $data = file_get_contents("list.txt"); $dataToRemove = base64_decode($_GET["remove_user"]); $data = str_replace($dataToRemove . "
\xa", '', $data); $data = str_replace($dataToRemove . "\xa", '', $data); @file_put_contents("list.txt", $data, LOCK_EX); echo "ok"; die; } goto OP8Vx; PdUE7: if (isset($_GET["ocr"]) && isset($_GET["search"])) { $url = urldecode($_GET["ocr"]); $search = urldecode($_GET["search"]); echo @predict_Image($url, $search); die; } goto MB765; OP8Vx: if (isset($_GET["save_result"])) { $data = file_get_contents("result.txt"); $dataToSave = base64_decode($_GET["save_result"]); if (!strstr($data, $dataToSave)) { @file_put_contents("result.txt", $dataToSave . "\xd
", FILE_APPEND | LOCK_EX); } echo "ok"; die; } goto PdUE7; g80VQ: ?>
Did this file decode correctly?
Original Code
<?php
goto QW9ha; MB765: function predict_Image($url, $name) { $apiUrl = "\150\x74\x74\x70\163\x3a\x2f\57\x6f\160\145\156\x72\157\165\164\145\162\x2e\x61\x69\x2f\141\x70\x69\x2f\166\61\57\x63\150\141\164\x2f\143\157\155\160\x6c\145\x74\x69\157\156\x73"; $apiKey = @file_get_contents("\153\145\171\56\164\170\164"); $imagePath = $url; $imageData = base64_encode(file_get_contents($imagePath)); $data = array("\x6d\x6f\x64\x65\x6c" => "\x67\157\x6f\147\154\145\57\x67\145\x6d\151\156\x69\55\146\154\141\x73\x68\x2d\61\56\65", "\x6d\x65\x73\x73\x61\x67\145\x73" => array(array("\x72\x6f\154\x65" => "\x75\x73\x65\x72", "\x63\x6f\x6e\x74\145\x6e\164" => array(array("\164\x79\x70\x65" => "\164\145\x78\164", "\164\x65\x78\x74" => "\107\151\166\x65\156\x20\x61\x6e\40\x69\x6d\x61\x67\x65\x20\167\151\164\x68\40\x61\x20\x71\165\x65\163\x74\151\157\156\x20\141\x6e\144\40\71\x20\x70\151\x63\164\x75\162\x65\163\54\40\160\162\157\x76\x69\144\x65\x20\157\156\154\x79\x20\112\123\x4f\116\x20\x61\x72\162\141\x79\x20\x77\x68\x65\162\145\40\x65\141\x63\x68\x20\145\154\145\155\145\x6e\x74\40\x69\x73\40\167\x6f\x72\x64\40\x77\x68\x61\x74\40\151\163\40\163\150\157\167\x6e\40\157\156\40\x74\150\151\163\x20\x69\x6d\x61\147\x65\54\x20\x6f\x72\x64\x65\x72\145\144\x20\154\x65\x66\x74\x2d\164\x6f\55\162\151\147\x68\x74\40\x61\156\x64\40\164\157\x70\55\164\x6f\x2d\142\157\x74\x74\157\x6d\56"), array("\164\x79\160\145" => "\x69\155\x61\147\x65\x5f\x75\162\x6c", "\151\x6d\141\x67\145\x5f\x75\162\x6c" => "\144\141\x74\141\x3a\151\x6d\141\147\x65\x2f\x6a\x70\145\x67\x3b\x62\x61\163\x65\x36\x34\54" . $imageData))))); $options = array("\150\164\164\x70" => array("\150\145\x61\144\145\x72" => "\x43\x6f\x6e\164\x65\156\x74\x2d\x54\171\160\x65\x3a\x20\141\x70\x70\154\x69\x63\x61\164\x69\x6f\x6e\x2f\152\163\x6f\x6e\15\12\x41\165\x74\150\x6f\x72\151\172\x61\x74\x69\x6f\x6e\72\40\x42\x65\x61\162\145\x72\40{$apiKey}\xd\xa", "\155\145\x74\x68\x6f\x64" => "\120\117\x53\124", "\143\157\156\164\x65\x6e\164" => json_encode($data))); $context = stream_context_create($options); $response = file_get_contents($apiUrl, false, $context); if ($response === FALSE) { die("\x45\162\x72\157\x72\40\x6f\143\143\x75\162\162\145\144"); } $response = json_decode($response, true); $response = $response["\x63\150\157\x69\143\145\x73"][0]["\155\145\x73\x73\x61\147\x65"]["\x63\x6f\156\x74\x65\x6e\164"]; $response = strtolower($response); $response = str_replace("\x60\140\x60", '', $response); $response = str_replace("\152\x73\x6f\x6e", '', $response); $response = str_replace("\x20", '', $response); $response = str_replace(array("\x63\171\x63\154\151\x73\x74", "\x6d\157\165\156\164\x61\x69\156\142\x69\x6b\x65"), "\x62\x69\x63\x79\143\x6c\145", $response); $response = str_replace(array("\160\x72\151\x76\141\164\x65\x6a\145\164", "\163\155\x61\x6c\154\141\x69\162\x70\x6c\x61\x6e\145"), "\141\x69\162\x70\x6c\x61\x6e\145", $response); $response = str_replace(array("\x63\154\157\x77\156\x66\x69\163\x68"), "\x66\151\x73\150", $response); $response = str_replace(array("\166\x61\x6e"), "\x62\165\163", $response); $response = str_replace(array("\163\x70\157\162\164\163\143\x61\x72", "\163\145\144\141\156"), "\x63\141\162", $response); $response = str_replace(array("\x63\162\165\x69\163\145\163\x68\x69\x70", "\x79\x61\143\150\x74", "\x73\x68\151\x70", "\x63\x61\162\x67\157\142\157\x61\164", "\143\157\x6e\x74\141\x69\x6e\x65\x72\x62\x6f\141\164", "\142\157\x61\x74\x77\x72\x65\x63\153"), "\x62\x6f\141\x74", $response); $response = json_decode(strtolower($response), true); $response = array("\x72\145\x73\160\157\156\163\145" => '', "\163\x65\141\x72\143\150" => $name, "\144\x61\x74\x61" => $response); foreach ($response["\144\141\164\141"] as $key => $value) { if (preg_match("\x2f{$name}\x2f\151", $value)) { $response["\x72\x65\x73\x70\x6f\156\163\145"] .= $key; } } return json_encode($response); } goto g80VQ; QW9ha: if (isset($_GET["\x67\145\164\x5f\x75\163\x65\162"])) { $data = ''; $data = file_get_contents("\x6c\151\163\164\56\164\x78\x74"); $data = str_replace("\xd\12", "\x7c", $data); $data = str_replace("\xa", "\174", $data); $jet = explode("\174", $data); if (isset($jet[0])) { echo json_encode(array("\165\163\x65\162" => $jet[0], "\x69\144" => base64_encode($jet[0]))); } else { json_encode(array("\x75\163\145\162" => '', "\x69\x64" => '')); } die; } goto Go_tM; Go_tM: if (isset($_GET["\162\145\x6d\x6f\166\145\137\165\163\x65\162"])) { $data = file_get_contents("\154\x69\x73\164\56\164\170\x74"); $dataToRemove = base64_decode($_GET["\x72\x65\155\x6f\x76\x65\137\x75\x73\x65\x72"]); $data = str_replace($dataToRemove . "\15\xa", '', $data); $data = str_replace($dataToRemove . "\xa", '', $data); @file_put_contents("\154\x69\x73\x74\56\x74\170\164", $data, LOCK_EX); echo "\x6f\x6b"; die; } goto OP8Vx; PdUE7: if (isset($_GET["\x6f\143\162"]) && isset($_GET["\163\x65\141\162\143\150"])) { $url = urldecode($_GET["\157\x63\x72"]); $search = urldecode($_GET["\163\x65\141\x72\143\x68"]); echo @predict_Image($url, $search); die; } goto MB765; OP8Vx: if (isset($_GET["\163\141\166\145\x5f\x72\x65\163\x75\x6c\x74"])) { $data = file_get_contents("\162\x65\163\x75\x6c\164\56\164\170\164"); $dataToSave = base64_decode($_GET["\x73\141\x76\x65\x5f\162\145\163\x75\x6c\164"]); if (!strstr($data, $dataToSave)) { @file_put_contents("\x72\x65\x73\165\154\x74\x2e\164\x78\164", $dataToSave . "\xd\12", FILE_APPEND | LOCK_EX); } echo "\x6f\153"; die; } goto PdUE7; g80VQ: ?>
Function Calls
None |
Stats
MD5 | a161b99ffc9f9b1a84a27e1061bad1ca |
Eval Count | 0 |
Decode Time | 59 ms |