Page 1 of 2
Posted: Mon Aug 19, 2002 11:05 am
by BackupUser
Restored from previous forum. Originally posted by Justin.
Is there any disadvantage in compressing a pb exe?, are they slower, consume more resources or something?
Posted: Mon Aug 19, 2002 11:16 am
by BackupUser
Restored from previous forum. Originally posted by traumatic.
once uncompressed (unpacking takes time of course), you won't find any difference.
some packers however, come with a small memory-overhead for unpacking.
according to the upx-website, upx doesn't suffer from that:
UPX is a free, portable, extendable, high-performance executable packer for several different executable formats.
It achieves an excellent compression ratio and offers very fast decompression. Your executables suffer no memory overhead or other drawbacks.
upx is the best exe-packer IMHO anyway.
more info:
http://upx.sourceforge.net
Posted: Mon Aug 19, 2002 11:57 am
by BackupUser
Restored from previous forum. Originally posted by PB.
> Is there any disadvantage in compressing a pb exe?, are they slower, consume
> more resources or something?
No real disadvantages. It's good for two main reasons:
(1) Makes the exe's fit on a floppy if they're fairly large.
(2) Hides some data due to the compression.
Use UPX, as Traumatic said. No disadvantages whatsoever with regards to memory
with that cool little app.
PB - Registered PureBasic Coder
Posted: Mon Aug 19, 2002 12:29 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
And with recent processor, the unpacking speed is much faster than the HardDisk data transfer rate. So with enough big exec, it will be benefit to compress it. Probably next windows version will say 'new technogie, faster excutable load, and less disk space consumption '. For example, unpacking algo can do upto 20 Mb/sec on a Duron 700 when an hd is 10 Mb/s at full speed (no fragmentation etc..). The different grows when the processor is more powerful. Imagine the rate you can get with a Pentium IV @ 3 Ghz...
Fred - AlphaSND
Posted: Mon Aug 19, 2002 1:20 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
Ok, thanks. I don't care if unpacking takes a little time if after that the exe behaves the same as uncompressed.
I use compression on some of my pb exes because it's an easy way to hide data.
Btw, i use PECompact wich it's written in ASM and works really well.
Posted: Mon Aug 19, 2002 2:20 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> I don't care if unpacking takes a little time if after that the exe behaves the
> same as uncompressed.
The unpacking time is nothing, so don't be concerned. If you don't say anything,
your users won't even know that the exe is compressed.
> I use compression on some of my pb exes because it's an easy way to hide data.
Don't forget that any compressed exe can be uncompressed again, so don't rely on
that for total protection of data.
PB - Registered PureBasic Coder
Posted: Mon Aug 19, 2002 6:46 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Justin wrote
Btw, i use PECompact wich it's written in ASM and works really well.
Hi Justin
There are a lot of packers (Exe-Packers, packing all datas of a file) and PE-Packers like PECompact arround. Be care using any PE packer/editor/compressor i.e. - mostly this PE tools will modiy the win PE-File-Header and shrunk the sections in a file... Very often the modified PE-Headers are terrible/hacked coded and so it could be possbile that your Exe-Program run on your machine (for example on Win98) but on Win2000 or WinXP it does not work longer...
Btw many PE-Tools are not only real optimizing tools... many of this tools will add a virus/trojaner i.e. to your File or System! So be really care with that software!
So the best is, to let the PE-Headers as they are and you should have no problems with new Windows-Versions to start/execute your programs if Mircosoft will change there anything in future versions!?
Just use Exe-Packers like UPX (win32 progs), APack (DosProgs) or any other ExePackers... This tools are really packing (algorhytm) all filedatas to a own datafile and link a PE-Header with a included decuncher to your Exe... So you can gain often up to 50% of the original filesize...
Good Luck!
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Posted: Tue Aug 20, 2002 3:05 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.
If that is true i won't use PECompact any more, but i don't think it leaves any virus, it's a commercial program.
I just wanted to hide some data(the strings), is there any easy way apart of using the ascii values?
Posted: Tue Aug 20, 2002 6:32 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> I just wanted to hide some data(the strings), is there any easy way
> apart of using the ascii values?
What's wrong with using the ASCII values? This method works perfectly.
PB - Registered PureBasic Coder
Posted: Tue Aug 20, 2002 6:33 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Hi Justin
I didnt sayed that PECompact will add a virus or so... Maybe it will, if you use a illegal copy or any other PETools... Btw which strings do you want to change/remove/hide in your exe???? YOu mean your program texts (messages and so on)? Just forgot all about PETools and use UPX Packer!

Good Luck!
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Posted: Tue Aug 20, 2002 6:41 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> which strings do you want to change/remove/hide in your exe????
> Just forgot all about PETools and use UPX Packer!

Good Luck!
But anyone can unpack an exe that was compressed with UPX to read
the strings. That's why using the ASCII codes is better, because
they don't show the string in the exe at all, even when uncompressed.
PB - Registered PureBasic Coder
Posted: Tue Aug 20, 2002 7:43 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
PB wrote
But anyone can unpack an exe that was compressed with UPX to read
the strings. That's why using the ASCII codes is better, because
they don't show the string in the exe at all, even when uncompressed.
Hi PB
Yes, sure you can find nearly everytime a way to unpack stuff... A very easy way would be to convert the stings to $Hex for any char and calulate this val to decode the string... When starting you have only to recode your String and you will have the original string...
Code: Select all
[u]For Example[/u]
Here the original string:
mytext.s = "Basic" (in Hex = $42,$61,$73,$69,$63
Now we know the Hex Vals for each sign and use a very simple way to crypt the string and add +2 to any HexVal.. Now our crypted sting looks in Hex like following example:
crypted in Hex = $44,$63,$75,$71,$65 = "Dcuke"
Would you know when take a look to your exe, that "Dcuke" is crypted and stand for "Basic" if you would decrypt it?

Its a very small lamer protection but still works for most case... Sure, a profi or guy who know your crypting methode can change the text everytime if he want... But for the first its ok i think... Good Luck!
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Posted: Tue Aug 20, 2002 8:16 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> Would you know when take a look to your exe, that "Dcuke" is crypted
> and stand for "Basic" if you would decrypt it?
No, I wouldn't know that it stood for "Basic"...
BUT:
(1) I
could see this string in the exe with a hex editor.
(2) I
would then know it's a 5-letter string.
(3) I
would have time to try to decrypt it if I wanted.
Using
Chr(x)+Chr(y)+Chr(z) to encrypt a string is better because
you can't find it in the exe using a hex editor. And if you can't
find it, then you don't know its length, and also don't even know it's
there to bother trying to decrypt.
PB - Registered PureBasic Coder
Posted: Sun Apr 27, 2003 1:47 pm
by PB
> Using <b>Chr(x)+Chr(y)+Chr(z)</b> to encrypt a string is better
> because you can't find it in the exe using a hex editor.
Hmm, I remember Fred saying this doesn't work anymore and he posted
an alternative, but this didn't seem to survive the transfer from the old
forums to these new ones. Fred (or anyone else who remembers), can
you please re-post the new method that works with v3.62? Thanks.
Posted: Sun Apr 27, 2003 2:01 pm
by Fred
Just use a variable instead of numerical constant, then the compiler willn't optimize it: