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 /* __________________________________________________ | Obfuscated by YAK P..

Decoded Output download

<?php 
/*   __________________________________________________ 
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.14  | 
    |              on 2023-09-20 16:12:27              | 
    |    GitHub: https://github.com/pk-fr/yakpro-po    | 
    |__________________________________________________| 
*/ 
 require_once "modules/Administration/Administration.php"; use GuzzleHttp\Client; class KinamuConfigurator extends SugarApi { private const prefessional_public_key = "ecd00c3acc5ad2c41fb8f8014a8d2e88"; private const enterprise_public_key = "1b813e454c54a392dd8208527d913d5a"; public function registerApiRest() { return array("getList" => array("reqType" => "GET", "noLoginRequired" => false, "path" => array("KinamuConfigurator", "GPT", "?"), "pathVars" => array("module", "product", "settings"), "method" => "getList", "shortHelp" => "Retrieves a list of settings with values for a product", "longHelp" => ''), "getValue" => array("reqType" => "GET", "noLoginRequired" => false, "path" => array("KinamuConfigurator", "GPT", "?"), "pathVars" => array("module", "product", "setting"), "method" => "getValue", "shortHelp" => "Retrieves a value of setting for a product through the specified key", "longHelp" => ''), "setValues" => array("reqType" => "POST", "noLoginRequired" => false, "path" => array("KinamuConfigurator", "GPT"), "pathVars" => array("module", "product"), "method" => "setValues", "shortHelp" => "Saves and/or updates the settings of a product", "longHelp" => ''), "getConfigFields" => array("reqType" => "GET", "noLoginRequired" => true, "path" => array("KinamuConfigurator", "Settings"), "pathVars" => array("module", "setting"), "method" => "getConfigFields", "shortHelp" => "Reads the gpt_config file and return the array.", "longHelp" => '')); } public function getList($Ute1N, $Aue60) { goto bdnTC; F4OdM: return $eEWGo; goto gFpqM; JnmYc: KPwld: goto F4OdM; ZqYb7: foreach ($alB9J as $o02f0) { goto FsFWd; a_j8Q: $QTBGf = new Administration(); goto HPB03; HPB03: $q9VOh = $QTBGf->retrieveSettings($w2hgX)->settings; goto s1j0q; kDkzj: vvYzI: goto J32tT; wQ5kS: AWJUc: goto kDkzj; FsFWd: $w2hgX = "Kinamu::" . $Aue60["product"] . "::" . $o02f0; goto a_j8Q; s1j0q: foreach ($q9VOh as $pl1Vd => $raavG) { goto FdKdX; Dn5Iv: $eEWGo[$o02f0][str_replace($w2hgX . "_", '', $pl1Vd)] = $raavG; goto Qh6Le; Qh6Le: vUbfw: goto El3Is; FdKdX: if (!(strpos($pl1Vd, $w2hgX . "_") === 0)) { goto vUbfw; } goto Dn5Iv; El3Is: J1tHP: goto Wpza6; Wpza6: } goto wQ5kS; J32tT: } goto JnmYc; bdnTC: $alB9J = explode("$$", $Aue60["settings"]); goto ZqYb7; gFpqM: } public function getValue($Ute1N, $Aue60) { $M7KgE = $this->getList($Ute1N, $Aue60); return $M7KgE[$Aue60["key"]]; } public function getSettingValue($Aue60) { $CYgWK = $this->getList([], ["product" => "GPT", "settings" => "api$$chat$$html$$completion"]); return $CYgWK[$Aue60["setting"]][$Aue60["key"]]; } public function setValues($Ute1N, $Aue60) { goto xkfok; tFiYP: foreach ($Jl1EF as $pl1Vd => $raavG) { goto leHjN; yAvIx: yxyi8: H5nb5: KPm_g: $QTBGf->saveSetting($w2hgX . "::" . $X6eNs[0], $X6eNs[1], $raavG); goto mm8NN; leHjN: if (!(is_array($raavG) && !isset($raavG[$pl1Vd]))) { goto a_YHi; } $A5S1n[$pl1Vd] = $raavG; $raavG = $A5S1n; a_YHi: goto Zt2Qe; mm8NN: UzcCH: goto Y30tq; THghW: if (isset($Aue60["license"])) { goto JVAtC; } goto UzcCH; JVAtC: WWB1d: goto mqANY; mqANY: if (!($X6eNs[1] === "model")) { goto H5nb5; } $avQSS = array("text-curie-001", "text-babbage-001", "text-ada-001", "gpt-3.5-turbo"); if (in_array($raavG, $avQSS)) { goto yxyi8; } goto UzcCH; goto yAvIx; Zt2Qe: $X6eNs = explode("$$", $pl1Vd); include "modules/knm_gpt_chats/license/config.php"; if (!($outfitters_config["public_key"] === self::prefessional_public_key)) { goto KPm_g; } if (!($X6eNs[1] === "api_key" || $X6eNs[1] === "base_url")) { goto WWB1d; } goto THghW; Y30tq: } goto KOsP4; xkfok: $w2hgX = "Kinamu::" . $Aue60["product"]; goto u8oEB; u8oEB: $Jl1EF = $Aue60["body"]; goto lXjMB; lXjMB: $QTBGf = new Administration(); goto tFiYP; qfFxl: return "success"; goto JwgH1; KOsP4: fzdmG: goto qfFxl; JwgH1: } public function getConfigFields($Ute1N, $Aue60) { goto dnDnx; JuO7c: TXvQf: return json_encode($gpt_field_config); goto VmqM0; AEf2s: try { $EkFLH = $KpiPR->request("GET", "models", ["headers" => $o3edL]); } catch (Exception $X2MDD) { return json_encode($gpt_field_config); } $avQSS = json_decode($EkFLH->getBody()->getContents(), true)["data"]; $nrKRH = ["gpt-3.5-turbo-instruct", "text-davinci-003", "text-davinci-002", "text-davinci-001", "text-curie-001", "text-babbage-001", "text-ada-001", "davinci", "curie", "babbage", "ada"]; goto U_vlR; dnDnx: include "custom/kinamu/gpt/gpt_config.php"; $SNDTO = array("key" => "api_key", "setting" => "api"); $icezH = $this->getSettingValue($SNDTO); goto ge65F; ge65F: if ($icezH) { goto KASHF; } return json_encode($gpt_field_config); KASHF: goto yogab; yogab: $RCRib = "https://api.openai.com/v1/"; $o3edL = ["Authorization" => "Bearer " . $icezH, "Content-Type" => "application/json"]; $KpiPR = new Client(["base_uri" => $RCRib, "timeout" => 2.0]); goto AEf2s; U_vlR: $VeDW_ = ["gpt-4", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613"]; $fKT3r = ["openai-internal", "openai", "openai-dev", "system"]; foreach ($avQSS as $ahWm8) { goto sMDrM; sMDrM: if (in_array($ahWm8["owned_by"], $fKT3r)) { goto h3h31; } $gpt_field_config["completion"]["fields"]["model"]["options"][$ahWm8["id"]] = $ahWm8["id"]; goto sQbSQ; dB3G5: $gpt_field_config["chat"]["fields"]["model"]["options"][$ahWm8["id"]] = $ahWm8["id"]; a04Yp: goto C6611; S0Zvf: IYyAB: if (!in_array($ahWm8["id"], $VeDW_)) { goto a04Yp; } goto dB3G5; C6611: IEJn9: goto ps_6m; Iugs1: if (!in_array($ahWm8["id"], $nrKRH)) { goto IYyAB; } $gpt_field_config["completion"]["fields"]["model"]["options"][$ahWm8["id"]] = $ahWm8["id"]; goto S0Zvf; sQbSQ: goto IEJn9; h3h31: goto Iugs1; ps_6m: } goto JuO7c; VmqM0: } } 
 ?>

Did this file decode correctly?

Original Code

<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.14  |
    |              on 2023-09-20 16:12:27              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
 require_once "\x6d\x6f\144\165\154\145\163\57\101\x64\155\151\156\151\163\164\162\141\164\151\x6f\x6e\x2f\101\144\x6d\151\156\151\163\x74\162\x61\x74\x69\x6f\156\x2e\160\x68\x70"; use GuzzleHttp\Client; class KinamuConfigurator extends SugarApi { private const prefessional_public_key = "\x65\143\144\60\60\143\63\141\x63\x63\x35\141\144\x32\x63\x34\61\x66\x62\70\146\70\60\x31\64\141\70\x64\62\145\x38\70"; private const enterprise_public_key = "\61\142\70\61\63\145\x34\65\64\143\65\64\x61\x33\71\x32\x64\x64\x38\62\x30\x38\x35\62\x37\x64\x39\x31\x33\144\65\141"; public function registerApiRest() { return array("\x67\x65\164\x4c\x69\x73\x74" => array("\162\x65\x71\124\171\x70\145" => "\x47\x45\x54", "\x6e\157\x4c\x6f\x67\x69\156\122\145\x71\165\151\x72\x65\144" => false, "\160\141\x74\x68" => array("\113\151\x6e\141\155\165\103\x6f\156\146\x69\x67\x75\x72\141\164\157\162", "\107\x50\124", "\77"), "\160\141\164\150\126\141\x72\163" => array("\155\x6f\144\165\x6c\145", "\x70\162\157\144\x75\143\x74", "\x73\145\164\164\151\x6e\147\163"), "\155\x65\164\x68\157\144" => "\147\x65\x74\x4c\x69\163\164", "\163\x68\157\x72\x74\x48\145\154\x70" => "\122\145\164\162\151\x65\166\x65\163\x20\x61\40\x6c\x69\163\x74\x20\157\146\40\163\145\164\164\151\x6e\x67\x73\x20\167\151\x74\x68\40\166\x61\x6c\165\x65\163\x20\x66\x6f\x72\x20\141\40\x70\162\157\144\x75\143\164", "\154\157\156\x67\x48\x65\x6c\160" => ''), "\147\x65\x74\x56\141\x6c\x75\145" => array("\162\145\x71\124\171\x70\x65" => "\107\x45\124", "\x6e\x6f\114\157\x67\151\156\122\145\161\x75\151\162\x65\144" => false, "\160\141\x74\150" => array("\113\x69\156\141\x6d\x75\x43\157\156\x66\x69\147\165\162\141\164\x6f\x72", "\x47\x50\124", "\x3f"), "\160\x61\164\150\126\141\162\x73" => array("\x6d\157\x64\165\x6c\145", "\x70\162\157\x64\x75\x63\x74", "\163\x65\164\164\151\x6e\x67"), "\x6d\x65\164\150\157\x64" => "\x67\145\164\x56\141\154\x75\145", "\x73\x68\157\162\x74\x48\x65\154\x70" => "\x52\x65\x74\162\x69\x65\166\x65\163\x20\141\x20\x76\141\x6c\165\145\x20\x6f\146\40\163\x65\164\164\x69\156\x67\x20\x66\157\x72\40\141\40\160\x72\157\x64\165\143\x74\x20\164\x68\x72\x6f\x75\x67\x68\40\x74\x68\x65\40\x73\x70\145\x63\x69\146\x69\x65\144\40\x6b\x65\x79", "\154\157\x6e\147\x48\145\154\160" => ''), "\x73\x65\164\x56\x61\x6c\165\x65\163" => array("\x72\x65\x71\x54\171\160\x65" => "\x50\117\123\x54", "\156\x6f\x4c\x6f\x67\x69\x6e\122\145\161\x75\151\x72\x65\144" => false, "\160\141\164\x68" => array("\x4b\151\x6e\141\x6d\x75\103\x6f\156\146\x69\147\165\x72\141\164\x6f\x72", "\107\x50\124"), "\160\141\164\150\x56\x61\x72\163" => array("\x6d\x6f\x64\165\x6c\x65", "\160\162\x6f\x64\x75\x63\x74"), "\x6d\145\164\x68\x6f\x64" => "\163\145\164\126\x61\154\x75\145\163", "\x73\150\x6f\162\x74\x48\145\154\x70" => "\123\141\x76\x65\163\x20\x61\x6e\x64\57\x6f\162\40\x75\160\144\x61\164\x65\x73\40\x74\150\x65\40\163\145\164\x74\151\x6e\147\163\40\x6f\146\40\141\x20\x70\162\157\x64\x75\x63\164", "\x6c\157\156\147\110\x65\154\160" => ''), "\x67\145\x74\103\157\x6e\146\x69\147\106\151\x65\x6c\144\x73" => array("\162\x65\x71\124\171\160\145" => "\107\x45\x54", "\156\157\x4c\157\147\x69\156\x52\145\x71\x75\x69\x72\x65\x64" => true, "\160\141\164\150" => array("\113\x69\x6e\x61\x6d\165\x43\157\x6e\146\151\x67\x75\x72\x61\164\157\162", "\x53\145\x74\x74\151\156\147\163"), "\x70\141\164\x68\126\141\x72\x73" => array("\x6d\x6f\x64\165\x6c\145", "\163\x65\164\x74\x69\x6e\147"), "\x6d\145\x74\150\157\x64" => "\147\x65\x74\x43\x6f\x6e\146\151\147\x46\x69\x65\x6c\x64\x73", "\163\150\x6f\x72\164\x48\145\154\x70" => "\122\x65\141\x64\163\40\164\150\145\x20\x67\x70\x74\137\143\157\156\x66\x69\x67\40\x66\x69\x6c\x65\40\x61\156\x64\40\x72\145\164\x75\x72\156\x20\x74\x68\x65\40\141\162\162\141\171\x2e", "\x6c\x6f\156\147\110\145\154\160" => '')); } public function getList($Ute1N, $Aue60) { goto bdnTC; F4OdM: return $eEWGo; goto gFpqM; JnmYc: KPwld: goto F4OdM; ZqYb7: foreach ($alB9J as $o02f0) { goto FsFWd; a_j8Q: $QTBGf = new Administration(); goto HPB03; HPB03: $q9VOh = $QTBGf->retrieveSettings($w2hgX)->settings; goto s1j0q; kDkzj: vvYzI: goto J32tT; wQ5kS: AWJUc: goto kDkzj; FsFWd: $w2hgX = "\113\x69\156\x61\x6d\165\72\72" . $Aue60["\x70\x72\x6f\x64\x75\x63\x74"] . "\72\x3a" . $o02f0; goto a_j8Q; s1j0q: foreach ($q9VOh as $pl1Vd => $raavG) { goto FdKdX; Dn5Iv: $eEWGo[$o02f0][str_replace($w2hgX . "\137", '', $pl1Vd)] = $raavG; goto Qh6Le; Qh6Le: vUbfw: goto El3Is; FdKdX: if (!(strpos($pl1Vd, $w2hgX . "\x5f") === 0)) { goto vUbfw; } goto Dn5Iv; El3Is: J1tHP: goto Wpza6; Wpza6: } goto wQ5kS; J32tT: } goto JnmYc; bdnTC: $alB9J = explode("\44\44", $Aue60["\x73\145\164\164\x69\x6e\147\x73"]); goto ZqYb7; gFpqM: } public function getValue($Ute1N, $Aue60) { $M7KgE = $this->getList($Ute1N, $Aue60); return $M7KgE[$Aue60["\153\145\x79"]]; } public function getSettingValue($Aue60) { $CYgWK = $this->getList([], ["\x70\162\157\144\165\143\164" => "\x47\120\x54", "\163\x65\x74\x74\151\x6e\x67\163" => "\141\x70\151\x24\44\x63\x68\141\x74\x24\44\150\164\155\154\44\x24\143\157\155\x70\x6c\145\164\x69\157\x6e"]); return $CYgWK[$Aue60["\163\x65\x74\x74\x69\x6e\147"]][$Aue60["\x6b\x65\x79"]]; } public function setValues($Ute1N, $Aue60) { goto xkfok; tFiYP: foreach ($Jl1EF as $pl1Vd => $raavG) { goto leHjN; yAvIx: yxyi8: H5nb5: KPm_g: $QTBGf->saveSetting($w2hgX . "\72\72" . $X6eNs[0], $X6eNs[1], $raavG); goto mm8NN; leHjN: if (!(is_array($raavG) && !isset($raavG[$pl1Vd]))) { goto a_YHi; } $A5S1n[$pl1Vd] = $raavG; $raavG = $A5S1n; a_YHi: goto Zt2Qe; mm8NN: UzcCH: goto Y30tq; THghW: if (isset($Aue60["\154\151\143\145\x6e\x73\x65"])) { goto JVAtC; } goto UzcCH; JVAtC: WWB1d: goto mqANY; mqANY: if (!($X6eNs[1] === "\x6d\x6f\x64\x65\154")) { goto H5nb5; } $avQSS = array("\164\x65\x78\164\x2d\143\165\162\151\x65\x2d\x30\60\x31", "\164\145\170\164\55\142\141\142\142\x61\147\145\55\x30\60\61", "\x74\145\170\164\55\141\x64\x61\x2d\60\x30\61", "\147\x70\164\x2d\x33\56\65\x2d\164\165\x72\x62\x6f"); if (in_array($raavG, $avQSS)) { goto yxyi8; } goto UzcCH; goto yAvIx; Zt2Qe: $X6eNs = explode("\44\x24", $pl1Vd); include "\x6d\x6f\x64\165\154\x65\x73\57\153\156\155\x5f\147\x70\x74\x5f\143\x68\141\x74\163\x2f\154\x69\x63\x65\x6e\163\x65\x2f\x63\x6f\156\x66\151\147\x2e\x70\x68\160"; if (!($outfitters_config["\x70\x75\x62\154\151\x63\137\153\145\171"] === self::prefessional_public_key)) { goto KPm_g; } if (!($X6eNs[1] === "\x61\160\151\x5f\x6b\x65\x79" || $X6eNs[1] === "\142\141\x73\145\137\x75\162\x6c")) { goto WWB1d; } goto THghW; Y30tq: } goto KOsP4; xkfok: $w2hgX = "\x4b\x69\x6e\x61\155\165\72\x3a" . $Aue60["\x70\x72\x6f\x64\x75\x63\x74"]; goto u8oEB; u8oEB: $Jl1EF = $Aue60["\142\x6f\144\x79"]; goto lXjMB; lXjMB: $QTBGf = new Administration(); goto tFiYP; qfFxl: return "\x73\x75\x63\143\145\163\163"; goto JwgH1; KOsP4: fzdmG: goto qfFxl; JwgH1: } public function getConfigFields($Ute1N, $Aue60) { goto dnDnx; JuO7c: TXvQf: return json_encode($gpt_field_config); goto VmqM0; AEf2s: try { $EkFLH = $KpiPR->request("\107\105\x54", "\155\157\144\x65\x6c\163", ["\x68\145\141\144\145\x72\163" => $o3edL]); } catch (Exception $X2MDD) { return json_encode($gpt_field_config); } $avQSS = json_decode($EkFLH->getBody()->getContents(), true)["\x64\x61\164\x61"]; $nrKRH = ["\x67\x70\164\55\x33\x2e\65\55\164\x75\x72\142\157\x2d\151\156\x73\x74\x72\x75\143\164", "\164\145\170\x74\x2d\x64\x61\166\x69\x6e\143\x69\55\x30\60\63", "\164\x65\x78\x74\55\144\141\x76\151\x6e\143\x69\55\60\60\62", "\164\145\x78\x74\55\144\141\166\x69\156\143\x69\x2d\60\60\61", "\164\145\170\x74\55\143\x75\162\151\x65\x2d\x30\x30\61", "\x74\145\x78\x74\55\x62\x61\x62\142\x61\147\145\55\60\x30\61", "\164\145\x78\164\x2d\x61\144\x61\55\x30\x30\x31", "\144\x61\166\x69\156\143\151", "\x63\x75\162\x69\x65", "\x62\x61\142\142\x61\x67\x65", "\141\144\x61"]; goto U_vlR; dnDnx: include "\143\x75\163\164\157\155\x2f\x6b\x69\x6e\141\x6d\x75\57\x67\160\164\x2f\x67\x70\x74\x5f\143\x6f\156\x66\151\147\56\x70\x68\x70"; $SNDTO = array("\153\x65\x79" => "\x61\x70\x69\x5f\153\x65\171", "\x73\145\x74\164\x69\x6e\147" => "\141\x70\x69"); $icezH = $this->getSettingValue($SNDTO); goto ge65F; ge65F: if ($icezH) { goto KASHF; } return json_encode($gpt_field_config); KASHF: goto yogab; yogab: $RCRib = "\x68\164\164\x70\x73\x3a\x2f\x2f\141\160\151\x2e\x6f\x70\145\156\x61\151\x2e\143\157\155\57\166\x31\57"; $o3edL = ["\x41\x75\164\150\x6f\162\151\x7a\141\x74\x69\157\156" => "\x42\x65\141\x72\x65\x72\x20" . $icezH, "\103\157\x6e\164\x65\x6e\x74\55\124\x79\x70\145" => "\141\x70\x70\x6c\x69\143\x61\x74\151\x6f\x6e\57\x6a\163\x6f\x6e"]; $KpiPR = new Client(["\142\141\163\145\x5f\x75\x72\151" => $RCRib, "\x74\x69\x6d\145\157\165\164" => 2.0]); goto AEf2s; U_vlR: $VeDW_ = ["\147\160\x74\55\x34", "\x67\160\164\x2d\64\x2d\60\x36\61\63", "\147\x70\x74\55\x34\x2d\x33\x32\x6b", "\147\160\164\55\64\55\63\x32\x6b\55\60\66\61\x33", "\x67\160\x74\x2d\x33\x2e\65\x2d\164\165\x72\x62\x6f", "\147\160\x74\x2d\63\56\65\x2d\x74\165\x72\142\157\55\x30\x36\61\x33", "\x67\160\x74\x2d\63\x2e\x35\x2d\164\165\162\x62\157\55\61\66\153", "\147\160\164\x2d\63\56\x35\x2d\164\x75\x72\142\x6f\55\61\66\x6b\x2d\x30\x36\x31\x33"]; $fKT3r = ["\157\160\145\x6e\x61\151\x2d\x69\156\x74\x65\162\x6e\141\x6c", "\x6f\160\x65\x6e\x61\151", "\157\160\x65\156\141\x69\x2d\x64\145\166", "\x73\x79\163\x74\x65\x6d"]; foreach ($avQSS as $ahWm8) { goto sMDrM; sMDrM: if (in_array($ahWm8["\x6f\x77\156\145\144\x5f\x62\x79"], $fKT3r)) { goto h3h31; } $gpt_field_config["\143\x6f\x6d\160\x6c\x65\x74\x69\x6f\x6e"]["\x66\x69\145\154\144\163"]["\x6d\157\144\x65\x6c"]["\x6f\160\x74\151\157\156\163"][$ahWm8["\x69\144"]] = $ahWm8["\151\x64"]; goto sQbSQ; dB3G5: $gpt_field_config["\x63\150\141\x74"]["\146\151\145\x6c\144\x73"]["\155\x6f\x64\x65\x6c"]["\x6f\160\x74\151\157\156\163"][$ahWm8["\x69\x64"]] = $ahWm8["\x69\x64"]; a04Yp: goto C6611; S0Zvf: IYyAB: if (!in_array($ahWm8["\151\x64"], $VeDW_)) { goto a04Yp; } goto dB3G5; C6611: IEJn9: goto ps_6m; Iugs1: if (!in_array($ahWm8["\151\144"], $nrKRH)) { goto IYyAB; } $gpt_field_config["\x63\157\x6d\160\154\x65\x74\x69\157\x6e"]["\146\151\x65\x6c\144\163"]["\x6d\157\144\145\x6c"]["\157\160\x74\x69\x6f\x6e\x73"][$ahWm8["\x69\144"]] = $ahWm8["\151\144"]; goto S0Zvf; sQbSQ: goto IEJn9; h3h31: goto Iugs1; ps_6m: } goto JuO7c; VmqM0: } }

Function Calls

None

Variables

None

Stats

MD5 a68a97bcf41096f12a04b869c6fcdc40
Eval Count 0
Decode Time 54 ms