flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
sina 07 Aug 2004, 22:23
i need someone to port this code to fasm
i need a small exe to use in my php code to shutdown the windows xp machines whatever it takes (i mean force shutdown) i know this process, i am just asking for someone to convert this code to fasm becouse i really dont have time, but if noone helps then i am sure gonna make it one day becouse i need this very small open source exe file the code below it masm code, and there is also ann app in ; http://spiff.tripnet.se/~iczelion/files/Time%20ShutDown%20v1.0.zip that does the same what i want is when i run the program with no arguments like "shutdown.exe" it should shutdown without any msg dialogs or anything else if someone can do this before me i will be very happy trying to finish the php code part ps:it should be able to shutdown both win9x and winnt oses as below Windows Xp Shutdown This Should do what you need have a good day code:-------------------------------------------------------------------------------- .386 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib include \masm32\include\advapi32.inc includelib \masm32\lib\advapi32.lib .data szMessage db "Would you like to Shutdown Windows now?",0 szTitle db "Shutdown",0 szShut db "SeShutdownPrivilege",0 .data? ovi OSVERSIONINFO <> tkp TOKEN_PRIVILEGES <> hToken dd ? .code start: invoke MessageBox,NULL,ADDR szMessage,ADDR szTitle,MB_ICONINFORMATION+MB_YESNO .IF eax==IDYES mov ovi.dwOSVersionInfoSize, sizeof ovi invoke GetVersionEx,ADDR ovi .if ovi.dwPlatformId == VER_PLATFORM_WIN32_NT invoke GetCurrentProcess invoke OpenProcessToken,eax,TOKEN_ADJUST_PRIVILEGES+TOKEN _QUERY,ADDR hToken invoke LookupPrivilegeValue,NULL,ADDR szShut,addr tkp.Privileges[0].Luid mov tkp.PrivilegeCount,1 mov tkp.Privileges[0].Attributes,SE_PRIVILEGE_ENABLED invoke AdjustTokenPrivileges,hToken,FALSE, ADDR tkp, 0, NULL, 0 .endif invoke ExitWindowsEx,EWX_SHUTDOWN,NULL .if ovi.dwPlatformId == VER_PLATFORM_WIN32_NT mov tkp.Privileges[0].Attributes,0 invoke AdjustTokenPrivileges,hToken,FALSE,ADDR tkp,0,NULL,0 invoke CloseHandle,hToken .endif .ENDIF invoke ExitProcess,NULL ret end start |
|||
![]() |
|
vid 08 Aug 2004, 12:10
i thought shutdown can be forced just by invoking some (undocumented i think) procedure from some win's DLL. Can't remember name.
|
|||
![]() |
|
sina 08 Aug 2004, 12:25
in nt/xp/2003 without privilages?
|
|||
![]() |
|
f0dder 09 Aug 2004, 13:36
Vortex, that won't work under NT Based OSes - you need to enable the correct privilege (security token, whatever) first... like the code above.
|
|||
![]() |
|
Kevin_Zheng 11 Aug 2004, 00:57
Dear All:
I have writed a tool for shutdown windows. It can support win9x/winnt/win2k/win2003/winxp. Please see the below link: http://board.flatassembler.net/topic.php?t=1151 I have finished the new version for this tool kit to fit fasm 1.54, I will update the package to thisk suite after I have tested it completely. Best regards. Kevin Zheng |
|||
![]() |
|
HarryTuttle 16 Aug 2004, 08:49
Kevin,
will it close the window when you are loged only as a user not an admin? best regards, _________________ Microsoft: brings power of yesterday to computers of today. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.