Sign in to follow this  
Followers 0
maxrealqnx

How to convert this nice software to Autoit

12 posts in this topic

Hi my friends :x

As you know, Delphi only supports 32-bit. So I love Autoit because it is supports 64-bit. How can we convert this codes to Autoit. I thank you in advance for your answers.

Best regards :P

program ReBootTrace;


uses
Windows, madCodeHook;


begin
InjectLibrary(ALL_SESSIONS or SYSTEM_PROCESSES,'ReBoot.dll');
end.

library ReBoot;


uses
Windows,
madCodeHook,
madRemote;


var
ExitWindowsExNext : function(uFlags: UINT; dwReserved: DWORD): BOOL; stdcall;


const
SHUTDOWN_FORCE = EWX_SHUTDOWN or EWX_FORCE;
POWEROFF_FORCE = EWX_POWEROFF or EWX_FORCE;


function ExitWindowsExCallback(uFlags: UINT; dwReserved: DWORD): BOOL; stdcall;
begin
case uFlags of
EWX_POWEROFF,EWX_SHUTDOWN, SHUTDOWN_FORCE, POWEROFF_FORCE, EWX_POWEROFF or EWX_SHUTDOWN :
WinExec('wpeutil.exe shutdown',SW_HIDE);
else WinExec('wpeutil.exe reboot',SW_HIDE);
end;
result:=ExitWindowsExNext(uFlags,dwReserved);
end;


Procedure DLLMain(Code: integer);


begin
case Code of
DLL_PROCESS_ATTACH:
begin
CollectHooks();
HookAPI('User32.dll', 'ExitWindowsEx', @ExitWindowsExCallback, @ExitWindowsExNext);
FlushHooks();
end;
end;
end;


begin
DLLProc := @DLLMain;
DLLMain(DLL_PROCESS_ATTACH);
end.

Share this post


Link to post
Share on other sites



You posted something with value of nothing. Unfortunately you don't see that.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You posted something with value of nothing. Unfortunately you don't see that.

Hi trancexx :P

I'm script developer on the boot-land.net. This program is very important for us. Because Shut down button isn't working on the Win7PE. This program allows to fulfill this Windows 7 Shut down button function. But there isn't a 64-bit versions of this program. Because Delphi does not support the 64-bit.

http://img59.imageshack.us/img59/9061/windowsvistape201012112.jpg

http://maxrealqnx.winbuilder.net/Temp/RebootTrace.7z

Best regards :x

Edited by maxrealqnx

Share this post


Link to post
Share on other sites

maybe just run 'wpeutil shutdown'


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Maybe the Shutdown() function is good enough?

Hi KaFu :P

Yes, you told correct but how will we make Windows 7 accept this code ? Best regards :x

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

JFX please help me because I can not explain my problem :x

http://www.911cd.net/forums//index.php?showtopic=23931&st=180&start=180

Edited by maxrealqnx

Share this post


Link to post
Share on other sites

im just guessing but without the 64bit stuff that one command would shutdown from the PE environment.

#AutoIt3Wrapper_UseX64=Y

run ('wpeutil shutdown')

Exit

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Yeah just saw the link, didnt realize this was a hella customized version. At least the question is getting more specific.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Yeah just saw the link, didnt realize this was a hella customized version. At least the question is getting more specific.

Hi iamtheky :x

Can we do a similar program with AutoIt ?

Share this post


Link to post
Share on other sites

JFX please help me because I can not explain my problem :x

Well, your using a custom WinPE 3.0 x64 with the default explorer shell from windows.

Shutdown button doesn't work. Also watching for WM_ENDSESSION doesn't work.

You can use wpeutil from cmd prompt or even make a shutdown shortcut on desktop, but you don't like this.(?)

AEK from rutracker forum has make the nice tools reboot.dll and reboottrace.exe.

The exe inject the dll in all open process, which wait's for ExitWindowsEx and does run the wpeutil command for you.

Your sad as nobody makes x64 version?

My suggestion:

hide the shutdown button and claim that it never exist in the first place.

ControlHide('[CLASS:DV2ControlHost]', '', 'Button2')

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0