home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
s
/
sst33.zip
/
SAMPLE.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-02-25
|
5KB
|
113 lines
DEFINT A-Z
'
' Sample program on how to set up your code for using "SSTPATCH.EXE".
' This Sample Program is laid out in MicroSoft Quick Basic format, but
' we have only used "Entry Level" Basic commands. This type of "Patch"
' will "definitely" work with Microsoft Quick Basic "EXE" files, & will
' "possibly" work with many other types of "EXE" files. It all depends
' upon how the DATA statements are stored inside of the "EXE" files,
' and if the character count on the data lines remains constant. We
' have not found ANY source code using "Line Numbers" that will work
' with SST-PATCH.
'
'
' <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
' |||||||||||||||||| YOUR PROGRAM'S SOURCE CODE |||||||||||||||||||
' <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
'
CLS
PRINT "LET'S PRETEND THIS IS THE FIRST LINE OF YOUR MAIN SOURCE CODE"
'
' The 'body' of your main program's source code
' would be placed in here.
' Many, many
' lines long.
'
PRINT "LET'S PRETEND THIS IS THE LAST LINE OF YOUR MAIN SOURCE CODE"
GOSUB ShowPatch 'REM to display the new patch.
CLOSE : END: SYSTEM
'
' <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
' |||||||||||||||||| END OF YOUR SOURCE CODE |||||||||||||||||||
' <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
'
'
'
'
' Now, after the last line of code in your main program module,
' insert the following "DATA" lines. Make the entries EXACTLY
' as we have them. When "messing around" with binary "stuff",
' character counting is "everything".
'
' Caution!
' - NO TRAILING "SPACEBARS" ON THE DATA ENTRY LINES
' - NO "REMARKS" ON THE DATA ENTRY LINES
' - NO OTHER CHARACTERS OF ANY KIND ON DATA ENTRY LINES
' - WHEN WE SAY "EXACTLY" - WE MEAN "EXACTLY!
'
'
'
DATA "Customer_Name_And_Number"
DATA "123456789012345678901234567890"
DATA "12345678"
DATA "12345"
'
'
'
' The 1st DATA line is a "File Place Marker" or "File Flag" only.
' The 2nd DATA line will hold a Customer's Name (Max Length = 30)
' The 3ed DATA line will contain your currently set "System Date"
' The 4th DATA line will contain up to a 5 digit Serial Number
'
' That's all there is to it. Now compile and link your source code
' into an "EXE" file, and then run "SSTPATCH.EXE". The entries in the
' above "DATA" statements will be replaced with your customer's data.
' You can then view the patch with any good binary editor, or simply
' add something like the commands in "ShowPatch" to your source code
'
' Once the above DATA lines are in place, you can patch the same EXE
' file over and over again with different information as many times
' as you wish. The System Date is always used, so set your calendar.
'
'
'
ShowPatch:
' To display the patched data on screen, you could do something like....
READ X$, NAME$, DT$, SER$
PRINT
PRINT "'SAMPLE.EXE' - THE PATCHED ENTRIES ARE...."
PRINT
PRINT "Customer's Name......: "; NAME$
PRINT "Date Of Transaction..: "; DT$
PRINT "Product Serial #.....: "; SER$
RETURN
'
'
'
' The file called "SAMPLE.EXE" is a compiled version of this source code.
' Try SSTPATCH to patch SAMPLE.EXE to see how all of this works.
'
'
' **********************************************************************
'
' Note: Common reasons why an EXE file won't work after a patch:
'
' - You used a punctuation mark in your "CUSTOMER NAME" entry.
' Some of these characters will cause problems, others work
' just fine. The first time you try to patch a program, don't
' try to get fancy - Just enter Alpha/Numeric characters.
'
' - You left trailing "spacebars" at the end of the "DATA" lines.
' There must be NO other characters of any kind after the last
' quote mark on any "DATA" line entry (not even a REMark).
'
' - You didn't enter the "DATA" lines EXACTLY as we show them in
' the examples in "SAMPLE.BAS". If you are using Quick Basic,
' load "SAMPLE.BAS" along with your own program, and then
' "copy" the data lines from Sample.Bas to your program with
' Quick Basic's "Cut & Paste" feature.
'
'************************************************************************