View unanswered posts | View active topics It is currently Tue May 21, 2013 11:15 am



Post new topic Reply to topic  [ 1 post ] 
 NtShutdownSystem for xoblite bb3 
Author Message
BBWise

Joined: Sun May 18, 2008 2:13 pm
Posts: 62
Reply with quote
Post NtShutdownSystem for xoblite bb3
this is hardcore reboot tools!
you need fasmw to build it...
flat assembler 1.6x for Windows

Powered 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}

:D

no need (-quiet) ;-)
and more better than invoke ExitWindowsEx

binary:
http://slil.ru/27869144
http://slil.ru/27869148

other smile tools: (scripts depending of shutdown.exe) :D
mostly for cmd.exe to use
http://slil.ru/27869154
http://slil.ru/27869173
http://slil.ru/27869165
http://slil.ru/27869166
http://slil.ru/27869168
lame 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


Wed Jul 29, 2009 9:15 pm
Report this post
Profile
Sponsored Links
Google Adsense


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.