Little program for in an apple store.

Don’t get me wrong on this one, I love macs. But I found this little program to run in apple stores. It does nothing to the target computer and can be deleted easily.

How to install:
1: Copy the code from here or from http://timsutilities.netfirms.com/personal.html using private browsing to leave no traces. (Found in the ‘Safari’ menu)

2: Save the application on the target mac. I suggest in a folder on the desktop for easy removal by employees. Don’t make it read only or, if caught, you could get in a lot of trouble as you can’t prove it’s non-maliciousness.

3: Start the program. You will be presented with a textedit window. Type in ‘shop’.

4: Now you are prompted for a trick-type. Either type ‘erase’ to simulate erasing the hard drive, format, to do the obvious, or h alert to display a hacker alert box which will shut down the computer after a ‘file goes missing’ alert box. I haven’t implemented the hacker option which was supposed to make random text fly up the textedit document as if the computer was running commands very quickly. Like a hacker’s program. Implement it if you wish.

5: once you’ve typed in your option, type in your time delay. This is in seconds. I suggest a nice big number such as 600, 10 minutes.

6: Leg it. You have however many seconds until the shop workers have a little something to do.

property Prompttxt : "CLI"
property deftext : " version 1.0.0"
CLS()
repeat
	set command to ""
	set subcom to ""
	set command to prompt(Prompttxt)
	if command is "quit" or command is "stop" or command is "terminate" then
		done()
		exit repeat
	else if command is "shop" then
		set subcom to (prompt("Trick: Erase, Format, H Alert, Hacker"))
		set timer to (prompt("Delay"))
		tell application "TextEdit" to quit without saving
		delay timer
		tell application "TextEdit" to activate
		if subcom is "erase" then
			CLS()
			set dahd to item 1 of (list disks)
			set dafiles to (list folder dahd & ":" without invisibles)
			repeat with i from 1 to the number of items in dafiles
				set currfol to item i of dafiles as text
				display("Deleting file " & currfol)
				try
					delay (size of (info for alias (dahd & ":" & currfol))) / 10000
				end try
			end repeat
		else if subcom is "format" then
			CLS()
			display("Resetting Hard Drive:")
			delay 500
			display("Reset complete.")
			delay 1
			display("Preparing volume for injection")
			delay 120
			display("Injection Complete")
			repeat
				set moooooo to prompt("Formatting Hard Drive")
				if moooooo is in {"stop", "cancel", "terminate", "no", "halt", "undo", "d", "q"} then
					exit repeat
				end if
			end repeat
			display("Format terminated.")
		else if subcom is "h alert" then
			tell application "TextEdit" to quit without saving
			tell application "Console"
				activate
				set subcom to the button returned of (display alert "Hacker Alert" message "Your computer is under attack by a hacker. Sever the internet connection immediatly or seek professional aid." as warning)
				set subcom to the button returned of (display alert "File Missing" message "Your computer is missing a vital file:" & return & "name: sdec.dtd" & return & "usual location: /System/Library/DTDs/sdec.dtd" & return & "Your computer must now shut down." as warning)
			end tell
			tell application "System Events" to shut down
			exit repeat
		end if
	else if command is "" then
		display("No command.")
	else
		display(command & " is not understood.")
	end if
end repeat


on prompt(prompt)
	set prompt to prompt & ": "
	tell application "TextEdit"
		set the text of the front document to the text of the front document & prompt
	end tell
	repeat
		tell application "TextEdit"
			activate
			set test to the text of the front document
		end tell
		if the last character of test is (ASCII character 10) then
			exit repeat
		end if
	end repeat
	set num to (the number of characters in prompt)
	set endtext to strip(test, num)
	return endtext
end prompt

on strip(theword, thenumber)
	try
		set StoreT to ""
		set StoreN to the number of characters in theword
		repeat with i from 1 to (StoreN - 1)
			set StoreT to StoreT & character i of theword
		end repeat
		set command to the last paragraph of StoreT
		set endtext to ""
		repeat with i from thenumber + 1 to (the number of characters in command)
			set endtext to endtext & character i of command
		end repeat
		return endtext
	on error e
		display dialog e
	end try
end strip

on display(thetext)
	tell application "TextEdit"
		set the text of the front document to the text of the front document & thetext & return
	end tell
end display

on show(datxt, prvtxt)
	if prvtxt is "" then
		tell application "TextEdit" to set prvtxt to the text of the front document
	end if
	return prvtxt & return & datxt & return
end show

on currenttext()
	tell application "TextEdit"
		return the text of the front document
	end tell
end currenttext

on settext(datext)
	tell application "TextEdit"
		set the text of the front document to datext
	end tell
end settext

on CLS()
	tell application "TextEdit"
		set the text of the front document to deftext & return
	end tell
end CLS

on done()
	tell application "TextEdit"
		set the text of the front document to ""
		close the front document without saving
		quit
	end tell
end done

Before people say ‘How would you like it…’, I found this program on one of the macs that I work with in belgium. I am a mac salesperson myself and was ‘entertained’ by this amusing little nugget myself. I just … upgraded it.