Added bytecode parser according to c0vm-writeup.pdf

We can now parse a bytecode file to find int_pool, string_pool,
function_pool, and native_pool.
This commit is contained in:
Mitchell Plamann
2015-03-21 02:04:49 -04:00
parent c62c7ed8bf
commit 837efb7b2b
3 changed files with 112 additions and 4 deletions

View File

@@ -4,3 +4,6 @@ console.log("Reading in sample bytecode file:");
console.log(parser.getBytes("../test/test.bc0"));
console.log("That was the sample bytecode file" +
" -- it probably took up your whole terminal screen.");
var file = parser.parse("../test/test.bc0");
console.log(file);
console.log(file.function_pool[0].code);