Jump to content
Sign in to follow this  
Shores

upx compression options and wine

Recommended Posts

Shores

Hi to all!

I was just testing an install script I made for an app of mine on WINE, and while it does indeed run, it does only if I don't compress with UPX the compiled script. Since UPX has full support for Linux, i supposed I was doing something wrong. I've then searched for a while and discovered here ( http://linux.die.net/man/1/upx ) this indication:

--compress-exports=0 Don't compress the export section.

Use this if you plan to run the compressed

program under Wine.

Is there any way i could pass this option to Aut2Exe so that the upx compressed file would run under WINE?

Thanks to anybody who shares any ideas!

Share this post


Link to post
Share on other sites
Draygoes

Its astrounding that you have managed to get any autoit script byond a basic MsgBox to run under wine. That being said, I am not exactly what you would call a linux expert, and will gladly eat my words if I am wrong...

Before we do anything else, please test your script to see if it will run in wine uncompressed. That is to say, run a compiled script under wine that has NOT been compressed with UPX and let us know if it works.

If it runs: Please let us know and we will try to get your option to work.

If it does not run: Please post back here with the source code to the project that you are trying to get to run, and we can try to modify it to work under wine.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
Mobius

--compress-exports=0 Don't compress the export section.

Use this if you plan to run the compressed

program under Wine.

Is there any way i could pass this option to Aut2Exe so that the upx compressed file would run under WINE?

Why not tell Aut2Exe to not compress with upx either via its gui menu or via its commandline switch.

Once built you can use Upx directly via its own commandline on your binary.

for example:: *standard*

UPX --best --compress-exports=0 YourBinary.exe -o YourBinary_.exe

or:: *Crazy 72 pass uber compression attempt*

UPX --ultra-brute --force --compress-exports=0 YourBinary.exe -o YourBinary_.exe

I believe I read somewhere that all this could be done with AutoItWrapper directives also.

I also am surprised that your script will execute with any degree of stability or functionality.

Linux (pick one) comes with all manner of excellent languages and in general is designed to

be as code friendly as possible, why anyone needs AutoIt in this environment is beyond me...

Vlad

Edited by Mobius

Share this post


Link to post
Share on other sites
UEZ

Hi to all!

I was just testing an install script I made for an app of mine on WINE, and while it does indeed run, it does only if I don't compress with UPX the compiled script. Since UPX has full support for Linux, i supposed I was doing something wrong. I've then searched for a while and discovered here ( http://linux.die.net/man/1/upx ) this indication:

--compress-exports=0 Don't compress the export section.

Use this if you plan to run the compressed

program under Wine.

Is there any way i could pass this option to Aut2Exe so that the upx compressed file would run under WINE?

Thanks to anybody who shares any ideas!

Enter this to the top of your script:

#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Run_After=upx.exe --best --compress-exports=0 "%out%"

You need the full install version of SciTE which has AutoIt3Wrapper included!

I hope this helps!

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Shores

Enter this to the top of your script:

#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Run_After=upx.exe --best --compress-exports=0 "%out%"

You need the full install version of SciTE which has AutoIt3Wrapper included!

I hope this helps!

UEZ

To all: I've already tried disabling the UPX compression and then MY SCRIPT WORKS OK! What I was searching for was something like what UEZ is proposing, a way to tell Aut2Exe to use special parameters to UPX pack the resulting exe. I'll try these in a moment and report back.

By the way, AutoIt seems to be working perfectly in WINE, why it should not? It isn't a kernel mode thing, and it should be using normal Win32 API which WINE is supposed to be "emulating"...

Share this post


Link to post
Share on other sites
Draygoes

But wine does not emulate it very well. Its kindof unstable if you get the idea...

Beh, anyway... First try running the command manually.

I mean to say, tell the compiler not to pack your script, then pack the compiled .exe manually yourself using whatever method you think should work.

P.S.

I have tried compiled autoit scripts packed with "normal" compression under wine and they seem to work fine.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites
Shores

But wine does not emulate it very well. Its kindof unstable if you get the idea...

Beh, anyway... First try running the command manually.

I mean to say, tell the compiler not to pack your script, then pack the compiled .exe manually yourself using whatever method you think should work.

P.S.

I have tried compiled autoit scripts packed with "normal" compression under wine and they seem to work fine.

I've tried many apps in WINE and they were ok, but maybe I'm just lucky!

To be perfectly clear, I've already tried running a script compiled WITHOUT upx packing, and it works perfectly, whatever the compression level set in aut2exe.

Problems only appear when the exe is packed with UPX, and they remain when using the method provided by UEZ to change the parameters used by UPX when packing the exe.

So, I think I'll simply turn off the UPX packing to achieve WINE compatibility.

Share this post


Link to post
Share on other sites
UEZ

I've tried many apps in WINE and they were ok, but maybe I'm just lucky!

To be perfectly clear, I've already tried running a script compiled WITHOUT upx packing, and it works perfectly, whatever the compression level set in aut2exe.

Problems only appear when the exe is packed with UPX, and they remain when using the method provided by UEZ to change the parameters used by UPX when packing the exe.

So, I think I'll simply turn off the UPX packing to achieve WINE compatibility.

Try upx --help for a full list of available parameters!

I don't have Linux installed, thus I cannot test it which parameter will work using Wine but have a closer look to these parameters:

Options for win32/pe, rtm32/pe & arm/pe:

--compress-exports=0 do not compress the export section

--compress-exports=1 compress the export section [default]

--compress-icons=0 do not compress any icons

--compress-icons=1 compress all but the first icon

--compress-icons=2 compress all but the first icon directory [default]

--compress-icons=3 compress all icons

--compress-resources=0 do not compress any resources at all

--keep-resource=list do not compress resources specified by list

--strip-relocs=0 do not strip relocations

--strip-relocs=1 strip relocations [default]

You can add it using the wrapper (here just an example):

#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Run_After=upx.exe --best --compress-exports=0 --compress-resources=0 "%out%"

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

×