Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Packing EXE code by UPX

Author
Message
deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 11th Apr 2003 13:00 Edited at: 19th May 2003 15:14
It is possible to pack compiled EXE files by code compressor
such as UPX http://upx.sourceforge.net
Code, compiled by DarkBasic has a structure:
{normal PE executable}
{attached data}
{pointer to attached data start address (4byte dword)}


After compression by UPX the code structure is the same,
but {attached data} now starts from new address,
so pointer value is wrong and program crashes.
All we have to do is to write new pointer value after packing.
And now the compressed EXE program works.
The example make this fix for DarkBasic EXEs.



Squid
21
Years of Service
User Offline
Joined: 27th Mar 2003
Location:
Posted: 17th May 2003 03:07
I had been thinking about using UPX but didn't know it had a pointer issue with DArkBasic. Is the Snippet for Q Basic or DarkBasic. I don't have Q Basic.
Does it work with DarkBasic Pro and DarkBasic exes?
Lastly do I need a certain version of UPX or will any work?

Thanks

deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 19th May 2003 15:06 Edited at: 19th May 2003 15:13
This snippet is written on QBasic.
QBasic is a free DOS BASIC interpreter
(limited free "interpreter only" version of Quick Basic 4.5)
by Microsoft. There are many links in web about QBasic or where
to find, please search in
http://www.google.com
"qbasic" or "qbasic download".
This snippet is intended for packing DarkBasic classic EXE files.
Only EXE code is packed, not attached data,
so this method is not good for packing programs with much data
attached. The main purpose of this snippet is to pack EXE code
created by "MAKE EXE". For data packing I use another method.
This program was tested with UPX 1.24 but older versions must
also work fine

Kale
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 19th May 2003 15:23
DBPro + UPX =

I never had any luck compressing DBPro exe's with UPX, they always throw errors.

What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 16th Jun 2003 15:19
Now you can download compiled program with source from
http://atd-group.narod.ru/eng/coding.htm
There are some other useful tools here

Login to post a reply

Server time is: 2024-11-24 02:44:41
Your offset time is: 2024-11-24 02:44:41