49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Test for Hyperion V10.0 - Dynamic Instruction Polymorphism
|
|
*/
|
|
|
|
$test_code = '
|
|
print("Hyperion V10.0 Bootstrapped")
|
|
local data = {}
|
|
data["status"] = "Protected"
|
|
data["version"] = 10.0
|
|
print("System Status: " .. data["status"])
|
|
print("Build: " .. data["version"])
|
|
|
|
local function complex_math(a, b)
|
|
return (a * b) + (a - b)
|
|
end
|
|
|
|
print("Test Math: " .. tostring(complex_math(10, 5)))
|
|
';
|
|
|
|
$url = 'http://localhost/process.php';
|
|
$options = [
|
|
'http' => [
|
|
'header' => "Content-type: application/json\r\n",
|
|
'method' => 'POST',
|
|
'content' => json_encode(['code' => $test_code]),
|
|
],
|
|
];
|
|
|
|
$context = stream_context_create($options);
|
|
$result = file_get_contents($url, false, $context);
|
|
|
|
if ($result === FALSE) {
|
|
die("Error reaching process.php");
|
|
}
|
|
|
|
$response = json_decode($result, true);
|
|
|
|
if ($response && $response['success']) {
|
|
$protected_file = 'protected_v10_0.lua';
|
|
file_put_contents($protected_file, $response['protected_code']);
|
|
echo "Successfully generated $protected_file\n";
|
|
echo "Stats: " . json_encode($response['stats']) . "\n";
|
|
} else {
|
|
echo "Error: " . ($response['error'] ?? 'Unknown error') . "\n";
|
|
echo "Full response: " . $result . "\n";
|
|
}
|
|
|