python3 -m ocgraph -f a.out -d objdump -a sparc -c cov.csv -o a.pdf
./asm2cfg -f a.out -d objdump -a sparc -c cov.csv -o a.pdf
from ocgraph.interface.analyzer import Analyzer
from ocgraph.interface.drawer import Drawer
from ocgraph.interface.coverage_reader import CoverageReader
from ocgraph.coverage_tracer import CoverageTracer
from ocgraph.configuration.configuration import CovTraceConfiguration
# Create configuration
config = OcGraphConfiguration(disassembler="objdump", arch="sparc")
# Read input text
lines = read_lines("a.out")
# Analyze input text
analyser = Analyzer(config=config)
analyser.parse_lines(lines=lines)
# Update analyzed input with coverage data
cov_reader = CoverageReader(instructions=analyser.instructions config=config)
cov_reader.update_by_csv(args.coverage)
drawer = Drawer(analyser.configuration)
drawer.draw_cfg(name=analyser.function_name, basic_blocks=analyser.basic_blocks, output="a.pdf")