Xtract SelfXTracting and VirtualLinker

Developed or developing a new product in PureBasic? Tell the world about it.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

My First Full in PureBasic coded Application named Xtract.
download Full Exe, sample and snippets from:
http://www.srings.com/downloads/xtract.zip

You can make a single File from yourt Application.



Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I've tested your app and it's really good ! So an exe can be packed with their data... Really nice.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.


New Version at http://www.srings.com/downloads/xtract.zip

now with Password-Protection , working Progressbar and a new 'SKIN'
thx all guys for the libs and codesnipets i used in this App.


Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

New Version at http://www.srings.com/downloads/xtract.zip

now with Password-Protection , working Progressbar and a new 'SKIN'
thx all guys for the libs and codesnipets i used in this App.

Siggi
Hey Siggi, cool app. Comes in very handy for the "big: version of the finder I wrote. Now some of the Blondes who test it (evil grin) have only one file to lose :):)

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.
Hey Siggi, cool app. Comes in very handy for the "big: version of the finder I wrote. Now some of the Blondes who test it (evil grin) have only one file to lose :):)
And you can protected it easily ,set the write-protected-flag and burn it on
CDROM.Never easier to use (and lost) for Blondes .While the app is in the Beta i told my wife to color her hair . :))


Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
And you can protected it easily ,set the write-protected-flag and burn it on
CDROM.Never easier to use (and lost) for Blondes .While the app is in the Beta i told my wife to color her hair . :))
Siggi
Hey, are you trying to get me to fall out of my chair?? Seriously, mine's brunette but...

P.s. Do you have any licensing arrangements for your vlinker? As I am planning to distribute one of my packages soon commercially (I may be dreaming but am trying)

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

Good Morning World,
P.s. Do you have any licensing arrangements for your vlinker? As I am planning to distribute one of my packages soon commercially (I may be dreaming but am trying)
sure fangles, this XTract(and vLink) is free.
My Plans for further verions:
The First thing to do is copy ICONS from the starting exe to the vlink.exe.
The second is do a better Installer-Frontend.
Third is test more with the PE-Header and sections (with indeep ASM) and create
more protected (System-bounded,Password-protected)Apps.
It's not so difficult as it seems.



Siggi
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

i know this is an old post..
But i have been working on creating such app. I maked the unpacker and i made the packer and i could bundle things in 1 exe file, but one thing i newer got was copying the icon from the main exe. How extract the icon (i can figure this out myself..) and how to put an icon in an exe (i cant figure out..)
If anyone knows how to do that, i would be very happy :P


EDIT: also this is not to be in the announcement section.. please move it if you are not happy with it here.. Just found out after writing.. :D
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi thefool, if im not wrong, on purearea code-archive exist some codes to extract a icon from an exe, about put an icon to an exe, you must use api for this, i think that someone post a vb code to made this, i will try to translate after lunch, it could be good also for ScriptVM.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Thanks. yes it would definently also be good for scriptVM!
User avatar
Mischa
Enthusiast
Enthusiast
Posts: 115
Joined: Fri Aug 15, 2003 7:43 pm

Post by Mischa »

Hi!

You don't have to use API for changing executables icon.

All you have to do, is to create exe with icon (256 color).
After this use a HexEditor to find startaddress of icon in exe.
(Warning: The address could change if you modify your code and recreate exe)

Hm. I think its easier if you use this little snippet: :wink:

Code: Select all

;Change icon in executable
;The executable must contain a 256 colored icon
;Mischa

Runtime.s="yourprogram.exe"
icon.s="newicon.ico"

If ReadFile(0,Runtime)
  size=FileSize(Runtime)
  *exe=AllocateMemory(size)
  ReadData(*exe,size)
  CloseFile(0)
  Repeat
    long1=PeekL(*exe+seeker)
    If long1=40
      long2=PeekL(*exe+seeker+4)
      If long2=32
        iconstart=seeker
      EndIf
    EndIf
    seeker+1
  Until found Or seeker=size
  iconsize=FileSize(icon)-22
  *ico=AllocateMemory(iconsize)
  ReadFile(1, icon)
  FileSeek(22)
  ReadData(*ico,iconsize)
  CloseFile(1)
  CopyMemory(*ico,*exe+iconstart,iconsize)
  CreateFile(0,Runtime)
  WriteData(*exe,size)
  CloseFile(0)
EndIf
Regards,
Mischa
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Thanks very much. Will test it later! :D
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Interesting code, but it could be better, and more correct to use api functions to modify executable resources, that its where the icon is located, i dont want to include on ScriptVM an icon, it increase at least 2kb the runtime, using api for resources, you can add a icon to a executable without a previously icon, but it seems a little more complicated than your code, i will inform if i get some code to modify resources...
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

You could make 2 runtimes. 1 without icon and 1 with icon. Then make the user decide- If user selects that he wants an icon, then change the original icon of executable with the one he chooses. If he dosent select that he wants an icon, use the runtime without.

This gives a little more size in your download, but it gives the user flexibillity, that he might need!
User avatar
Mischa
Enthusiast
Enthusiast
Posts: 115
Joined: Fri Aug 15, 2003 7:43 pm

Post by Mischa »

If you want do it the API way you will need Win NT, 2K, or XP to
update resources, i think.

Or you have to use 'ResourceHacker' (with scripts) to do these things
under Win 95, 98, or Me.

And then you have to add ResourceHacker to your files..

But you are right , when you say that my way is not much professional. :wink:

Be warned: My routine gives no guaranty. If the seeking routine find
an identically byte-sequence at another place in exe, it will crash..
You have to check functionallity always when you modify executable!

But there should be no problem, if you link something BEHIND the exe,
like your SFXr does.

Regards,
Mischa
Post Reply