summaryrefslogtreecommitdiff
path: root/foreign/client_handling/lazagne/softwares/games/roguestale.py
diff options
context:
space:
mode:
Diffstat (limited to 'foreign/client_handling/lazagne/softwares/games/roguestale.py')
-rw-r--r--foreign/client_handling/lazagne/softwares/games/roguestale.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/foreign/client_handling/lazagne/softwares/games/roguestale.py b/foreign/client_handling/lazagne/softwares/games/roguestale.py
new file mode 100644
index 0000000..ded16eb
--- /dev/null
+++ b/foreign/client_handling/lazagne/softwares/games/roguestale.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+import os
+import re
+from xml.etree.cElementTree import ElementTree
+
+from foreign.client_handling.lazagne.config.constant import constant
+from foreign.client_handling.lazagne.config.module_info import ModuleInfo
+
+
+class RoguesTale(ModuleInfo):
+ def __init__(self):
+ ModuleInfo.__init__(self, 'roguestale', 'games')
+
+ def run(self):
+ creds = []
+ directory = constant.profile['USERPROFILE'] + u'\\Documents\\Rogue\'s Tale\\users'
+
+ # The actual user details are stored in *.userdata files
+ if os.path.exists(directory):
+ files = os.listdir(directory)
+
+ for f in files:
+ if re.match('.*\.userdata', f):
+ # We've found a user file, now extract the hash and username
+
+ xmlfile = directory + '\\' + f
+ tree = ElementTree(file=xmlfile)
+ root = tree.getroot()
+
+ # Double check to make sure that the file is valid
+ if root.tag != 'user':
+ self.warning(u'Profile %s does not appear to be valid' % f)
+ continue
+
+ # Now save it to credentials
+ creds.append({
+ 'Login': root.attrib['username'],
+ 'Hash': root.attrib['password']
+ })
+
+ return creds