Skip to content

Instantly share code, notes, and snippets.

View gurnec's full-sized avatar

Christopher Gurnee gurnec

View GitHub Profile
#!/usr/bin/env python
from base64 import *
import sys, struct, zlib
print >> sys.stderr, 'btcrecover extract> ',
key_crc_data = b64decode(raw_input())
key_data = key_crc_data[:-4]
assert key_data[:3] == 'bc:'
@gurnec
gurnec / extract-p2pkh.py
Created December 13, 2017 21:51
extracts unique P2PKH addresses from block files
#!/usr/bin/env python
from __future__ import print_function
import argparse, sys, atexit, hashlib, base64, itertools, struct
from os import path
from btcrecover.addressset import AddressSet, varint
def add(self, address):
pos = self._find(address)
@gurnec
gurnec / electrum28-test.py
Last active January 4, 2022 15:20
Electrum 2.8 password checking with a partial wallet file
#!/usr/bin/env python
from Crypto.Cipher.AES import new as new_aes, MODE_CBC
import zlib, re, hashlib, base64, random
# The decypted and decompressed wallet should start with one of these two:
EXPECTED_BYTES_1 = b'{\n "'
EXPECTED_BYTES_2 = b'{\r\n "'
EXPECTED_BYTES_LEN = max(len(EXPECTED_BYTES_1), len(EXPECTED_BYTES_2))