-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from FuzzingLabs/feat/symbolic_execution
Implement symbolic execution
- Loading branch information
Showing
7 changed files
with
375 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use sierra_analyzer_lib::sierra_program::SierraProgram; | ||
|
||
fn main() { | ||
let content = include_str!("../../examples/sierra/fib_match.sierra").to_string(); | ||
|
||
// Init a new SierraProgram with the .sierra file content | ||
let program = SierraProgram::new(content); | ||
|
||
// Don't use the verbose output | ||
let verbose_output = false; | ||
|
||
// Decompile the Sierra program | ||
let mut decompiler = program.decompiler(verbose_output); | ||
|
||
// Decompile the Sierra program | ||
let use_color = false; | ||
decompiler.decompile(use_color); | ||
|
||
// Print the number of paths in the first function | ||
// It should be 10 in examples::fib_match::fib function | ||
decompiler.functions[0].create_cfg(); | ||
println!( | ||
"Number of possible paths : {:#?}", | ||
decompiler.functions[0].cfg.as_ref().unwrap().paths().len() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.