How to use the dt.opt_hex_input_action function in dt

To help you get started, we’ve selected a few dt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github born2c0de / DataTransformer / dt.py View on Github external
grp_key2file = parser.add_mutually_exclusive_group()
    grp_key2file.add_argument('--key2file', help='Use file contents as key2', dest='key2file', type=FileType('rb'))
    grp_key2file.add_argument('--k2b', '--key2begin', help='Begin reading input for key2 from provided offset from inputfile', dest='key2begin', action=opt_hex_input_action)
    grp_key2file.add_argument('--key2', help='Use value as key2', dest='key2', action=opt_hex_input_action)
    # User can either provide length of bytes to read or constant offset in key2file
    grp_key2end = parser.add_mutually_exclusive_group()
    grp_key2end.add_argument('--k2e', '--key2end', help='Stop reading input for key2 from provided offset from inputfile', dest='key2end', action=opt_hex_input_action)
    grp_key2end.add_argument('--k2l', '--key2len', help='Number of bytes to read as key2 from inputfile', dest='key2len', action=opt_hex_input_action)
    # User can either provide entire ivfile to read or constant offset in inputfile as start of IV
    grp_ivfile = parser.add_mutually_exclusive_group()
    grp_ivfile.add_argument('--ivfile', help='Use file contents as IV', dest='ivfile', type=FileType('rb'))
    grp_ivfile.add_argument('--ivb', '--ivbegin', help='Begin reading input for IV from provided offset from inputfile', dest='ivbegin', action=opt_hex_input_action)
    # User can either provide length of bytes to read or constant offset in ivfile
    grp_ivend = parser.add_mutually_exclusive_group()
    grp_ivend.add_argument('--ive', '--ivend', help='Stop reading input for IV from provided offset from inputfile', dest='ivend', action=opt_hex_input_action)
    grp_ivend.add_argument('--ivl', '--ivlen', help='Number of bytes to read as IV from inputfile', dest='ivlen', action=opt_hex_input_action)
    return parser