# Path: owade/constants.py
# PROJECT_DIR = "/opt/"
# 
# PROJECT_NAME = "OwadeReborn/"
# 
# HASHCAT_DIR = PROJECT_DIR + PROJECT_NAME + "owade/fileAnalyze/hashcatLib/hashcat"


import subprocess
import lib
import os
from owade.constants import PROJECT_DIR, PROJECT_NAME, HASHCAT_DIR


class PwDump(object):

    def __init__(self, dictionary=None):
        self.dictionary = dictionary

    def main(self, system, sam):
        """
        :rtype : object
        :param system:
        :param sam:
        :return:
        """
        user_hash = lib.dump_file_hashes(system, sam)
        elementos = user_hash.items()
        final_pass = dict()

        for username, mihash in elementos:
            print username
            print mihash
            print os.getcwd()
            fileRoute = HASHCAT_DIR + "/hash.txt"

            hash_file = open(fileRoute, 'w')
            hash_file.write(mihash + "\n")
            hash_file.close()

            subprocess.check_output(

# Path: owade/constants.py
# PROJECT_DIR = "/opt/"
# 
# PROJECT_NAME = "OwadeReborn/"
# 
# HASHCAT_DIR = PROJECT_DIR + PROJECT_NAME + "owade/fileAnalyze/hashcatLib/hashcat"


# Path: owade/fileAnalyze/hashcatLib/pwdump.py
import subprocess
import lib
import os
from owade.constants import PROJECT_DIR, PROJECT_NAME, HASHCAT_DIR



class PwDump(object):

    def __init__(self, dictionary=None):
        self.dictionary = dictionary

    def main(self, system, sam):
        """
        :rtype : object
        :param system:
        :param sam:
        :return:
        """
        user_hash = lib.dump_file_hashes(system, sam)
        elementos = user_hash.items()
        final_pass = dict()

        for username, mihash in elementos:
            print username
            print mihash
            print os.getcwd()
            fileRoute = HASHCAT_DIR + "/hash.txt"

            hash_file = open(fileRoute, 'w')
            hash_file.write(mihash + "\n")
            hash_file.close()

            subprocess.check_output(

                HASHCAT_DIR + "/hashcat-cli64.bin -m 1000 --rules=" + HASHCAT_DIR + "/perfect.rule " + fileRoute + " " + self.dictionary +