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!
In C++, what function can restart/shutdown your pc?
there are application programming interface or "API" calls that can do that. Check out http://www.pscode.com for great sample codes.
Reply:cout%26gt;%26gt;You'd have to pull apart the exe.
cout%26gt;%26gt;No such function
The prgm may shutdown your computer but there is no one function that will allow it.
Reply: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.
Reply: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
sweet pea
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment