Python - Using A String Modifier With A Variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deonbell
    Confirmed User
    • Sep 2015
    • 1045

    #1

    Python - Using A String Modifier With A Variable

    Just curious, How would I have gotten this code to work with a variable instead of having "69" hard coded into the code

    Code:
        
        secret=('%064x' % 0x69)
        print secret
    This gives me
    00000000000000000000000000000000000000000000000000 00000000000069


    I ended up doing it this way instead. Reading the variable from a file. It works this way.
    Also give me
    00000000000000000000000000000000000000000000000000 00000000000069

    But curious about the above.

    Code:
       
        inputfile = open('inputfile.txt', 'r')
        startdata = inputfile.read()
        inputfile.close() 
        print "starting point"
        
        inputlove=startdata.strip()   
       
        fart = inputlove.zfill(64)
    
        print fart
    Thank you my gfy friends.
  • deonbell
    Confirmed User
    • Sep 2015
    • 1045

    #2
    I copied someone else's code and I plan on modifying it for my brute force
    Next step is finding out how to verify whether the public address has been used. This will be the hard part.

    Here is the output I get so far.

    router@router-start:~/Desktop/python/bitcoingen$ python usethis.py
    Y or N - Ready?
    y
    starting point
    00000000000000000000000000000000000000000000000000 00000000000069
    ('1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT', '5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreNXqEJ Tk')

    Comment

    • Bladewire
      StraightBro
      • Aug 2003
      • 56228

      #3


















      Skype: CallTomNow

      Comment

      • Sly
        Let's do some business!
        • Sep 2004
        • 31376

        #4
        .format()

        https://pyformat.info/
        Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

        Windows VPS now available
        Great for TSS, Nifty Stats, remote work, virtual assistants, etc.
        Click here for more details.

        Comment

        • Colmike9
          (>^_^)b
          • Dec 2011
          • 7230

          #5
          Edit: .
          Join the BEST cam affiliate program on the internet!
          I've referred over $1.7mil in spending this past year, you should join in.
          I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

          Comment

          • deonbell
            Confirmed User
            • Sep 2015
            • 1045

            #6
            Originally posted by deonbell
            Next step is finding out how to verify whether the public address has been used. This will be the hard part.
            I was wrong. Very easy, Thank to a bitcoin API created by Vitalik Buterin, the brains behind Ethereum. Pybitcointools has the function history(addr). Simple as that.

            Now here is my output.

            Y or N - Ready?
            y
            starting point
            00000000000000000000000000000000000000000000000000 00000000000069
            1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT
            [{'output': u'56d3132de2297da24d507346575d68f058796ad362142b41 6cfc746798fe5998:1', 'block_height': 423666, 'spend': u'ce965dbfff1b57d9522e34c436d58682edc4ad336bd1f92b 5d12f826090b3b41:0', 'value': 5000000, 'address': u'1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT'}, {'output': u'e5b4b528ff502edfc67fd0e76d2d37f15b904e8e368dff04 e38b856c0ff9ef7f:0', 'block_height': 315653, 'spend': u'd53e9c6f5c8b1140cd8aa7ad4681eb11e13fbc0954eba108 e383d710fc0f7b2b:0', 'value': 100000, 'address': u'1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT'}]
            ('1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT', '5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreNXqEJ Tk')

            Here is the output when I change the exponent for a bitcoin address that does not exist.
            python usethis.py
            Y or N - Ready?
            y
            starting point
            00000000000000000000000000000000000000000000000000 00000000009999
            1A4MGxC9Yk7qkzKYxMYDW2R4fDFhzRmkv7
            []
            ('1A4MGxC9Yk7qkzKYxMYDW2R4fDFhzRmkv7', '5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEssxevqLt KV')

            Comment

            • Ferus
              Bye - Left to do stuff
              • Feb 2013
              • 4108

              #7
              You need to format the output. The worker is fine.

              Comment

              Working...