Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386 ;processor type
- .model flat,stdcall ;make a win32 exe
- option casemap:none ;case insensitive
- include windows.inc ;#################################################################
- includelib user32.lib ;#################################################################
- include user32.inc ;#################################################################
- include kernel32.inc ;##Includes to be able to use messagboxes and to shutdown system##
- includelib kernel32.lib ;#################################################################
- include ntdll.inc ;#################################################################
- includelib ntdll.lib ;#################################################################
- .data
- prompt db "Do you want to shutdown the computer?",0
- win_title db "Shutdown?",0
- .code
- start:
- invoke MessageBox,NULL, addr prompt, addr win_title,MB_YESNO+MB_ICONQUESTION ;messagebox prompting user to shutdown or not
- .if eax==IDYES ;do next line(s) of code if user clicks yes
- ;--------------------------------------SHUTDOWN CODE----------------------------------------------------------------------
- push esp ;Do I really need this?
- invoke RtlAdjustPrivilege,19,2,0,esp ;Set shutdown previlages
- invoke ExitWindowsEx,EWX_SHUTDOWN,NULL ;Actual Shutdown code
- jmp @exit ;jump to exit code
- ;--------------------------------------SHUTDOWN CODE ENDS-----------------------------------------------------------------
- .elseif eax==IDNO ;Do next line(s) of code if user clicks no
- jmp @exit ;jump to exit code
- .endif ;ends the if statement
- @exit: ;exit code label
- invoke ExitProcess,NULL ;exit code
- end start ;end of program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement