TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Anthony Tibbs
from: Kurt Kuzba
date: 1999-01-13 00:47:10
subject: Encrypted changes to runn

AT> KD>   EXEs are a bit harder. Information can be appended to
AT> KD>   the end  of an EXE file. Working out how to find the
AT> KD>   end of an EXE requires  fiddling with the EXE header.
AT>   Did I miss something here?  Wouldn't an
AT>      fseek (fp, 0L, SEEK_END)
AT>   Work?
   Of course it would, but that will only find the end of the
   file itself. If your data is appended to the .EXE, then it
   will be passed over by this procdure. The info in the header
   gives the actual .EXE size, and ignores all appended data.
   I just posted a DOS utility that tells you the size of your
   .EXE file, and it comes up with the same number even after
   you use a binary append to attach data to your file, while
   using fseek() with SEEK_END will position your pointer past
   the .EXE and the data both. You simply read two short values,
   at offsets 02h and 04h, and then multiply the value at 04h
   by 512, subtract 512 and add the value at 02h.
   Actually, the value at 02h is the modulo 512 value for the
   bit length, where the value at 04h is the total number of
   512 byte blocks required to hold the program on disk, and
   will usually excede the actual bytes used in any Microsoft
   app, though other vendors may do it a bit differently.
   Using that process, then, you arrive at a number which may
   be used with an
      fseek(fp, exeLen, SEEK_SET);
   to position the file pointer at the beginning of your
   appended data.

---
> ] I did a Web search for MY MORALS, but didn't find anything..

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 634/397 635/506 728 639/252
SEEN-BY: 670/218
@PATH: 154/750 222 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.