forked from ChrisTruncer/LaZagne
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Games category and Rogue's Tale module
- Loading branch information
1 parent
6e24e7c
commit ec76ed9
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import xml.etree.cElementTree as ET | ||
import os, re | ||
from config.constant import * | ||
from config.write_output import print_output, print_debug | ||
from config.header import Header | ||
from config.moduleInfo import ModuleInfo | ||
|
||
class RoguesTale(ModuleInfo): | ||
def __init__(self): | ||
options = {'command': '-f', 'action': 'store_true', 'dest': 'roguestale', 'help': 'roguestale'} | ||
ModuleInfo.__init__(self, 'roguestale', 'games', options) | ||
|
||
def run(self): | ||
# print title | ||
Header().title_info('Rogue\'s Tale') | ||
creds = [] | ||
|
||
if 'USERPROFILE' in os.environ: | ||
directory = os.environ['USERPROFILE'] + '\\Documents\\Rogue\'s Tale\\users' | ||
else: | ||
print_debug('ERROR', 'The USERPROFILE environment variable is not defined.') | ||
return | ||
|
||
# The actual user details are stored in *.userdata files | ||
if not os.path.exists(directory): | ||
print_debug('ERROR', 'Rogue\'s Tale appears to not be installed.') | ||
return | ||
|
||
files = os.listdir(directory) | ||
|
||
for file in files: | ||
if re.match('.*\.userdata',file): | ||
# We've found a user file, now extract the hash and username | ||
values = {} | ||
|
||
xmlfile = directory + '\\' + file | ||
tree=ET.ElementTree(file=xmlfile) | ||
root=tree.getroot() | ||
|
||
# Double check to make sure that the file is valid | ||
if root.tag != 'user': | ||
print_debug('Profile ' + file + ' does not appear to be valid') | ||
continue | ||
|
||
# Now save it to credentials | ||
values['Login'] = root.attrib['username'] | ||
values['Hash'] = root.attrib['password'] | ||
creds.append(values) | ||
|
||
print_output("Rogue's Tale", creds) | ||
|
||
|