

emulate_one_function ( 'fib' ) # or emul.emulate_functions() # or emul.emulate_functions() # emulate all the function # visualization of the cfg with SSA emul. read () # run the emulator for SSA emul = WasmSSAEmulatorEngine ( raw ) emul. IR conversion (SSA) from import WasmSSAEmulatorEngine # complete wasm module file_name = "examples/wasm/samples/fib.wasm" # read file with open ( file_name, 'rb' ) as f : raw = f. read () # create the cfg cfg = WasmCFG ( raw ) # visualize Call Flow Graph # generate call_graph.dot and call_graph.pdf file # color similar to # imported func = turquoise / exported func = grey # edge label = number of different calls to the function cfg. visualize_instrs_per_funcs ()Ĭall Flow Analysis from import WasmCFG # fibonacci wasm module file_name = "examples/wasm/samples/hello_wasm_studio.wasm" # read file with open ( file_name, 'rb' ) as f : raw = f.

read () # create the cfg cfg = WasmCFG ( raw ) # visualization cfg. visualize ()įunctions' instructions analytics from import WasmCFG # complete wasm module file_name = "examples/wasm/samples/hello_wasm_studio.wasm" # read file with open ( file_name, 'rb' ) as f : raw = f. read () # create the cfg cfg = WasmCFG ( raw ) # visualize CFGGraph # generate graph.dot and graph.pdf file cfg. contains_emscripten_syscalls ()) # Control Flow Analysis from import WasmCFG # complete wasm module file_name = "examples/wasm/samples/fib.wasm" # read file with open ( file_name, 'rb' ) as f : raw = f. func_prototypes ) # print () print ( analyzer. read () # return list of functions instructions (list) # attributes analysis=True by default analyzer = WasmModuleAnalyzer ( module_bytecode ) # show analyzer attributes print ( analyzer. disassemble ( r_format = 'text' )) # block -1 # i32.const 24 # call 28 # i32.const 0 # return # end ModuleAnalyzer from import WasmModuleAnalyzer FILE = "examples/wasm/samples/hello_wasm_studio.wasm" with open ( FILE, 'rb' ) as f : module_bytecode = f. # Run tests that require internet access (explorer tests) # Run tests for all platforms (disassembly, CFG.
Simple desktops octopus install#
Or # but prefer the first way to install if possible # Install Octopus library/CLI and its dependencies
Simple desktops octopus update#
Sudo apt-get update & sudo apt-get install python-pip graphviz xdg-utils -y

Octopus is supported on Linux (ideally Ubuntu 16.04) and requires Python >=3.5 (ideally 3.6). :heavy_check_mark: DONE / :heavy_plus_sign: WIP / :heavy_multiplication_x: TODO / :o: N/A Requirements Ethereum smart contracts (EVM bytecode & Ewasm).Octopus support the following types of programs/smart contracts: Symbolic Execution: Octopus use symbolic execution to find new paths into a program.IR conversion (SSA): Octopus can simplify assembly into Static Single Assignment (SSA) representation.Call Flow Analysis: Octopus can generate a Call Flow Graph (function level).Control Flow Analysis: Octopus can generate a Control Flow Graph (CFG).Disassembler: Octopus can translate bytecode into assembly representation.Explorer: Octopus JSON-RPC client implementation to communicate with blockchain platforms.The purpose of Octopus is to provide an easy way to analyze closed-source WebAssembly module and smart contracts bytecode to understand deeper their internal behaviours. Octopus is a security analysis framework for WebAssembly module and Blockchain Smart Contract. Huge thanks to QuoScient for having sponsored this project.
