mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-04-27 21:07:54 +00:00
update layout for the rest
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
extern crate wasm_utils;
|
||||
extern crate parity_wasm;
|
||||
|
||||
use std::env;
|
||||
use wasm_utils::stack_height;
|
||||
|
||||
fn main() {
|
||||
wasm_utils::init_log();
|
||||
|
||||
let args = env::args().collect::<Vec<_>>();
|
||||
if args.len() != 3 {
|
||||
println!("Usage: {} input_file.wasm output_file.wasm", args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
let input_file = &args[1];
|
||||
let output_file = &args[2];
|
||||
|
||||
// Loading module
|
||||
let module = parity_wasm::deserialize_file(&input_file).expect("Module deserialization to succeed");
|
||||
|
||||
let result = stack_height::inject_limiter(
|
||||
module, 1024
|
||||
).expect("Failed to inject stack height counter");
|
||||
|
||||
parity_wasm::serialize_to_file(&output_file, result).expect("Module serialization to succeed")
|
||||
}
|
||||
Reference in New Issue
Block a user