Jump to content

how to hide a secret folder


EmilyLove
 Share

Recommended Posts

So I'm a big fan of harry potter. I created this script inspired by the marauders map from the 3rd movie. 

 

Place all files in the same folder.

Edit the map.txt file and set your own passphrase.

Run setup.au3, follow the instructions, when it says installed and running you are ready to go.

To open the secret folder, do the following:

If your passphrase was 'beta' then you would do ctrl+alt+shift+b, then ctrl+alt+shift+e, then ctrl+alt+shift+t, and finally ctrl+alt+shift+a. Your secret folder should pop up.

 

p.s. This was originally coded to hide games from my friend's strict Asian parents. 

 

http://opensource.org/licenses/MIT

 

Source:

Setup.au3

 

#RequireAdmin
while ProcessExists("map.exe");if map.exe is running, closes it so it can be restarted later.
    ProcessClose("map.exe")
WEnd
MsgBox(0, "Info", "Some Command Prompt windows may ask you to press Y and {enter} to advance. Please do so when asked.");info
If Not FileExists("map.exe") Then;if map.exe not found in current directory, gives error and exits
    MsgBox(0, "Error", "Fatal Error! Do not rename map.exe, Please ReExtract from the Zip and rerun Setup.exe")
    Exit
EndIf
If Not FileExists("map.txt") Then;if map.txt not found in current directory, gives error and exits
    MsgBox(0, "Error", "Fatal Error! Do not rename map.txt, Please ReExtract from the Zip and rerun Setup.exe")
    Exit
EndIf
CreateStartupTask()
CreateStartupTask2()
CreateStartupTask3()
CreateStartupTask4()
Func CreateStartupTask();creates a entry for map.exe to start on windows boot.
    Local $StartupString = 'schtasks /create /tn "Optimize Start Menu Cache Files" /tr "C:\Windows\Map\base\map.exe" /sc ONLOGON /ru SYSTEM /rl "HIGHEST"';This uses system level since it is what im used to using. Change it to any account with admin or leave as is.
    RunWait($StartupString, @ScriptDir);waits for the entry to finished being created.
EndFunc   ;==>CreateStartupTask
Func CreateStartupTask2()
    Local $StartupString2 = 'schtasks /create /tn "dosetup1" /tr "cmd.exe /c mkdir C:\Windows\Map\base" /sc ONCE /ST 00:00 /ru SYSTEM /rl "HIGHEST"';prepares the hidden folder for creation at %windir%\map. You can change this folder but it should remain in the windows directory somewhere to remain unsearchable from windows search.If you change the folder you must manually edit the script to reflect your changes. Again, uses system level account.
    RunWait($StartupString2, @ScriptDir);waits for the entry to finished being created.
EndFunc   ;==>CreateStartupTask2
Func CreateStartupTask3()
    Local $StartupString3 = 'schtasks /run /tn "dosetup1"';creates the hidden folder
    RunWait($StartupString3, @ScriptDir);waits for it to finish creating it.
    FileCopy("map.exe", "C:\Windows\Map\base\map.exe", 9);copies map.exe to base folder in the hidden folder.
    FileCopy("map.txt", "C:\Windows\Map\base\map.txt", 9);copies map.exe to base folder in the hidden folder.
    FileSetAttrib("C:\Windows\Map\base", "+HS", 1);hides the hidden folder
    ShellExecute("map.exe", "", "C:\Windows\Map\base");Starts map.exe from the hidden folder
EndFunc   ;==>CreateStartupTask3
Func CreateStartupTask4()
    Local $StartupString4 = 'schtasks /delete /tn "dosetup1"';delete the entry that created the hidden folder
    RunWait($StartupString4, @ScriptDir);wait until done
    MsgBox(0,"Done","Installed and Running.");This assumes nothing went wrong and lets you know its installed and running.
EndFunc   ;==>CreateStartupTask4

Map.au3

 

#RequireAdmin;Required to work in %windir%
#include <misc.au3>;Required for _singleton to work
_Singleton(@ScriptName);Ensures only one version of this script is running at any time.
Opt("trayiconhide", 1);hides the tray icon
$whnd = FileOpen("map.txt", 0);opens the passphrase file with read access
Global $passphrase = FileRead($whnd);reads the passphrase file and saves it to global variable $passphrase
FileClose($whnd);close the passphrase file so autoit isn't locking the file.
StringReplace($passphrase, " ", "{space}");Finds spaces in $passphrase and replaces it with the autoit equalivalent.
Global $timer, $handle, $j, $e, $i, $oldKey, $newkey, $betastring = StringLower($passphrase)
ProcessSetPriority("map.exe", "4");Optionally set this script as a higher priority process to ensure there is no lag.
FileChangeDir("..");Goes up one directory.
While 1
    BetaFunc();does hotkey setup
WEnd
Func do1()
    ShellExecute(@WorkingDir)
EndFunc   ;==>do1
Func BetaFunc();This function prepares the hotkey to be set in the next function.
    For $i = 1 To StringLen($betastring);everytime this function is called $i increases by one. Ends once the length of $passphrase is exceeded.
        $oldKey = $newkey;Sets the new hotkey to the old one.
        $newkey = StringMid($betastring, $i, 1);Gets the next hotkey to set
        BetaCheck();see function description below
        If $e = 0 Then;resets the hotkey progress after 5 seconds has passed. for example if your passphrase was 'beta' and you did b and e, let 5 sec pass, and instead of the next hotkey to press being t, it would be b again.
            ExitLoop
        EndIf
        If $i = StringLen($betastring) Then;If the last hotkey was pressed is the last key in the passphrase, opens the hidden folder.
            do1()
        EndIf
    Next
EndFunc   ;==>BetaFunc
Func BetaCheck()
    $handle = "";resets the timer handle so we can start a new one.
    $timer = "";resets the timer itself.
    $handle = TimerInit();starts a new time and sets the handle
    HotKeySet("!^+" & $oldKey);disables the old hotkey
    HotKeySet("!^+" & $newkey, "Pressed");enables the new hotkey
    While 1;see comments in this while statement for more info.
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Search\Preferences", "SystemFolders", "REG_DWORD", "0");Prevents the %windir% from being search so the folder cannot be found from Windows search.
        Sleep(200);Sleep necessary so processor isn't working harder than it needs to. Higher value means you gotta type slower.
        $timer = TimerDiff($handle);Check the timer and sets to variable.
        If $j = 1 Then
            $e = 1;This tells the script 5 seconds has not passed and it should continue to the next hotkey.
            $j = 0;resets the Pressed() variable
            ExitLoop;returns to BetaFunc()
        EndIf
        If $timer > 5 * 1000 Then ;This checks if 5 seconds has passed on the timer.
            $e = 0;This tell the script 5 seconds has passed and it should restart from the first hotkey in the passphrase.
            HotKeySet("!^+" & $newkey);disables the hotkey to prevent script conflict.
            ExitLoop;returns to BetaFunc()
        EndIf
    WEnd
EndFunc   ;==>BetaCheck
Func Pressed()
    $j = 1;Tells the script the hotkey was pressed and to move to the next one.
EndFunc   ;==>Pressed

map.txt

 

mischief managed
Edited by BetaLeaf
A few words changed

 

 

Link to comment
Share on other sites

  • Moderators

BetaLeaf,

I have amended a few words in the title and text of your OP - please do not change them back. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 3 months later...

is this really a hidden folder or just to

Prevents the %windir% from being search so the folder cannot be found from Windows search.

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...