-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvvts.php
More file actions
32 lines (25 loc) · 771 Bytes
/
Copy pathvvts.php
File metadata and controls
32 lines (25 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once dirname(__FILE__) . "/prereq_check.php";
require_once dirname(__FILE__) . "/autoload.php";
use \VVTS\Classes\MainLoop;
use \VVTS\Classes\ScriptParseCtx;
use \VVTS\Classes\ScriptEngine;
use \VVTS\Types\ScriptDocument;
if (!isset($argv[1])) {
printf("[i] usage: %s <state_machine_file>\n", $argv[0]);
exit(0);
}
$szScript = @file_get_contents($argv[1]);
if ($szScript === false) {
printf("[-] unable to read file " . $argv[1]);
exit(-1);
}
$oMainLoop = MainLoop::GetInstance();
$oParseCtx = new ScriptParseCtx($szScript);
$oParsed = ScriptDocument::Parse($oParseCtx);
// var_dump($oParsed->ToString());
$oEngine = ScriptEngine::GetInstance();
$oEngine->RegisterScript($oParsed);
$oEngine->EnterInitState();
$oMainLoop->Loop();
?>