summaryrefslogtreecommitdiff
path: root/merge
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-29 21:08:07 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-29 21:08:07 -0300
commitc3bf2db539d832a2483251ff44caabe43987b9e6 (patch)
treed8cce11e34533567855e6540bf4107d804726645 /merge
parent39bdbcdc714797f83e916927872570d01a48e82e (diff)
downloadtools-c3bf2db539d832a2483251ff44caabe43987b9e6.tar.gz
tools-c3bf2db539d832a2483251ff44caabe43987b9e6.tar.bz2
tools-c3bf2db539d832a2483251ff44caabe43987b9e6.tar.xz
tools-c3bf2db539d832a2483251ff44caabe43987b9e6.zip
In theory, we could reverse-enginner password salt and keep it somewhere.
Ofc, only adding the salt will not get the md5 hash...
Diffstat (limited to 'merge')
-rwxr-xr-xmerge/handler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/merge/handler.py b/merge/handler.py
index c46546c..151af1b 100755
--- a/merge/handler.py
+++ b/merge/handler.py
@@ -28,6 +28,7 @@ class Account:
self.lv=0 # level ^ 1.2 to valorize higher level chars (experience principle)
self.mpt=0 # MobPt
self.password="0000"
+ self.salt="1"
allinv={}
allit=0
@@ -134,9 +135,10 @@ for line in acf:
if (a[0] in gm): # GM? We should skip, too
continue
aid=a[0]
- allacc[aid]=Account(aid, a[1])
+ allacc[aid]=Account(aid, a[1].replace('\\', '\\\\').replace('\n', '').replace('\'', '\\\'').replace('\"', '\\\"'))
allacc[aid].password=a[2].split('$')
allacc[aid].password=str(allacc[aid].password[1])
+ allacc[aid].salt=str(allacc[aid].password[0])
report_acc+=1
# Storage
@@ -360,7 +362,7 @@ for aid in allacc:
continue
# Otherwise, we are done for good, save to query
query.write("INSERT INTO %s (ACNAME, GP, XP, INV) VALUES ('%s',%d,%d,%d)\n" % (sqltable, acc.name, acc.gp, acc.lv, acc.pts ))
- query.write("INSERT INTO %s (ACNAME, MD5) VALUES ('%s','%s')\n" % (sqltable2, acc.name, acc.password ))
+ query.write("INSERT INTO %s (ACNAME, MD5, SALT) VALUES ('%s','%s','%s')\n" % (sqltable2, acc.name, acc.password, acc.salt ))
rd3+=1
# Generate account entry on another table