1. ICON Solutions!

Hi all,

I am still new at Euphoria so just stop reading if this doesn't make sense
but, would it not be possible for someone with some C knowledge to build a
"Icon Hacker" of sorts for Euphoria programs... So that after you bind your
program..then you start-up the "Icon Hacker" and select the exe file to
hack and the icon to add...and it does it...So that you can have the same
icon on the exe that shows up in the left top corner of your app.

The reason I ask is that I have worked with "Macromedia Director" and
programmed several games and other things with it. In Director you do all
your code and such and then create a "Projector" file..this file is a
compiled exe file..with everything contained inside it (bmps, code, gifs,
etc..) and the exe file in the end has the icon that Macromedia has
specified (it looks like a projector). But you can then get 3rd party
programs that will open the projector's icon and then let you change that icon.

So in theory it sounds like someone should be able to do something similar
for Euphoria exe files.

Let me know what you think...(but don't flame me, thanks  smile


-Jeremy

new topic     » topic index » view message » categorize

2. Re: ICON Solutions!

>So in theory it sounds like someone should be able to do something similar
>for Euphoria exe files.
>
>-Jeremy

If RDS could put several default icons in different formats into the exw.exe
file then you could overwrite these icons with your own ones using the
program "Axialis AX-Icons 4.5". It allows you to overwrite icons in an exe
file as long as they are the same size and color depth as the one that you
want to overwrite it with.

-Mark.

new topic     » goto parent     » topic index » view message » categorize

3. Re: ICON Solutions!

Brilliant Idea !!! Short answer to your question is.
There has to be an ICON to edit/overwrite.

Ex.exe and exw.exe do not have an ICON in them.  They
Icon you see is the default ICON for plain Jane Executable
programs.

        Lucius L. Hilley III
        lhilley at cdc.net   lucius at ComputerCafeUSA.com
+----------+--------------+--------------+----------+
| Hollow   | ICQ: 9638898 | AIM: LLHIII  | Computer |
|  Horse   +--------------+--------------+  Cafe'   |
| Software | http://www.cdc.net/~lhilley |  USA     |
+----------+-------+---------------------+----------+
                   | http://www.ComputerCafeUSA.com |
                   +--------------------------------+
----- Original Message -----
From: Jeremy Foster <jeremy at CANADIANLEAF.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, November 08, 1999 1:55 PM
Subject: ICON Solutions!


> ---------------------- Information from the mail
header -----------------------
> Sender:       Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU>
> Poster:       Jeremy Foster <jeremy at CANADIANLEAF.COM>
> Subject:      ICON Solutions!
> --------------------------------------------------------------------------
-----
>
> Hi all,
>
> I am still new at Euphoria so just stop reading if this doesn't make sense
> but, would it not be possible for someone with some C knowledge to build a
> "Icon Hacker" of sorts for Euphoria programs... So that after you bind
your
> program..then you start-up the "Icon Hacker" and select the exe file to
> hack and the icon to add...and it does it...So that you can have the same
> icon on the exe that shows up in the left top corner of your app.
>
> The reason I ask is that I have worked with "Macromedia Director" and
> programmed several games and other things with it. In Director you do all
> your code and such and then create a "Projector" file..this file is a
> compiled exe file..with everything contained inside it (bmps, code, gifs,
> etc..) and the exe file in the end has the icon that Macromedia has
> specified (it looks like a projector). But you can then get 3rd party
> programs that will open the projector's icon and then let you change that
icon.
>
> So in theory it sounds like someone should be able to do something similar
> for Euphoria exe files.
>
> Let me know what you think...(but don't flame me, thanks  smile
>
>
> -Jeremy
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: ICON Solutions!

RE: Icons

With one program I am distributing, I used Icon Maker 1.0 to make the icons
and save them to a separate file (author is wotan500 at aol.com--don't know
where I got it from but it should be easy to find).

Then I put that icon file in my program directory (and distribute it with
the other parts of the program).

Then at run time I use the code appended below (borrowed and modified from
win32lib) to set both the small and large icons for the program to use that
icon file.

Then I distribute the program with an install program that allows you to
setup a shortcut to the program in the Start menu and/or on the
desktop.  You can specify the icon file to use for these icons and of
course I specify the same icon file I use at runtime.  (I use Inno Setup
1.11, which is freeware.  See http://www.jordanr.dhs.org/
-or- http://www.digicron.com/jordanr/. Downside is it adds maybe 400K to
the size of your compressed file.)

The end result is, I have a nice-looking icon in the upper-left corner of
my app., on the taskbar, and alt-tab-bar.  The same icon appears on the
desktop shortcut and in the start menu shortcut.  The only place it DOESN'T
appear is on the Windows Explorer listing when you look at the directory
containing the actual program.

So--this is somewhat roundabout, but in the end it does do about 98% of
what you expect the program's icon to do.  If you setup a program in the
start menu/desktop, 99.999% of users will rarely or never look at the
program with Windows Explorer anyway.

I will say that having that install program and customized icon really does
put the finishing touch on your program.  It makes it look like a real,
professional programming job instead of something some nitwit hacked
together in the middle of the night (and in my case, that's more than
likely exactly how it happened, but I do try to cover it up as much as
possible . . . ).

--Brent



---------------this code sets both Large & small icons to the same
file----------


global procedure setWinIcon ( atom winId, sequence filename)

         integer handle, ok,at

         at = allocate_string( filename )
         handle = c_func(xExtractIcon, {getHandle(winId), at, 0})
         ok = sendMessage(winId, WM_SETICON, 1, handle) --large icon
         ok = sendMessage(winId, WM_SETICON, 0, handle) --small icon
         -- free the string
         free(at)

end procedure
setWinIcon( EarTest, "EarTest.ico" )



++++++++++++++++++++ Brent Hugh / bhugh at cstp.umkc.edu ++++++++++++++++++++
+        University of Missouri-Kansas City, Conservatory of Music       +
+  Sheet Music/Recordings: http://www.sunflower.org/~bhugh/pathetic.spm  +
+ Internet Piano Concert:  http://cctr.umkc.edu/userx/bhugh/recital.html +
++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++

new topic     » goto parent     » topic index » view message » categorize

5. Re: ICON Solutions!

On Mon, 8 Nov 1999 14:55:22 -0400, Jeremy Foster <jeremy at CANADIANLEAF.COM>
wrote:

>Hi all,
>
>I am still new at Euphoria so just stop reading if this doesn't make sense
>but, would it not be possible for someone with some C knowledge to build a
>"Icon Hacker" of sorts for Euphoria programs... So that after you bind your
>program..then you start-up the "Icon Hacker" and select the exe file to
>hack and the icon to add...and it does it...So that you can have the same
>icon on the exe that shows up in the left top corner of your app.

I would think that you might be able to write an 'add icon resource' hack
using Euphoria.  All you need is the format of a Windows EXE (which I have
easily found) and add the bits necessary to include an icon resource.  Now
I'm sure somebody has thought of this approach before...  is it not that
simple?  Will the interpreter refuse to run with this kind of modification
to the executable?  If somebody else thinks this may be possible then I
just may take a stab at it...

Having resources built into Euphoria that can be edited would obviously be
easier to deal with but would that truely be necessary?

-- Brian

new topic     » goto parent     » topic index » view message » categorize

6. Re: ICON Solutions!

Hello Brian,

Tuesday, November 09, 1999, 1:23:27 AM, you wrote:

BB> I would think that you might be able to write an 'add icon resource' hack
BB> using Euphoria.  All you need is the format of a Windows EXE (which I have
BB> easily found) and add the bits necessary to include an icon resource.  Now
BB> I'm sure somebody has thought of this approach before...  is it not that
BB> simple?  Will the interpreter refuse to run with this kind of modification
BB> to the executable?  If somebody else thinks this may be possible then I
BB> just may take a stab at it...

this should be possible. i used a resource editor to add an icon to
the exw.exe file and everything worked fine (tested pd version only).
i would be interested in such a program.

Best regards,
 Hendrik                            mailto:hm-1704 at gmx.de

new topic     » goto parent     » topic index » view message » categorize

7. Re: ICON Solutions!

On Wed, 17 Nov 1999 02:28:07 +0100, Hendrik Mundt <hm-1704 at GMX.DE> wrote:

>this should be possible. i used a resource editor to add an icon to
>the exw.exe file and everything worked fine (tested pd version only).
>i would be interested in such a program.
>
>Best regards,
> Hendrik                            mailto:hm-1704 at gmx.de

Hello Hendrik,

So you are saying there is already a utility available that will do this?
What is the name of this utility?  Can you add an icon to a bound
executable and see if it works?  From my initial research on this idea it
seems that adding an icon to a PE (portable executable) file is non-trivial
but doable.  But if such a utility already exists then I think others,
including myself, would like to check it out.

Thanks,
Brian

new topic     » goto parent     » topic index » view message » categorize

8. Re: ICON Solutions!

Brian

  I think the problem is not that simple.

  When a resource ( icon ) is added to an exe it is append to the end of
  the exe file then a offset to the resource location is inserted in the
  exe header. If a icon is added to the exw.exe file it is append ok but
  if you bind any files to the exw.exe then the resource file will be
  sandwiched in between the exw.exe and the bound files and I think that
  is a major problem when you try to change the icon.

  Bernie

new topic     » goto parent     » topic index » view message » categorize

9. Re: ICON Solutions!

Hello Brian,

Wednesday, November 17, 1999, 9:16:52 AM, you wrote:

BB> On Wed, 17 Nov 1999 02:28:07 +0100, Hendrik Mundt <hm-1704 at GMX.DE> wrote:

>>this should be possible. i used a resource editor to add an icon to
>>the exw.exe file and everything worked fine (tested pd version only).
>>i would be interested in such a program.
>>
>>Best regards,
>> Hendrik                            mailto:hm-1704 at gmx.de

BB> Hello Hendrik,

BB> So you are saying there is already a utility available that will do this?
BB> What is the name of this utility?  Can you add an icon to a bound
BB> executable and see if it works?

i know that it works with Symantec ResourceStudio32 1.0 (rs32)and
Borland Resource Workshop 4.5 . rs32 does support win95 / winnt /
win3.1 as targets; workshop accepts win3.0, win3.1, win32 as targets.
i only have the newest pd version which cannot bind anymore, but
around christmas i will buy the full version.

BB> From my initial research on this idea it
BB> seems that adding an icon to a PE (portable executable) file is non-trivial
BB> but doable.

sorry - no idea about the executable structure. what platforms do PE or NE or
whatever run on?

BB> But if such a utility already exists then I think others,
BB> including myself, would like to check it out.

alas, i don't know where you can buy this software.

Best regards,
 Hendrik                            mailto:hm-1704 at gmx.de

new topic     » goto parent     » topic index » view message » categorize

10. Re: ICON Solutions!

Hi all,

I have to agree with Bernie on this one.  I believe that when you start
fooling around with the PE(EXE) file format, "bad things" will happen.  I
think that running a program by using "exw euprog.exw" would work fine
using a modifiled exw.exe file, but try BINDing it, and you've got a
problem, because exw.exe will have the wrong address for the start of the
shrouded source code (unless Rob intentionally coded the interpreter
differently).

Just to point it out, I'm sure that RDS forbids modifying EX.EXE or EXW.EXE
in any way as part of the license agreement.  I would assume that the same
goes for modifying the interpreter section of a bound .EXE file.  Short
story - I don't think you can distribute a modified version of the
interpreter without RDS's permission.

As a request for RDS - I agree that having a custom icon in a bound EU
program would be a big plus.  Now that I am a free-lance programmer, I have
plenty of opportunities to write profressional programs in Euphoria, and
one of the things that a couple of clients have asked is for me to create a
customized icon for their programs.  For now, I've done it with a .PIF
file, but here's my suggestion:  Embed some specific icon (or multiple
icons if you REALLY want to indulge me!) in the EXW and EX interpreters.
Then allow us to use an icon editor (AX-ICONS, IconForge, etc.) to change
the icons to whatever we want in bound files.  I would also suggest that
you only embed icons in the registered versions of the interpreters, as yet
another incentive to upgrade.  It ought to be relatively easy to implement
(dare I hope for v2.2?!), and would be one more way for Euphoria to show
off!  Let me know what you think!

Brian


On Wed, 17 Nov 1999 10:20:37 -0500, Bernie Ryan <bwryan at PCOM.NET> wrote:

>Brian
>
>  I think the problem is not that simple.
>
>  When a resource ( icon ) is added to an exe it is append to the end of
>  the exe file then a offset to the resource location is inserted in the
>  exe header. If a icon is added to the exw.exe file it is append ok but
>  if you bind any files to the exw.exe then the resource file will be
>  sandwiched in between the exw.exe and the bound files and I think that
>  is a major problem when you try to change the icon.
>
>  Bernie

new topic     » goto parent     » topic index » view message » categorize

11. Re: ICON Solutions!

On Wed, 17 Nov 1999 10:20:37 -0500, Bernie Ryan <bwryan at PCOM.NET> wrote:

>Brian
>
>  I think the problem is not that simple.
>
>  When a resource ( icon ) is added to an exe it is append to the end of
>  the exe file then a offset to the resource location is inserted in the
>  exe header. If a icon is added to the exw.exe file it is append ok but
>  if you bind any files to the exw.exe then the resource file will be
>  sandwiched in between the exw.exe and the bound files and I think that
>  is a major problem when you try to change the icon.
>
>  Bernie

Well, my solution would have been to modify only a bound executable: adding
the icon resource and modifying the header appropriately.  But Brian
Jackson raised the point of violating the license agreement by making such
modifications.

Rob: do you consider such a modification to a bound executable a violation
of the license agreement?  I'd rather not start such a project if it is
forbidden.  I'd also like to hear your take on the suggestion of adding a
modifiable icon resource to exw.exe (or perhaps your own solution built
into bind.ex).

Thanks,
Brian

new topic     » goto parent     » topic index » view message » categorize

12. Re: ICON Solutions!

On Wed, 17 Nov 1999 12:42:55 -0500, Brian Jackson <bjackson at
2FARGON.HYPERMART.NET> wrote:

>Hi all,
>
>I have to agree with Bernie on this one.  I believe that when you start
>fooling around with the PE(EXE) file format, "bad things" will happen.  I
>think that running a program by using "exw euprog.exw" would work fine
>using a modifiled exw.exe file, but try BINDing it, and you've got a
>problem, because exw.exe will have the wrong address for the start of the
>shrouded source code (unless Rob intentionally coded the interpreter
>differently).
>
>Just to point it out, I'm sure that RDS forbids modifying EX.EXE or EXW.EXE
>in any way as part of the license agreement.  I would assume that the same
>goes for modifying the interpreter section of a bound .EXE file.  Short
>story - I don't think you can distribute a modified version of the
>interpreter without RDS's permission.

<SNIP>

>>
>>  When a resource ( icon ) is added to an exe it is append to the end of
>>  the exe file then a offset to the resource location is inserted in the
>>  exe header. If a icon is added to the exw.exe file it is append ok but
>>  if you bind any files to the exw.exe then the resource file will be
>>  sandwiched in between the exw.exe and the bound files and I think that
>>  is a major problem when you try to change the icon.
>>
>>  Bernie

Since bound programs are distributable and constitute a modification to
the executable, I don't think that the license would forbid tacking the icons
onto the bound executable...and they should work without harming anything
unless part of the bind includes a length check( which something in the
back of my mind makes me think that I saw something on). I would think
RDS would be the final arbiter of this, though normal distribution process
would usually allow this sort of thing.

Everett L.(Rett) Williams
rett at gvtc.com

new topic     » goto parent     » topic index » view message » categorize

13. Re: ICON Solutions!

Everett Williams wrote:

[snip]

> Since bound programs are distributable and constitute a modification to
> the executable, I don't think that the license would forbid tacking the icons
> onto the bound executable...and they should work without harming anything
> unless part of the bind includes a length check( which something in the
> back of my mind makes me think that I saw something on). I would think
> RDS would be the final arbiter of this, though normal distribution process
> would usually allow this sort of thing.
>
> Everett L.(Rett) Williams
> rett at gvtc.com

You're right: the interpreter does check the length, as well as the actual
structure of the
bound code.  An example: try loading up a bound executable into a hex editor and
change a
value or two.  You get the "One moment please..." message.

So an icon tacked onto the end of the exe would render any program useless. 
*unless* you
could figure out a way to fool the value checker. Which I'm sure is against the
license =)

Regards,
Greg Phillips

new topic     » goto parent     » topic index » view message » categorize

14. Re: ICON Solutions!

On Wed, 17 Nov 1999 14:49:13 -0800, Greg Phillips <i.shoot at REDNECKS.COM>
wrote:

>You're right: the interpreter does check the length, as well as the actual
structure of the
>bound code.  An example: try loading up a bound executable into a hex
editor and change a
>value or two.  You get the "One moment please..." message.
>
>So an icon tacked onto the end of the exe would render any program
useless.  *unless* you
>could figure out a way to fool the value checker. Which I'm sure is
against the license =)


Actually, I was able to change the text in the MS-DOS stub of a bound
Windows executable and it ran without complaints (in both DOS mode and
Windows).  I changed the text from "this is a Windows NT windowed
executable" to the more familiar "This program cannot be run in DOS
mode. ".  I did this without updating the CRC checksum value that is part
of the PE header (but I'm not sure if the CRC includes the MS-DOS stub).  I
still haven't tried anything that changes the length of the executable...
Perhaps Rob will pipe in and settle this issue.

-- Brian

new topic     » goto parent     » topic index » view message » categorize

15. Re: ICON Solutions!

Greg Phillips wrote:

> You're right: the interpreter does check the length, as
> well as the actual structure of the bound code. ...
> So an icon tacked onto the end of the exe would render
> any program useless.  *unless* you could figure out a
> way to fool the value checker. Which I'm sure is against
> the license =)

I know that Euphoria checks the *contents* of the file, but I don't think
that the length is an issue.

As an example, my resource program (RES) can optionally tack on a 'resource'
file to the end of a bound Euphoria program - essentially doing the same
kind of thing that BIND does. Despite the additional length, the bound
executable still works just fine.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

16. Re: ICON Solutions!

Brian Broker wrote:

> On Wed, 17 Nov 1999 14:49:13 -0800, Greg Phillips <i.shoot at REDNECKS.COM>
> wrote:
>
> >You're right: the interpreter does check the length, as well as the actual
> structure of the
> >bound code.  An example: try loading up a bound executable into a hex
> editor and change a
> >value or two.  You get the "One moment please..." message.
> >
> >So an icon tacked onto the end of the exe would render any program
> useless.  *unless* you
> >could figure out a way to fool the value checker. Which I'm sure is
> against the license =)
>
> Actually, I was able to change the text in the MS-DOS stub of a bound
> Windows executable and it ran without complaints (in both DOS mode and
> Windows).  I changed the text from "this is a Windows NT windowed
> executable" to the more familiar "This program cannot be run in DOS
> mode. ".  I did this without updating the CRC checksum value that is part
> of the PE header (but I'm not sure if the CRC includes the MS-DOS stub).  I
> still haven't tried anything that changes the length of the executable...
> Perhaps Rob will pipe in and settle this issue.
>
> -- Brian

I found I could to this as well.   Strange.
Anyways, Rob might, but he might not either, because we're kind of intruding on
the built in security.

Regards,
Greg

new topic     » goto parent     » topic index » view message » categorize

17. Re: ICON Solutions!

In light of the recent discussions, I intend to:
         * add a Euphoria icon to exw.exe
         * allow you to change the icon in a bound executable
         * compress exw.exe (I was planning this anyway)

I checked the docs for the compressor, and it should
be possible to compress exw.exe and still allow you
to change the icon. The icon part of the file will not be
compressed. exw is about 70K or so when compressed,
versus 150K uncompressed. (more routines will be added for 2.2)

It's possible to add files to the end of a bound executable. The
Euphoria code in a bound executable can't be changed.
I don't want to discuss the security in the rest of the
executable, but with compression, the security will be greater.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

18. Re: ICON Solutions!

> ---------------------- Information from the mail
header -----------------------
> Sender:       Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU>
> Poster:       Robert Craig <rds at ATTCANADA.NET>
> Subject:      Re: ICON Solutions!
> --------------------------------------------------------------------------
-----
>
> In light of the recent discussions, I intend to:
>          * add a Euphoria icon to exw.exe
>          * allow you to change the icon in a bound executable
>          * compress exw.exe (I was planning this anyway)
>
> I checked the docs for the compressor, and it should
> be possible to compress exw.exe and still allow you
> to change the icon. The icon part of the file will not be
> compressed. exw is about 70K or so when compressed,
> versus 150K uncompressed. (more routines will be added for 2.2)
>
> It's possible to add files to the end of a bound executable. The
> Euphoria code in a bound executable can't be changed.
> I don't want to discuss the security in the rest of the
> executable, but with compression, the security will be greater.
>
> Regards,
>      Rob Craig
>      Rapid Deployment Software
>      http://www.RapidEuphoria.com
>

    This sounds great. :)
I only ask that you consider supplying either 256 or TrueColor
Icon at 32x32.  Even better,  If you supply 256 or TrueColor at
32x32 and 16x16.  This would allow for great flexibility when
editing the Icon.  I know that this will leave out the 48x48
large icon size.  But, I think that it is rarely used.


        Lucius L. Hilley III
        lhilley at cdc.net
+----------+--------------+--------------+
| Hollow   | ICQ: 9638898 | AIM: LLHIII  |
|  Horse   +--------------+--------------+
| Software | http://www.cdc.net/~lhilley |
+----------+-----------------------------+

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu