hey guys its me again i have a question about the EWX_REBOOT function i tryed it on my computer but the only thing i could use was EWX_LOGOFF
Printable View
hey guys its me again i have a question about the EWX_REBOOT function i tryed it on my computer but the only thing i could use was EWX_LOGOFF
Whatever function you're using, i recommend the ExitWindowsEx()
ya thats what i am using exitwindowsex but the only value for that that works is log off im trying to get it to reboot or shutdown
Lets see the code.
I think you have to use the EWX_FORCE too or something like that.. that forces all applications to close and reboot.. or something like that :p
well or u sure Force would reboot but they all r ment to force programs to shut down and then the computer to go off except for log off really this program is ment for my self and ive been hacked so many time its starting to agravate me so i want to c if this program will work the point of it is that when they take control of my computer or something i will send this program to them to completly shut them down using EWX_POWEROFF which will buy me some time it s a pretty good plan dont ya think so
hackers are NOT considered as elite programmers :p
Actually, hacker was originally a term used for the very good programmers. Crackers are the bad ones.
I read in a book that most of the programmers that fail to be good programmers, become hackers and virus writers.. dont know about you :p
Exerpt
I think most of our modern day hackers and virus writers are 99% script kiddies, .75% people who tried to learn programming but failed, and .25% of bored programmers.Quote:
In the late 1950s MIT students who loved to tinker with the university's gigantic early computers started calling themselves "hackers." At one stage being a hacker was a badge of honor conferred on an elite programmer or computer hardware designer.
Uh, what?... :rolleyes:Quote:
the point of it is that when they take control of my computer or something i will send this program to them to completly shut them down using EWX_POWEROFF which will buy me some time
"Hi, you just took control of my computer so i'm sending this email to you. Please execute the attachment. Have a nice day!"
lmao :D :D :D :D :D :p :p :p :p
There's an ExitWindowSex() command ?
Programming languages these days.
I'm sure someone would fall for it. :pQuote:
Originally posted by Hunter2
Uh, what?... :rolleyes:
"Hi, you just took control of my computer so i'm sending this email to you. Please execute the attachment. Have a nice day!"
Well I'm not sure if this works (or if it works on all windows os) but:
put that if your program and then run it :) I don't feel like testing it right nowCode:system("c:\windows\rundll.exe shell32.dll,SHExitWindowsEx 8");
That made my pc log off.. is there a way to make it Shut Down or Reboot or something?
The code is actually rather trivial. Unfortunately, I *don't* think this guy needs it as bad as he thinks he does! Ah well. ;)
I don't fell like testing it right now either :p lol.. will test it before I shut-down the PC
You need to enable the SE_SHUTDOWN_NAME privilige (assuming you are using Win NT/2000/XP).
Code:BOOL SetProcessPrivilege(LPCTSTR lpPrivilege) {
/* This function enables a privilege for the current process */
/* lpPrivilege can be either a privilege constant eg. SE_SHUTDOWN_NAME
* which is DEFINEd in the windows headers to the string
* "SeShutdownPrivilege" or the string can be used directly. */
TOKEN_PRIVILEGES tp;
HANDLE hToken;
LUID luid;
OSVERSIONINFO osvi;
/* Check that we are a Win NT system before proceeding */
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&osvi);
if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT)
{
PRINTF("Error: System is not NT based");
return FALSE;
}
/* Get the local id of our desired privilege */
if ( !LookupPrivilegeValue(
NULL, // lookup privilege on local system
lpPrivilege, // privilege to lookup
&luid ) ) // receives LUID of privilege
{
PRINTF("LookupPrivilegeValue error: %u\n", GetLastError() );
return FALSE;
}
/* Fill in TOKEN_PRIVILEGES structure */
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid; // the luid of the privilege to enable
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
/* Get the access token for the current process */
if ( !OpenProcessToken(
GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES,
&hToken ) )
{
PRINTF("OpenProcessToken error: %u\n", GetLastError() );
return FALSE;
}
/* Enable the privilege */
if ( !AdjustTokenPrivileges(
hToken, // access token
FALSE, // don't disable all privileges
&tp, // TOKEN_PRIVILEGES struct
sizeof(TOKEN_PRIVILEGES),
(PTOKEN_PRIVILEGES) NULL,
(PDWORD) NULL) )
{
PRINTF("AdjustTokenPrivileges error: %u\n", GetLastError() );
CloseHandle(hToken);
return FALSE;
}
/* Close the process access token */
CloseHandle(hToken);
return TRUE; //success
}
Code:SetProcessPrivilege(SE_SHUTDOWN_NAME);
InitiateSystemShutdown(
NULL, //LPTSTR lpMachineName,
"This is an automated shutdown.", //LPTSTR lpMessage,
120, //DWORD dwTimeout,
FALSE, //BOOL bForceAppsClosed,
FALSE //BOOL bRebootAfterShutdown,
);
I'm on windows ME