Projects STRLCPY btcrecover Commits 1b037556
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    btcrecover/btcrpass.py
    skipped 43 lines
    44 44  # Armory, btcrecover will just load the version that ships with Armory.
    45 45   
    46 46   
     47 +def full_version():
     48 + from struct import calcsize
     49 + return "btcrecover {} on Python {} {}-bit, {}-bit unicodes, {}-bit ints".format(
     50 + __version__,
     51 + ".".join(str(i) for i in sys.version_info[:3]),
     52 + calcsize("P") * 8,
     53 + sys.maxunicode.bit_length(),
     54 + sys.maxint.bit_length() + 1
     55 + )
     56 + 
     57 + 
    47 58  # One of these two is typically called relatively early by parse_arguments()
    48 59  def enable_unicode_mode():
    49 60   global io, tstr, tstr_from_stdin, tchr
    skipped 2833 lines
    2883 2894   parser_common.add_argument("--listpass", action="store_true", help="just list all password combinations to test and exit")
    2884 2895   parser_common.add_argument("--performance", action="store_true", help="run a continuous performance test (Ctrl-C to exit)")
    2885 2896   parser_common.add_argument("--pause", action="store_true", help="pause before exiting")
    2886  - parser_common.add_argument("--version","-v",action="version", version="%(prog)s " + __version__)
     2897 + parser_common.add_argument("--version","-v",action="store_true", help="show full version information and exit")
    2887 2898   bip39_group = parser_common.add_argument_group("BIP-39 passwords")
    2888 2899   bip39_group.add_argument("--bip39", action="store_true", help="search for a BIP-39 password instead of from a wallet")
    2889 2900   bip39_group.add_argument("--mpk", metavar="XPUB", help="the master public key")
    skipped 115 lines
    3005 3016   elif args.help:
    3006 3017   parser.print_help()
    3007 3018   sys.exit(0)
     3019 + 
     3020 + # Version information is always printed by btcrecover.py, so just exit
     3021 + if args.version: sys.exit(0)
    3008 3022   
    3009 3023   
    3010 3024   if args.performance and (base_iterator or args.passwordlist or args.tokenlist):
    skipped 2581 lines
  • ■ ■ ■ ■ ■
    btcrecover/btcrseed.py
    skipped 40 lines
    41 41  
    42 42  ADDRESSDB_DEF_FILENAME = "addresses.db"
    43 43  
     44 +def full_version():
     45 + return "seedrecover {}, {}".format(
     46 + __version__,
     47 + btcrpass.full_version()
     48 + )
     49 +
    44 50  
    45 51  ################################### Utility Functions ###################################
    46 52  
    skipped 1502 lines
    1549 1555   parser.add_argument("--no-pause", action="store_true", help="never pause before exiting (default: auto)")
    1550 1556   parser.add_argument("--performance", action="store_true", help="run a continuous performance test (Ctrl-C to exit)")
    1551 1557   parser.add_argument("--btcr-args", action="store_true", help=argparse.SUPPRESS)
    1552  - parser.add_argument("--version","-v", action="version", version="%(prog)s {} (btcrecover.py {})".format(__version__, btcrpass.__version__))
     1558 + parser.add_argument("--version","-v",action="store_true", help="show full version information and exit")
    1553 1559  
    1554 1560   # Optional bash tab completion support
    1555 1561   try:
    skipped 3 lines
    1559 1565   pass
    1560 1566   assert argv
    1561 1567  
    1562  - # Parse the args; unknown args will be passed to btcrpass.parse_arguments() iff --btcrpass-args is specified
     1568 + # Parse the args; unknown args will be passed to btcrpass.parse_arguments() iff --btcr-args is specified
    1563 1569   args, extra_args = parser.parse_known_args(argv)
    1564 1570   if extra_args and not args.btcr_args:
    1565 1571   parser.parse_args(argv) # re-parse them just to generate an error for the unknown args
    1566 1572   assert False
     1573 +
     1574 + # Version information is always printed by seedrecover.py, so just exit
     1575 + if args.version: sys.exit(0)
    1567 1576  
    1568 1577   if args.wallet:
    1569 1578   loaded_wallet = btcrpass.load_wallet(args.wallet)
    skipped 271 lines
  • ■ ■ ■ ■ ■ ■
    btcrecover/test/test_passwords.py
    skipped 66 lines
    67 67   class StringIONonClosing(BytesIO, NonClosingBase):
    68 68   def close(self): pass
    69 69   btcrpass.enable_ascii_mode()
    70  - tstr = str
    71 70   tchr = chr
    72 71   utf8_opt = ""
    73 72   print("** Testing in ASCII character mode **")
    skipped 7 lines
    81 80   class StringIONonClosing(StringIO, NonClosingBase):
    82 81   def close(self): pass
    83 82   btcrpass.enable_unicode_mode()
    84  - tstr = unicode
    85 83   tchr = unichr
    86 84   utf8_opt = " --utf8"
    87 85   print("** Testing in Unicode character mode **")
    skipped 1834 lines
  • ■ ■ ■ ■ ■
    btcrecover.py
    skipped 31 lines
    32 32   
    33 33  if __name__ == "__main__":
    34 34   
     35 + print("Starting", btcrpass.full_version())
    35 36   btcrpass.parse_arguments(sys.argv[1:])
    36 37   (password_found, not_found_msg) = btcrpass.main()
    37 38   
    skipped 19 lines
  • ■ ■ ■ ■ ■
    run-all-tests.py
    skipped 58 lines
    59 59  
    60 60   is_coincurve_loadable = test_passwords.can_load_coincurve()
    61 61   if is_coincurve_loadable:
    62  - from btcrecover.test import test_seeds
     62 + from btcrecover.test import test_seeds
     63 + from btcrecover.btcrseed import full_version
     64 + else:
     65 + from btcrecover.btcrpass import full_version
    63 66  
    64 67   # Add two new arguments to those already provided by main()
    65 68   parser = argparse.ArgumentParser(add_help=False)
    skipped 5 lines
    71 74   # By default, pause before exiting
    72 75   if not args.no_pause:
    73 76   atexit.register(lambda: raw_input("\nPress Enter to exit ..."))
     77 +
     78 + print("Testing", full_version() + "\n")
    74 79  
    75 80   # Additional setup normally done by green.cmdline.main()
    76 81   if has_green:
    skipped 68 lines
  • ■ ■ ■ ■ ■
    seedrecover.py
    skipped 31 lines
    32 32  
    33 33  if __name__ == "__main__":
    34 34  
     35 + print("Starting", btcrseed.full_version())
    35 36   btcrseed.register_autodetecting_wallets()
    36 37   mnemonic_sentence = btcrseed.main(sys.argv[1:])
    37 38  
    skipped 25 lines
Please wait...
Page is in error, reload to recover