37722-vm/test_v5_7.php
Flatlogic Bot 40250521e3 Newest ok
2026-01-24 14:49:16 +00:00

54 lines
1.7 KiB
PHP

<?php
function obfuscate($code) {
$url = 'http://localhost/process.php';
$data = json_encode(['code' => $code]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
$luaCode = 'print("Hello from Hyperion V5.7"); local x = 10; local y = 20; print("Result: " .. tostring(x + y));';
echo "Obfuscating code...\n";
$result = obfuscate($luaCode);
if ($result && $result['success']) {
echo "Obfuscation successful!\n";
$protectedCode = $result['protected_code'];
echo "Protected code length: " . strlen($protectedCode) . "\n";
// Check for version string in comments
if (strpos($protectedCode, "Hyperion Engine V5.7 - Dynamic Opaque Predicates") !== false) {
echo "Version string confirmed: V5.7\n";
} else {
echo "Version string NOT found!\n";
}
// Check for some opaque predicates
$predicates = ['math.pi > 3', 'type(math.abs) == \'function\'', 'math.floor(10.5) == 10'];
$found = 0;
foreach ($predicates as $pred) {
if (strpos($protectedCode, $pred) !== false) {
$found++;
}
}
echo "Found $found/" . count($predicates) . " tested predicates in the output.\n";
// Save to a file for manual inspection if needed
file_put_contents('protected_v5_7.lua', $protectedCode);
echo "Protected code saved to protected_v5_7.lua\n";
} else {
echo "Obfuscation failed: " . ($result['error'] ?? 'Unknown error') . "\n";
var_dump($result);
}