Subscribe For Free Updates!

We'll not spam mate! We promise.

0

The following basic program, LOAD.BAS, will translate the HEX listings in the previous four appendicies into COM files. The basic program will run under GWBASIC or BASICA. You may type it in yourself using BASIC, and then type in the HEX files using a word processor.
Using LOAD, you can create functioning viruses with this book, without buying an assembler like MASM or TASM. Each of the previous appendicies give you the details of how to get each particular virus up and running.
When the program runs, you will be prompted for both source and destination file names. When asked for the source file, enter the HEX file name, including the “HEX”. When asked for the destination file name, enter the COM file name that you want to create, including the “COM”. The program will then read and translate the HEX file. If everything goes OK, it will report “Translation complete.” If there is a problem, it will report “Checksum error in line XX,” which means that you made a mistake typing line XX in. You should go back and check your HEX file for mistakes, correct them, and try to run LOAD again.
For example, suppose you had created the VCOM.HEX file with your word processor. Then to create a COM file from it, you would load the LOAD program like this:
C:\GWBASIC LOAD.BAS
The dialogue would then look something like this:
Source file? VCOM.HEX
Destination file? VCOM.COM Translation complete.
and the file VCOM.COM would now be on your disk, ready to execute.
The source code for LOAD.BAS is as follows:
10 PRINT “Source file”;
20 INPUT SFNAME$
30 PRINT “Destination file”;
40 INPUT DFNAME$
50 OPEN SFNAME$ FOR INPUT AS #1
60 OPEN DFNAME$ FOR RANDOM AS #2 LEN=1
70 FIELD 2, 1 AS O$
80 E=0
90 LINECT=0
100 IF EOF(1) THEN GOTO 160
110 LINE INPUT #1, S$
120 LINECT=LINECT+1
130 GOSUB 200
140 GOTO 100
150 IF E=1 THEN GOTO 170
160 PRINT “Translation complete.”
170 CLOSE #1
180 CLOSE #2
190 END
200 REM THIS SUBROUTINE DECOMPOSES ONE LINE OF THE HEX FILE
210 H$=LEFT$(S$,3)
220 H$=RIGHT$(H$,2)
230 GOSUB 540
240 COUNT%=X%
250 CSUM%=COUNT%
260 H$=LEFT$(S$,7)
270 H$=RIGHT$(H$,4)
280 GOSUB 540
290 ADDR%=X%
300 CSUM%=CSUM%+(ADDR%\256)+(ADDR% AND 255)
310 H$=LEFT$(S$,9)
320 H$=RIGHT$(H$,2)
330 IF H$<>"00" THEN GOTO 160
340 FOR J%=1 TO COUNT%
350 H$=LEFT$(S$,9+2*J%)
360 H$=RIGHT$(H$,2)
370 GOSUB 500
380 CSUM%=CSUM%+X%
390 LSET O$=C$
400 PUT #2, ADDR%+J%
410 NEXT J%

420 H$=LEFT$(S$,11+2*COUNT%)
430 H$=RIGHT$(H$,2)
440 GOSUB 540
450 CSUM%=CSUM%+X%
460 IF (CSUM% AND 255) = 0 THEN RETURN
470 PRINT “Checksum error in line ”;LINECT
480 E=1
490 GOTO 150
500 REM THIS SUBROUTINE CONVERTS A HEX STRING IN H$ TO A
BYTE in C$
510 GOSUB 540
520 C$=CHR$(X%)
530 RETURN
540 REM THIS SUBROUTINE CONVERTS A HEX STRING IN H$ TO AN
INTEGER IN X
550 X%=0
560 IF LEN(H$)=0 THEN RETURN
570 Y%=ASC(H$)-48
580 IF Y%>9 THEN Y%=Y%-7
590 X%=16*X%+Y%
600 H$=RIGHT$(H$,LEN(H$)-1)
610 GOTO 560

Note that the HEX files and loader presented in this book are a little different from the usual. There is a reason for that.

About The Author
Hasan Shaikh is the founder and admin of ShmHack, a popular blog dedicated for Learners,Geeks and Bloggers. He is currently 19 years old and loves to post articles related to blogging,SEO,adsense,hacking,security,social medias,computer and android. Find more about him...

Post a Comment

Write Your Precious Comments Here.!

 
Top