|
semiono
BBWise
Joined: Sun May 18, 2008 2:13 pm Posts: 62
|
 NtShutdownSystem for xoblite bb3
this is hardcore reboot tools! you need fasmw to build it... flat assembler 1.6x for WindowsPowered by tester3000 from http://board.flatassembler.net/Code: include '%fasm%\win32ax.inc' ; correct it before to compile! %PATH% etc... entry start
section '.rsrc' resource data readable directory RT_ICON,icons,RT_GROUP_ICON,group_icons,RT_VERSION,versions
resource icons,\ 1,LANG_NEUTRAL,icon_data1,\ 2,LANG_NEUTRAL,icon_data2,\ 3,LANG_NEUTRAL,icon_data3,\ 4,LANG_NEUTRAL,icon_data4 resource group_icons,17,LANG_NEUTRAL,main_icon resource versions,1,LANG_NEUTRAL,version
icon main_icon,\ ; correct it with an icon files icon_data1,'%icons%\16x16.ico',\ icon_data2,'%icons%\32x32.ico',\ icon_data3,'%icons%\48x48.ico',\ icon_data4,'%icons%\64x64.ico'
versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\ 'FileDescription','NtReboot...',\ 'LegalCopyright','2001-2005 GmbH',\ 'FileVersion','1.0.0.0',\ 'ProductVersion','1.0.0.0',\ 'OriginalFilename','NtReboot.exe',\ 'Company','Semiono'
section '.idata' import data readable writeable library advapi32,'ADVAPI32.DLL',kernel32,'KERNEL32.DLL',user32,'USER32.DLL' include '%fasm%\api\kernel32.inc' include '%fasm%\api\advapi32.inc' include '%fasm%\api\user32.inc'
section '.data' data readable writeable executable
TOKEN_ADJUST_PRIVILEGES = 20h TOKEN_QUERY = 8h SE_PRIVILEGE_ENABLED = 2h
struct LUID lowPart dd ? HighPart dd ? ends struct LUID_AND_ATTRIBUTES pLuid LUID Attributes dd ? ends struct _TOKEN_PRIVILEGES PrivilegeCount dd ? Privileges LUID_AND_ATTRIBUTES ends TTokenHd dd ? udtLUID LUID tkp _TOKEN_PRIVILEGES SE_SHUTDOWN_NAME db 'SeShutdownPrivilege',0 pModule db 'ntdll.dll',0 lpProcName db 'NtShutdownSystem',0
start: invoke Sleep,5000 invoke Beep
invoke GetCurrentProcess invoke OpenProcessToken,eax,TOKEN_ADJUST_PRIVILEGES+TOKEN_QUERY,TTokenHd or eax,eax jz exit invoke LookupPrivilegeValue, NULL, SE_SHUTDOWN_NAME, udtLUID or eax,eax jz exit
mov [tkp.PrivilegeCount],1 mov [tkp.Privileges.Attributes],SE_PRIVILEGE_ENABLED mov eax,[udtLUID.lowPart] mov [tkp.Privileges.pLuid.lowPart],eax mov eax,[udtLUID.HighPart] mov [tkp.Privileges.pLuid.HighPart],eax invoke AdjustTokenPrivileges,[TTokenHd],0,tkp,0,0,0
invoke GetModuleHandle,pModule invoke GetProcAddress,eax,lpProcName
push 1 ; push 0 for shutdown ;-) call eax
exit: invoke ExitProcess,0
menu.rc: Code: [exec] (start) {NtReboot.exe} [exec] (halt...) {NtShutdown.exe}  no need (-quiet)  and more better than invoke ExitWindowsEx binary: http://slil.ru/27869144http://slil.ru/27869148other smile tools: (scripts depending of shutdown.exe) mostly for cmd.exe to use http://slil.ru/27869154http://slil.ru/27869173http://slil.ru/27869165http://slil.ru/27869166http://slil.ru/27869168lame code based Code: include '%fasm%\win32ax.inc' entry start
section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',shell32,'SHELL32.DLL' include '%fasm%\api\kernel32.inc' include '%fasm%\api\shell32.inc'
lpFile db 'shutdown.exe',0 ;-) lpParameters db '-s -f -t 00',0
start: invoke ShellExecute,NULL,NULL,lpFile,lpParameters,NULL,SW_HIDE exit: invoke ExitProcess,0
_________________ rundll32.dll
|