Jump to content

How to convert this nice software to Autoit


Recommended Posts

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

maybe just run 'wpeutil shutdown'

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

Link to comment
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

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

Link to comment
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

Hi iamtheky :P

I know this already. I want to activate the Windows 7 Shutdown button. I want to activate the shutdown button with API hook. http://en.wikipedia.org/wiki/Hooking

Best regards :x

Link to comment
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.

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

Link to comment
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')
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...