How do I get my stuff back?


clown

ok, about 10 minutes ago, i put this .py file on my desktop, changed it to executable, when i double clicked it, it opened, all the files on my desktop disappeared, it Created a folder called "Key Database". Does anyone know how to get my stuff back? Thanks


#!/usr/bin/env python

import os
import sys
import time
import shutil
import commands
from PyQt4 import QtGui,QtCore

def initialize():
    'Set Working directory'
    if 'core' in os.listdir(os.getcwd()):
        create_directory()
    else:
        variable = sys.argv[0]
        direc = variable.replace('execute.py',"")
        if direc:
            os.chdir(direc)
        create_directory()

def restore_files():
    '''Fern 1.2 update algorithm fails to update the new version files
        therefore this piece of code corrects that defect when running
        the program after an update from 1.2'''

    update_directory = '/tmp/Fern-Wifi-Cracker/'

    for old_file in os.listdir(os.getcwd()):
        if os.path.isfile(os.getcwd() + os.sep + old_file) and old_file != '.font_settings.dat':
            os.remove(os.getcwd() + os.sep + old_file)
                                                                    # Delete all old directories except the "key-database" directory
    for old_directory in os.listdir(os.getcwd()):
        if os.path.isdir(os.getcwd() + os.sep + old_directory) and old_directory != 'key-database':
            shutil.rmtree(os.getcwd() + os.sep + old_directory)

    for update_file in os.listdir('/tmp/Fern-Wifi-Cracker'):        # Copy New update files to working directory
        if os.path.isfile(update_directory + update_file):
            shutil.copyfile(update_directory + update_file,os.getcwd() + os.sep + update_file)
        else:
            shutil.copytree(update_directory + update_file,os.getcwd() + os.sep + update_file)

def create_directory():
    'Create directories and database'

    if not os.path.exists('fern-settings'):
        os.mkdir('fern-settings')                               # Create permanent settings directory
    if not os.path.exists('key-database'):                      # Create Database directory if it does not exist
        os.mkdir('key-database')

def cleanup():
    'Kill all running processes'
    commands.getstatusoutput('killall airodump-ng')
    commands.getstatusoutput('killall aircrack-ng')
    commands.getstatusoutput('killall airmon-ng')
    commands.getstatusoutput('killall aireplay-ng')

initialize()

if 'core' not in os.listdir(os.getcwd()):
    restore_files()

from core import *
functions.database_create()
from gui import *

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    run = fern.mainwindow()

    pixmap = QtGui.QPixmap("%s/resources/screen_splash.png" % (os.getcwd()))
    screen_splash = QtGui.QSplashScreen(pixmap,QtCore.Qt.WindowStaysOnTopHint)
    screen_splash.setMask(pixmap.mask())
    screen_splash.show()
    app.processEvents()

    time.sleep(3)

    screen_splash.finish(run)
    run.show()
    app.exec_()

    cleanup()
    sys.exit()
Cobble
for old_directory in os.listdir(os.getcwd()):
if os.path.isdir(os.getcwd() + os.sep + old_directory) and old_directory != 'key-database':
    shutil.rmtree(os.getcwd() + os.sep + old_directory)

That was my friend's culprit.

Related


How do I get my stuff back?

clown ok, about 10 minutes ago, i put this .py file on my desktop, changed it to executable, when i double clicked it, it opened, all the files on my desktop disappeared, it Created a folder called "Key Database". Does anyone know how to get my stuff back? Tha

How do I get my local git stuff into BlueMix?

username I created a zip file from a Clojure project generated by Leiningen. My workflow is based on " http://www.ibm.com/developerworks/cloud/library/cl-suggest-app/index.html?ca=drs-#N10109 " by Oliver Siebenmarck . Diwesh From your question title, I underst

How do I get my local git stuff into BlueMix?

username I created a zip file from a Clojure project generated by Leiningen. My workflow is based on " http://www.ibm.com/developerworks/cloud/library/cl-suggest-app/index.html?ca=drs-#N10109 " by Oliver Siebenmarck . Diwesh From your question title, I underst

How do I get my WordPress back?

display key I have installed bitnami in c:\BitNami (wamp stack is 5.4.24) on Windows XP on local disk and in "c:\BitNami\wampstack-5.4.24-0\apache2\htdocs\wordpress" With wordpress installed, I do some blogging on wordpress. A few days ago my XP crashed and I

How do I get my WordPress back?

display key I have installed bitnami in c:\BitNami (wamp stack is 5.4.24) on Windows XP on local disk and in "c:\BitNami\wampstack-5.4.24-0\apache2\htdocs\wordpress" With wordpress installed, I do some blogging on wordpress. A few days ago my XP crashed and I

How do I get my data back from my IpcMain

Nelz I am creating a drag and drop react and using electron to send and receive my file data. I received senderId and sender in console.log. How can I get the data to appear? What did I miss? Dropzone.js file const [fileNames, setFileNames] = useState([]); co

My library pane is missing, how do I get it back

Paul I've searched for the shortcut in the Xcode preferences, but I can't find a way to get it back. My current interface: Gereon Xcode 11 and 12 : Click the "Plus" button at the top left of the "Show/Hide Code Review" button. Alternatively, use View > Show Li

My library pane is missing, how do I get it back

Paul I've searched for the shortcut in the Xcode preferences, but I can't find a way to get it back. My current interface: geron Xcode 11 and 12 : Click the "Plus" button at the top left of the "Show/Hide Code Review" button. Alternatively, use View > Show Lib

How do I get my user account back?

advertise On all my computers I create one partition for root and another for /home. This is useful for disasters that require reformatting the ubuntu root without affecting my /home data. After upgrading to 13.10, I had trouble with my wife's computer, so I r

How do I get my old notes back?

crazy Windows 10 got one of those updates where you can sit at your PC and be greeted with "Hi!", "Let's restart the computer". Of course they messed up my sticky notes. They appear to be "subway" updates, which won't be Windows updates unless the functionalit

How do I get my user account back?

advertise On all my computers I create one partition for root and another for /home. This is useful for disasters that require reformatting the ubuntu root without affecting my /home data. After upgrading to 13.10, I had trouble with my wife's computer, so I r

How do I get the syringe back for my app?

impostor I am trying to run a function and inject a service into it. I think it can be implemented easily using $injector. So I tried the following example (simplified example): angular.injector().invoke( [ "$q", function( $q ) { $q.something(); } ] ); The re

My library pane is missing, how do I get it back

Paul I've searched for the shortcut in the Xcode preferences, but I can't find a way to get it back. My current interface: Gereon Xcode 11 and 12 : Click the "Plus" button at the top left of the "Show/Hide Code Review" button. Alternatively, use View > Show Li

How do I get back to my login screen?

c. tower My program is written in Java using Eclipse, my program first needs to log in to the server with a username and password, then authenticated, and then goes to a new page (frame) with a JMenuBar, JMenu, and JMenuItem. The JMenuItem I'm working on is ca

How do I get my dropdown menu back?

Kaz Wolfe Recently I decided I couldn't use KDE for some reason and did a (mostly) seamless uninstall. However, this resulted in a lot of weird icon glitches in a few places: The drop down arrow (or any arrow in it) is now gone and nowhere to be found. Switchi

How do I get my user account back?

advertise On all my computers I create one partition for root and another for /home. This is useful for disasters that require reformatting the ubuntu root without affecting my /home data. After upgrading to 13.10, I had trouble with my wife's computer, so I r

How do I get my desktop icons back on the main display?

bus 42 So I've read several questions - with and without answers - and although this is similar to others, I can see nothing special about the problem I'm having. This is a three part question and I think they are all related hence why they are being asked as

How do I get back my old terminal tabs?

Laughed My terminal tab looks like this. But now it looks like this: So I want to have the last terminal. questioner You just need to open the settings.jsonfile and look for: "terminal.integrated.tabs.enabled": true and make itfalse Then your vscode terminal

My library pane is missing, how do I get it back

Paul I've searched for the shortcut in the Xcode preferences, but I can't find a way to get it back. My current interface: geron Xcode 11 and 12 : Click the "Plus" button at the top left of the "Show/Hide Code Review" button. Alternatively, use View > Show Lib

How do I get my old notes back?

crazy Windows 10 got one of those updates where you can sit at your PC and be greeted with "Hi!", "Let's restart the computer". Of course they messed up my sticky notes. They appear to be "subway" updates, which won't be Windows updates unless the functionalit

How do I get my user account back?

advertise On all my computers I create one partition for root and another for /home. This is useful for disasters that require reformatting the ubuntu root without affecting my /home data. After upgrading to 13.10, I had trouble with my wife's computer, so I r

How do I get my user account back?

advertise On all my computers I create one partition for root and another for /home. This is useful for disasters that require reformatting the ubuntu root without affecting my /home data. After upgrading to 13.10, I had trouble with my wife's computer, so I r

How do I get my dropdown menu back?

Kaz Wolfe Recently I decided I couldn't use KDE for some reason and did a (mostly) seamless uninstall. However, this resulted in a lot of weird icon glitches in a few places: The drop down arrow (or any arrow in it) is now gone and nowhere to be found. Switchi

How do I get my desktop icons back on the main display?

bus 42 So I've read several questions - with and without answers - and although this is similar to others, I can see nothing special about the problem I'm having. This is a three part question and I think they are all related hence why they are being asked as

I accidentally used xkill on my desktop - how do I get it back?

Tim I ran to xkillforce quit Chrome and clicked on my desktop. The icon disappeared. Is there an order to get them back? I'd rather not reboot. I am using GNOME and GDM. username Desktop icons are managed by the file browser and can be tried during normal oper