English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

a friend of mine sent me an executable file. when i ran it, it restarted/shutdown my pc. i want to know how he did that? any answers? thanx!

2007-02-11 18:03:40 · 4 answers · asked by Erwin F 1 in Computers & Internet Software

4 answers

there are application programming interface or "API" calls that can do that. Check out http://www.pscode.com for great sample codes.

2007-02-11 18:15:24 · answer #1 · answered by Richard H 7 · 0 0

hi,

There is a function called exec to execute external file from a C or C++ program. (Refer help document Turbo C/C++ Editor)
There is a windows command called shutdown to restart/shutdown the computer.
To know the details
type shutdown in your command prompt..

Restart -- exec("shutdown.exe","-r -t 100")
Shutdown -- exec("shutdown.exe","-s -t 100")

-t switch is optional specifies the time after which the computer will restart/shutdown

2007-02-11 23:16:23 · answer #2 · answered by Manoj B 1 · 0 0

Assuming that you're running windows, he probably just called the ExitWindowsEx function included in windows.h

I'd be weary of running executables that a friend sends you unless you are compiling it yourself. This is how viruses can be spread. A rootkit only needs a restart to be implanted and they can come in small file sizes.

2007-02-11 18:14:32 · answer #3 · answered by Jack Schitt 3 · 0 0

cout>>You'd have to pull apart the exe.

cout>>No such function

The prgm may shutdown your computer but there is no one function that will allow it.

2007-02-11 18:12:03 · answer #4 · answered by nothin_nyce1 4 · 0 0

fedest.com, questions and answers