Document cli better (#482)

* Update README.md

* Rewrite -h

* Clearer cli usage

* Fix forgotten variable name changes

* Fix more forgotten variables
This commit is contained in:
Mark Mossberg
2017-09-07 20:15:31 -04:00
committed by GitHub
parent 60c6813a80
commit 8b66e58c7b
3 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -100,7 +100,9 @@ have to manually set the workspace to the redis URI.
## Usage
```
$ manticore ./path/to/binary # runs, and creates a mcore_* directory with analysis results
$ manticore ./path/to/binary # runs, and creates a mcore_* directory with analysis results
$ manticore ./path/to/binary ab cd # use concrete strings "ab", "cd" as program arguments
$ manticore ./path/to/binary ++ ++ # use two symbolic strings of length two as program arguments
```
or
+3 -3
View File
@@ -52,8 +52,8 @@ def parse_arguments():
help='Enable profiling mode.')
parser.add_argument('--procs', type=int, default=1,
help='Number of parallel processes to spawn')
parser.add_argument('programs', type=str, nargs='+', metavar='PROGRAM',
help='Programs to analyze (arguments after ?)')
parser.add_argument('argv', type=str, nargs='+',
help="Path to program, and arguments ('+' in arguments indicates symbolic byte).")
parser.add_argument('--replay', type=str, default=None,
help='The trace filename to replay')
parser.add_argument('--size', type=str, help='Specify buffer full size')
@@ -79,7 +79,7 @@ def parse_arguments():
def main():
args = parse_arguments()
m = Manticore(args.programs[0], args.programs[1:], disasm=args.disasm)
m = Manticore(args.argv[0], args.argv[1:], disasm=args.disasm)
m.policy = args.policy
m.args = args
+3 -3
View File
@@ -89,7 +89,7 @@ def makeLinux(program, disasm, argv, env, symbolic_files, concrete_start=''):
def makeWindows(args):
assert args.size is not None, "Need to specify buffer size"
assert args.buffer is not None, "Need to specify buffer base address"
logger.debug('Loading program %s (platform: Windows)', args.programs)
logger.debug('Loading program %s (platform: Windows)', args.argv)
additional_context = None
if args.context:
with open(args.context, "r") as addl_context_file:
@@ -97,7 +97,7 @@ def makeWindows(args):
logger.debug('Additional context loaded with contents {}'.format(additional_context)) #DEBUG
constraints = ConstraintSet()
platform = windows.SWindows(constraints, args.programs[0], additional_context, snapshot_folder=args.workspace)
platform = windows.SWindows(constraints, args.argv[0], additional_context, snapshot_folder=args.workspace)
#This will interpret the buffer specification written in INTEL ASM. (It may dereference pointers)
data_size = parse(args.size, platform.current.read_bytes, platform.current.read_register)
@@ -173,7 +173,7 @@ class Manticore(object):
self._check_disassembler_present(disasm)
self._disasm = disasm
# yan's comment
self._argv = args # args.programs[1:]
self._argv = args
self._env = {}
# Will be set to a temporary directory if not set before running start()
self._policy = 'random'