1. How Wood Ewe...?

Here's what I wanna do:

I've got three files:

1. installer program - install.ex
2. data file         - install.dat
3. document file     - document.doc

I want to combine these into ONE file and still be able to
increment/decrement the code in the data file. This helps me keep track of
how many/where the file has been installed.

The data file would never need more than 4 bytes (uh, that's four
characters), but I'm sure allowing for 10 characters would suffice for the
immediate future (that being the next 1,000 years or so).

So, anybody know how to accomplish this? I'm thinking David Cuny's RES
program could help here, but I was never quite sure if I could open
"install.dat," modify it, then write it back... thus changing the
executable file!

Thanks in advance, guys 'n' gals!
ck

new topic     » topic index » view message » categorize

2. Re: How Wood Ewe...?

Do you mean you want to be able to change the size of the code?


> I want to combine these into ONE file and still be able to
> increment/decrement the code in the data file. This helps me keep track of
> how many/where the file has been installed.

--
Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

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

3. Re: How Wood Ewe...?

No. Not at all.

Maybe, if I could, change a line of code from

10002

to

10001

or something similar.

What I'm trying to do is track how many times the executable is used... and
by incrementing or decrementing a value within the code itself, I can act on
what I find... see?

>Do you mean you want to be able to change the size of the code?
>
>
>Jeffrey Fielding
>JJProg at cyberbury.net
>http://members.tripod.com/~JJProg/
>
>
>
>

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

4. Re: How Wood Ewe...?

From:   cklester
>What I'm trying to do is track how many times the executable is used... and
>by incrementing or decrementing a value within the code itself, I can act on
>what I find... see?

This is how Eye wood dew it.   (untested):
In the source, create a string...for example

     constant  Trickstring = "This is my trick string...."

The string doesn't need to be used for anything, just to be there.  When you
need to set data, have the program open it's exe file and scan for the string.

     sequence filedata
     atom trickloc

     filedata = getf( "me.exe", 'b' )   --getf reads an entire file as a
sequence of bytes
     trickloc = match( "This is my trick string..", filedata )
     trickloc = trickloc + length( "This is my trick string.." )

Now open the file, seek to trickloc ( the location of the last two periods
(or however many bytes you need) ), and write the new data there, then save
it.  Just so long as the data always uses the same number of bytes and
doesn't overrun the length of the string.

Shrouding with concealment of strings would probably rule out that method.

I think you also might be able to just append a few bytes to the end of the
EXE and use them without disrupting it's operation.

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

5. Re: How Wood Ewe...?

> From:          "C. K. Lester" <cklester at TICNET.COM>
> Subject:       How Wood Ewe...?

> Here's what I wanna do:
>
> I've got three files:
>
> 1. installer program - install.ex
> 2. data file         - install.dat
> 3. document file     - document.doc
>
> I want to combine these into ONE file and still be able to
> increment/decrement the code in the data file. This helps me keep track of
> how many/where the file has been installed.
>
> The data file would never need more than 4 bytes (uh, that's four
> characters), but I'm sure allowing for 10 characters would suffice for the
> immediate future (that being the next 1,000 years or so).
>
> So, anybody know how to accomplish this? I'm thinking David Cuny's RES
> program could help here, but I was never quite sure if I could open
> "install.dat," modify it, then write it back... thus changing the
> executable file!

If you don't try and change the size of the file you can change using davids
package, maybe.
*However*, changing an executables file, even if it's not part of the code will
cause most anti-virus programs to declare it a
possible threat. You may be better of having a seperate file to play in for that
reason.
-------------------------
Sincerely,
Mathew Hounsell

mat.hounsell at excite.com

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

6. Re: How Wood Ewe...?

> If you don't try and change the size of the file you can change using davids
> package, maybe.
> *However*, changing an executables file, even if it's not part of the code
> will cause most anti-virus programs to declare it a
> possible threat. You may be better of having a seperate file to play in for
> that reason.

How would they ever notice that you do ?
I mean, it isn't compiler or anything. All executable code for each euphoria
program is the same in .exe, there is just
different 'data'.
In other words, they can *not* notice such a thing in Euphoria.

Ralf

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

7. Re: How Wood Ewe...?

If you try to search for a string in the EXE file to keep track of usage.
you won't be able to shroud it if you are thinking of
using this method to limit the use of a commercial program.

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

8. Re: How Wood Ewe...?

> From:          Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL>

> > If you don't try and change the size of the file you can change using davids
> > package, maybe.
> > *However*, changing an executables file, even if it's not part of the code
> > will cause most anti-virus programs to declare it a
> > possible threat. You may be better of having a seperate file to play in for
> > that reason.
>
> How would they ever notice that you do ?
> I mean, it isn't compiler or anything. All executable code for each euphoria
> program is the same in .exe, there is just
> different 'data'.
> In other words, they can *not* notice such a thing in Euphoria.

Well it depends on the anti virus program. The anti virus program usually tries
to detect any change to a program.

Most modern compilers use a checksum on the executable they make to track if
it's been altered.
Those compilers may include the data portion or may not.
Some anti-virus programs red that checksum if it exists compares it with the one
they calculated and if they differ the file
has changed.

However most programs just calculate the checksum on their first run and store
it for future use.
That's what thos chklist.ms and anti-vir.dat etc files are.
Most antivirus progrms just calculate it for the whole file.

When you chage a file you have a 1 in 2^32 chance of not changing the checksum.

For those who don't know a check some is a method of error detection. It uses a
polynomial on a file to calculate a special
number. Then each time it wants it can check that number against one it has
freshly calculated if they are different the file
has changed or been corrupted etc.

-------------------------
Sincerely,
Mathew Hounsell

mat.hounsell at excite.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu