Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#70 closed Bug (Fixed)

AutoIt3Wrapper Attempts to Update 64bit Executables

Reported by: The Kandie Man Owned by: Jos
Milestone: Future Release Component: SciTE4AutoIt
Version: Other Severity:
Keywords: SciTE Reshacker UPX AutoIt3Wrapper Wrapper 64bit 64-bit x64 Cc:

Description

The AutoIt3 Wrapper is attempting to update 64bit executables. It fails because Reshacker cannot modify resources of 64bit executables. Though I didn't witness this error, UPX compression will also fail on 64bit executables. I know this because I tried to compress several 64 bit executables with the newest version of the console upx version 3.02w and it failed with the following error message:

=================================================================
upx:[FileNameTo64BitExe]: CantPackException: can't pack new-exe
=================================================================

To prove to myself that it wasn't the executables and upx.exe, I created a 64bit console application and then tried to pack that with upx. It gave the same error message as above.

When "Use X64 version of AutoIt3/Aut2Exe" is checked off, the AutoIt3WrapperGUI should disable the options to update the executable's resources. In addition, if conflicting directives are present, AutoIt3Wrapper.exe should not attempt to compile and it should throw a conflict in directives error message. Since UPX doesn't work on 64bit executables either, it too should also be disabled.

The reason why this bug is major is because, although the wrapper still creates a working 64bit executable script, the number of options that don't work correctly is extremely high. These options should therefore be disabled.

Since the wrapper errors out with Reshack it appears that other things don't occur. For example, I selected to update the language version of the executable. I also selected for it to compile as a 64bit executable and for it to be a "CUI in stead of a GUI EXE". Since the wrapper errors out at resource hacker, the "MakeCUI [EXENAME]" command line is never run. I also believe that the UPX command was also not run, but that is unimportant because it too would error out.

In addition, just cause we are at it Jos, you might want to change "CUI in stead of GUI EXE" to "CUI instead of GUI EXE". Grammatically more efficient. Just noticed it. ;-)

I spent over an hour writing up this error report (because I did various testing to see what was really wrong), so if I missed anything or left anything out, please let me know.

AutoIT3Wrapper_GUI.exe (ver 1.9.5.7)
AutoIT3Wrapper.exe (ver 1.9.5.6)
SciTE Version 1.75

Console Outputted the following text:

=================================================================
! Reshacker Error:
[26 Jan 2008, 21:31:38]

[FileNames]
Exe=[FullFilePathRemoved]\Console Test.exe
SaveAs=[FullFilePathRemoved]\Console Test.exe
Log=[FullFilePathRemoved]\Local Settings\Temp\ResHack.log

[Commands]
-addoverwrite "[FullFilePathRemoved]\Local Settings\Temp\temp.res", , ,

Added: VERSIONINFO,1,1033

-delete 16,1,2057
Error: No matching resource found.

! Resources will not be updated!+>21:31:38 Reshacker ended.rc:0
=================================================================

AutoIt version not included because I keep switching them around. From newest version 3.2.11.0-beta to older versions (to compile older scripts that are broken due to the updated includes). This is a wrapper bug though, so the version of AutoIt isn't that relevant.

  • The Kandie Man ;-)

Attachments (0)

Change History (8)

comment:1 follow-up: Changed 12 years ago by Jos

  • Owner changed from JdeB to Jos
  • Status changed from new to accepted

The reports is pretty complete. thanks :)

The only option I have at this moment is to skip the x64 resource update for all X64 since it looks like ResHacker doesn't support it. All the changes you mention are done with ResHacker except the CUI change which doesn't surprise me if that also doesn't work, but I have no means of testing that since I don't have an X64 box.
The current Beta has a build in methode to set the output application for /Console so as soon as thats available in the production version as well, i will change Autoit3Wrapper to use that instead of the MakeCUI program.
I have updated AutoIt3Wrapper to skip the Reshacker step and the MakeCUI step until a solution is figured out for that. I haven't made any changes yet to warn or disable the Reshacker Tabs when X64 is selected, first want to do some reseach if there is an alternative option for ResHacker.

The UPX is already intentionally skipped for X64 programs, like aut2exe does.

comment:2 Changed 12 years ago by Jos

Discussion started here: http://www.autoitscript.com/forum/index.php?showtopic=62776

To establish how we can solve this.

comment:3 in reply to: ↑ 1 Changed 12 years ago by The Kandie Man

Replying to Jos:

The reports is pretty complete. thanks :)

The only option I have at this moment is to skip the x64 resource update for all X64 since it looks like ResHacker doesn't support it. All the changes you mention are done with ResHacker except the CUI change which doesn't surprise me if that also doesn't work, but I have no means of testing that since I don't have an X64 box.
The current Beta has a build in methode to set the output application for /Console so as soon as thats available in the production version as well, i will change Autoit3Wrapper to use that instead of the MakeCUI program.
I have updated AutoIt3Wrapper to skip the Reshacker step and the MakeCUI step until a solution is figured out for that. I haven't made any changes yet to warn or disable the Reshacker Tabs when X64 is selected, first want to do some reseach if there is an alternative option for ResHacker.

The UPX is already intentionally skipped for X64 programs, like aut2exe does.

I tested MakeCUI. It works perfectly for 64bit executables as well. I am assuming the registers for making a console application are located in the same place for both 32bit and 64bit executables. If not, Picasso must have thought about this and, as a result, gave it the ability to modify both types of executables.

I have also been looking for a resource updater for 64bit executables. I will let you know what I find and if it works in the discussion forum.

  • The Kandie Man ;-)

comment:4 Changed 12 years ago by Valik

I think the location happens to be the same for 32-bit and 64-bit executables. However, Aut2Exe's built-in functionality correctly identifies the binary type and uses the correct offsets, just in case.

comment:5 follow-up: Changed 12 years ago by Jos

I will soon mark this BUG report as fixed since the Resource update for x64 is now skipped and a warning is given in the Console.
It doesn't looks like it is going to be a easy thing to solve at this moment.

Valik: AutoIt3Wrapper currently supports the following resource update options:

  • Update the RT_Version section standard and additional keywords.
  • Update the RT_ICON section adding extra ICO's that can be used in the script.
  • Update the RT_RCDATA to add the autoit3source or other files which can be retrieved with the set of UDF's created by ZEDNA.

I am currently able to update the RT_VERSION and RT_RCDATA strait from an AutoIt3script but still trying to figure out how to add an ico to the RT_ICON section.

comment:6 in reply to: ↑ 5 Changed 12 years ago by The Kandie Man

Replying to Jos:

I will soon mark this BUG report as fixed since the Resource update for x64 is now skipped and a warning is given in the Console.
It doesn't looks like it is going to be a easy thing to solve at this moment.

Valik: AutoIt3Wrapper currently supports the following resource update options:

  • Update the RT_Version section standard and additional keywords.
  • Update the RT_ICON section adding extra ICO's that can be used in the script.
  • Update the RT_RCDATA to add the autoit3source or other files which can be retrieved with the set of UDF's created by ZEDNA.

I am currently able to update the RT_VERSION and RT_RCDATA strait from an AutoIt3script but still trying to figure out how to add an ico to the RT_ICON section.

I wrote functions to modify the icon data. You can find them here:
http://www.autoitscript.com/forum/index.php?s=&showtopic=62776&view=findpost&p=471518

Let me know how it works for you. I tested it and for me it successfully modifies both 32bit and 64bit executable resources.

  • The Kandie Man ;-)

comment:7 Changed 12 years ago by Jos

  • Resolution set to fixed
  • Status changed from accepted to closed

Closing this ticket and will threat the X64 support as a feature request which I am close at implementing native Resourse updating in the next version of Autoit3Wrapper.

comment:8 Changed 12 years ago by TicketCleanup

  • Milestone set to Future Release
  • Version set to Other

Automatic ticket cleanup.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.