コード例 #1
0
 def __init__(
     self,
     addresses: Arg(
         type=sliceobj,
         nargs='+',
         metavar='start:count:align',
         help=
         ('Use Python slice syntax to describe an area of virtual memory to read. If a chunksize is '
          'specified, then the unit will always read a multiple of that number of bytes'
          )),
     ascii: Arg.Switch(
         '-a', group='END',
         help='Read ASCII strings; equivalent to -th:00') = False,
     utf16: Arg.Switch(
         '-u',
         group='END',
         help=
         'Read UTF16 strings; equivalent to -th:0000 (also sets chunksize to 2)'
     ) = False,
     until: Arg.Binary('-t',
                       group='END',
                       help='Read until sequence {varname} is read.') = B'',
     base: Arg.Number(
         '-b',
         metavar='ADDR',
         help='Optionally specify a custom base address B.') = None,
 ):
     if sum(1 for t in (until, utf16, ascii) if t) > 1:
         raise ValueError(
             'Only one of utf16, ascii, and until can be specified.')
     return super().__init__(addresses=addresses,
                             utf16=utf16,
                             ascii=ascii,
                             until=until,
                             base=base)
コード例 #2
0
ファイル: reduce.py プロジェクト: binref/refinery
 def __init__(
     self,
     *reduction: Arg(
         type=str,
         metavar='pipeline',
         help=
         ('The remaining command line is a refinery pipeline. The input for this pipeline is the currently accumulated data '
          'and the next chunk to be combined is passed in a temporary meta variable.'
          )),
     init: Arg.Binary(
         '-i',
         help=
         'Optionally specify the initial buffer. When omitted, the first chunk is used.'
     ) = None,
     temp: Arg(
         '-t',
         type=str,
         metavar='name',
         help=
         'The name of the temporary variable. The default is "{default}".'
     ) = 't',
 ):
     super().__init__(reduction=reduction, temp=temp, init=init)
コード例 #3
0
ファイル: officecrypt.py プロジェクト: binref/refinery
 def __init__(self, password: Arg.Binary(help=(
     'The document password. By default, the Excel default password "{default}" is used.'
 )) = b'VelvetSweatshop'):
     super().__init__(password=password)