37722-vm/test_v8_1.php
2026-01-24 16:41:14 +00:00

61 lines
1.6 KiB
PHP

<?php
$code = '
print("Hyperion V8.1 - Table Virtualization Test")
local myTable = {}
myTable["secret"] = "This is a virtualized value"
myTable.info = "Metadata virtualized"
myTable["level"] = 9000
print("Accessing Table via Virtualization:")
local secret = myTable["secret"]
print("Secret:", secret)
local info = myTable.info
print("Info:", info)
local level = myTable["level"]
print("Level:", level)
function checkTable(t)
print("Checking Table Key Directly...")
local val = t["secret"]
if val == "This is a virtualized value" then
print("Success: Virtualization Layer Passed")
else
print("Failure: Virtualization Layer Mismatch")
end
end
checkTable(myTable)
print("Finished V8.1 Test")
';
$payload = json_encode(['code' => $code]);
$ch = curl_init('http://localhost/process.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$res = json_decode($response, true);
if ($res && $res['success']) {
$protected_code = $res['protected_code'];
file_put_contents('protected_v8_1.lua', $protected_code);
echo "Obfuscation successful. Output saved to protected_v8_1.lua\n";
echo "Stats: " . json_encode($res['stats']) . "\n";
if (strlen($protected_code) > 1000) {
echo "Protected code looks valid (size: " . strlen($protected_code) . " bytes)\n";
}
} else {
echo "Obfuscation failed: " . ($res['error'] ?? 'Unknown error') . "\n";
echo "Response: " . $response . "\n";
}