123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189(**************************************************************************)(* This file is part of BINSEC. *)(* *)(* Copyright (C) 2016-2022 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)includeCli.Make(structletshortname="sse"letname="Static Symbolic Execution"end)moduleAlternativeEngine=Builder.False(structletname="alternative-engine"letdoc="Enable the experimental engine"end)moduleMaxDepth=Builder.Integer(structletname="depth"letdefault=1000letdoc="Set exploration maximal depth"end)moduleTransientEnum=Builder.Integer(structletname="self-written-enum"letdefault=0letdoc="Set maximum number of forks for symbolic instruction opcodes"end)moduleJumpEnumDepth=Builder.Integer(structletname="jump-enum"letdefault=3letdoc="Set maximum number of jump targets to retrieve for dynamic jumps"end)moduleRandomize=Builder.False(structletname="randomize"letdoc="randomize path selection"end)moduleAvoidAddresses=Builder.String_set(structletname="no-explore"letdoc="set addresses where sse should stop"end)moduleGoalAddresses=Builder.String_set(structletname="explore"letdoc="set addresses where sse should try to go"end)moduleLoadSections=Builder.String_set(structletname="load-sections"letdoc="Sections to load in initial memory (may be overridden by -memory)"end)moduleLoadROSections=Builder.False(structletname="load-ro-sections"letdoc="Load the content of all read-only sections (see also -sse-load-sections)"end)moduleMemoryFile=Builder.String_option(structletname="memory"letdoc="set file containing the initial (concrete) memory state"end)moduleScriptFiles=Builder.String_list(structletname="script"letdoc="set file containing initializations, directives and stubs"end)moduleComment=Builder.False(structletname="comment"letdoc="Add comments indicating the origin of the formulas in generated scripts"end)moduleTimeout=Builder.Integer_option(structletname="timeout"letdoc="Sets a timeout for symbolic execution in second"end)moduleAddress_counter=structtypet={address:Virtual_address.t;counter:int}letof_strings=matchString.split_on_char':'swith|[address;counter]->{address=Virtual_address.of_stringaddress;counter=int_of_stringcounter;}|_->assertfalseletdecrc={cwithcounter=c.counter-1}letcheck_and_decrc=ifc.counter>0thenSome(decrc)elseNoneendmoduleVisit_address_counter=Builder.Variant_list(structincludeAddress_counterletname="visit-until"letdoc="Specify a the maximum number of times [n] an address [vaddr] is visited \
by SE (format: <vaddr>:<n>)"end)typesearch_heuristics=Dfs|Bfs|NursmoduleSearch_heuristics=Builder.Variant_choice_assoc(structtypet=search_heuristicsletname="heuristics"letdoc="Use the following search heuristics"letdefault=Dfsletassoc_map=[("dfs",Dfs);("bfs",Bfs);("nurs",Nurs)]end)moduleSolver_call_frequency=Builder.Integer(structletname="solver-call-frequency"letdefault=1letdoc="Call the solver every <n> times"end)moduleSeed=Builder.Integer_option(structletname="seed"letdoc="Give a specific seed for random number generators"end)moduleDirectives=Builder.Any(structtypet=Directive.tlistletname="directives"letdoc="Set SSE directive"letdefault=[]letto_string_="no directives"letof_strings=letlexbuf=Lexing.from_stringsinParser.directivesLexer.tokenlexbufend)moduleDot_filename_out=Builder.String_option(structletname="cfg-o"letdoc="Output CFG in this file"end)