Computer Science Canada

Lie Detector

Author:  Ktomislav [ Fri Sep 19, 2008 10:28 am ]
Post subject:  Lie Detector

MOD EDIT: WARNING THIS PROGRAM MAY SHUT DOWN YOUR COMPUTER

Before you execute it save all work!!!

I'm not responsible for any consequences.

Author:  Dan [ Fri Sep 19, 2008 10:54 am ]
Post subject:  RE:Lie Detector

I looked at the exe in a hex editor and it has system calls to "C:\Windows\system32\Shutdown.exe -s -t 5" so this program can shut down your computer.

Also it looks like you define the string "C:\Windows\system32\Shutdown.exe -s -t 5" muptipal times, you realy should put that in a varibale rather then putting the hole string in Sys.exec each time :p

Also since you hardcoded the path this will not work on computers who do not have windows installed in the C drive. If system32 is in the path, you should be able to just put in "Shutdown.exe -s -t" and not the hole path to it (tho i am not sure if windows puts the system32 folder in the path by defualt).

Author:  Zeroth [ Fri Sep 19, 2008 10:59 am ]
Post subject:  Re: Lie Detector

...Why would he have it be able to shutdown the computer?

Author:  Zampano [ Fri Sep 19, 2008 11:56 am ]
Post subject:  Re: Lie Detector

Because that's what all the cool people do. Cool

Author:  Ktomislav [ Fri Sep 19, 2008 12:50 pm ]
Post subject:  Re: Lie Detector

I know that that works only for Windows but most people uses Windows.
And about that system32 folder. That's how it is on my computer.
Is shutdown.exe file in WINDOWS dir on your computer?

Quote:

Also it looks like you define the string "C:\Windows\system32\Shutdown.exe -s -t 5" muptipal times, you realy should put that in a varibale rather then putting the hole string in Sys.exec each time


Why?

Quote:

Also since you hardcoded the path this will not work on computers who do not have windows installed in the C drive. If system32 is in the path, you should be able to just put in "Shutdown.exe -s -t" and not the hole path to it (tho i am not sure if windows puts the system32 folder in the path by defualt).


Thanks, I didn't know that. I saw "C:\Windows\system32\Shutdown.exe" on this forum so i thought that would be OK.

And yes, it should be able shut down the computer (in Windows).

Author:  Zeroth [ Fri Sep 19, 2008 1:30 pm ]
Post subject:  Re: Lie Detector

But again, I ask, why does the program have the shutdown command in it? There is no real moral/ethical reason to do this, as it is MY computer, and I want control over it. You still haven't quite described /what/ the program does.

Author:  Dan [ Fri Sep 19, 2008 1:31 pm ]
Post subject:  Re: Lie Detector

Ktomislav @ 19th September 2008, 12:50 pm wrote:
I know that that works only for Windows but most people uses Windows.
And about that system32 folder. That's how it is on my computer.
Is shutdown.exe file in WINDOWS dir on your computer?


I run linux so it would not even run if it was there.


Quote:

Quote:

Also it looks like you define the string "C:\Windows\system32\Shutdown.exe -s -t 5" muptipal times, you realy should put that in a varibale rather then putting the hole string in Sys.exec each time


Why?


It needlessly uses up memory and also makes the size of the exe slightly bigger. It's probably not a big deal for a program like this.

Author:  Tony [ Fri Sep 19, 2008 2:15 pm ]
Post subject:  RE:Lie Detector

There's a slight chance that shutdown.exe might move somewhere. Then you'd have to update your "program" in multiple places Wink

Author:  Ktomislav [ Fri Sep 19, 2008 2:28 pm ]
Post subject:  Re: Lie Detector

if (File.Exists ...
I know. Very Happy

Dan which hex editor do you use?

Quote:

But again, I ask, why does the program have the shutdown command in it? There is no real moral/ethical reason to do this, as it is MY computer, and I want control over it. You still haven't quite described /what/ the program does.


It's stupid little program, but to me it's funny.

code:

setscreen ("graphics:maxx;maxy,nobuttonbar")
var answer: string;

put "Do you have a computer?"
loop
    get answer
    if (answer = "yes") then
        put "true"
        exit
    elsif (answer = "no") then
        cls
        put "LIAR!"
        put "Take this!"
        put " <>     <>"
        put " "
        put " "
        put " "
        put " /////////"
        delay (1000)
        color (white)
        put Sys.Exec ("C:\\Windows\\system32\\Shutdown.exe -s -t 5")
        exit
    end if
end loop

put "Do you like it?"
loop
    get answer
    if (answer = "yes") then
        put "true"
        exit
    elsif (answer = "no") then
        cls
        put "ARGH!"
        put "I'm really mad now!"
        delay (1000)
        put "Take this!"
        color (white)
        put Sys.Exec ("C:\\Windows\\system32\\Shutdown.exe -s -t 5")
        exit
    end if
end loop

put "Do you want to shut it down?"
loop
    get answer
    if (answer = "yes") then
        cls
        put "Then take this!"
        color (white)
        put Sys.Exec ("C:\\Windows\\system32\\Shutdown.exe -s -t 5")
        exit
    elsif (answer = "no") then
        cls
        put "LIAR!"
        put "I know, deep in your heart, you do."
        delay (1000)
        put "Take this!"
        color (white)
        put Sys.Exec ("C:\\Windows\\system32\\Shutdown.exe -s -t 5")
        exit
    end if
end loop

Author:  Dan [ Fri Sep 19, 2008 6:17 pm ]
Post subject:  Re: Lie Detector

Ktomislav @ 19th September 2008, 2:28 pm wrote:

Dan which hex editor do you use?


KHexEdit

Author:  Insectoid [ Fri Sep 19, 2008 8:10 pm ]
Post subject:  RE:Lie Detector

To be honest, I think this program is just stupid. It looks to me like you found out how to shut down a computer through code, and have made a rather lame program that will use that code when run. The fact that you think it is funny shows that you are immature and self-centered.


Rant over.

Author:  [Gandalf] [ Fri Sep 19, 2008 8:19 pm ]
Post subject:  RE:Lie Detector

So many derailed threads of late... Seems this one has run it's length...

Oh and frhed > all. Smile


: