=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 05-18-93 (19:10) Number: 8 From: MIKE AUDLEMAN Refer#: 41 To: SEAN SULLIVAN Recvd: NO Subj: Re: Adding Data to end of Conf: (35) Quick Basi --------------------------------------------------------------------------- This message contains code for sampling a program's size and stuffing it into a variable in the compiled program. I run this program after compiling the other programs AND PKLITEing them. I use this program to modify the installation program. It gets the length of the runtime program and modifies the install program as to it's size. Inside the install program, I test this modified value with the LOF that is returned for the current file. If the two values are NOT the same, the install program aborts. This way, I do a simple test to see if someone has tinkered with the program. --------------------------->8----CUT-------8<----------------------------------- - 'DATEIFIX.BAS -- Size modification routine 'Copyright 1993 by Mike Audleman DEFINT A-Z DIM FileIO AS STRING * 3072 PRINT PRINT "DATEIFIX - Modifies the SIZE variable in DATEINST.EXE" FileSize$ = "@gH1$>" 'Flag to start of Variable to modify FilenameI$ = Path$ + "DATEINST.EXE" 'Program to Modify FilenameC$ = Path$ + "DATECHEK.EXE" 'Program to Get Length Of OPEN FilenameC$ FOR INPUT AS 1 Fs$ = LTRIM$(STR$(LOF(1))) 'Get Trimmed size in a String CLOSE 1 'Done with this file PRINT : PRINT FilenameC$; " length is "; Fs$; " Bytes." OPEN FilenameI$ FOR INPUT AS 1 'This is the program we are modifying CLOSE 1 'Just checking it is there PRINT OPEN FilenameI$ FOR BINARY AS 1 'Open Binary mode GET 1, 1, FileIO 'Get Sector 1 'If Sector does NOT indicate that the file was PKLITEed, warn user a& = INSTR(FileIO$, "PKLITE") + INSTR(FileIO$, "PKWARE") IF a& > 0 THEN PRINT "DATEIFIX Should be run before PKLITE!" 'Go to end of file and back up by the length of the Data Record SEEK 1, LOF(1) - LEN(FileIO) GET 1, , FileIO 'Get Data Record a& = INSTR(FileIO, FileSize$) 'Search for the variable pointer IF a& = 0 THEN GOTO BadPatch 'If not there somt'in is wrong 'We Are looking for this "@gHi$>012345 "8----CUT-------8<----------------------------------- - 'This is NOT a Complete Program 'Partial Code Segments from DATEINST.BAS 'Copyright 1993 by Mike Audleman ------------------------------------------------------------------------ 'Set Value of Patch area FileSize$ = "@gHi$>012345 FS& THEN ERROR 127 'It matched so go on and work with it ON ERROR GOTO 0 PRINT "Processing "; Filename$ 'End of Excerpts from DATEINST.EXE --------------------------->8----CUT-------8<----------------------------------- - I hope that these messages helped. As I mentioned in the first message, I have some code someone else wrote that gets the name of the program that is running and where (Drive,Directory) it was run from if you need it. I do not use it in the above examples but I do use it in the runtime program to see where it is to get the config information. Later ... Mike Audleman ... New Mail not found. Start whine-pout sequence? (Y/N) --- GEcho 1.00+