home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CCTX0497.ZIP / PMUPDT19.ZIP / PME101.ZIP / PME-GEN.ASM < prev    next >
Assembly Source File  |  1995-02-22  |  2KB  |  94 lines

  1.  
  2.  
  3. ;       Phantasie Mutation Engine --- DEMO
  4. ;       This program will generate 50 mutation programs.
  5. ;       (C) Copyright 1995 Written by Burglar. All Rights Reserved.
  6. ;       Made In Taiwan.
  7.  
  8.  
  9.         .MODEL  TINY
  10.  
  11.         .CODE
  12.  
  13.         ORG     100H
  14.  
  15.         EXTRN   PME:NEAR, PME_END:NEAR  ;must declare PME to external module.
  16.  
  17.  
  18. BEGIN:
  19.         MOV     DX,OFFSET GEN_MSG
  20.         MOV     AH,9
  21.         INT     21H
  22.  
  23.         MOV     CX,50
  24. GEN:
  25.         PUSH    CX
  26.  
  27.         MOV     DX,OFFSET FILENAME
  28.         PUSH    CS
  29.         POP     DS
  30.         XOR     CX,CX
  31.         MOV     AH,3CH
  32.         INT     21H
  33.  
  34.         PUSH    AX
  35.  
  36.         MOV     DX,OFFSET PROG  ;DS:DX point to the head of program which you
  37.                                 ;want to be mutation.
  38.         MOV     CX,OFFSET PROG_END - OFFSET PROG  ;CX hold the length of the
  39.                                                   ;program which you want to
  40.                                                   ;be mutation.
  41.         MOV     BX,100H  ;BX sets the beginning offset when execution.
  42.  
  43.         PUSH    SS
  44.         POP     AX
  45.         ADD     AX,1000H
  46.         MOV     ES,AX   ;ES point to a work segment.
  47.                         ;for putting decryption routine + encrypted code.
  48.                         ;just need the length of origin program + 512 bytes.
  49.  
  50.         CALL    PME     ;OK! when every thing is okay, you can call the PME.
  51.  
  52.                         ;When PME execute over, it will return :
  53.                         ;DS:DX -> decryption routine + encrypted code.
  54.                         ;CX -> length of the decryption routine + encrypted
  55.                         ;code. (always origin length + 512 bytes)
  56.  
  57.         POP     BX
  58.         MOV     AH,40H
  59.         INT     21H
  60.  
  61.         MOV     AH,3EH
  62.         INT     21H
  63.  
  64.         MOV     BX,OFFSET FILENAME
  65.         INC     BYTE PTR CS:BX+7
  66.         CMP     BYTE PTR CS:BX+7,'9'
  67.         JBE     L0
  68.         MOV     BYTE PTR CS:BX+7,'0'
  69.         INC     BYTE PTR CS:BX+6
  70. L0:
  71.         POP     CX
  72.         LOOP    GEN
  73.  
  74.         INT     20H
  75.  
  76. FILENAME DB     '00000000.COM',0
  77.  
  78. GEN_MSG DB      'Generating 50 mutation programs... $'
  79.  
  80. PROG:
  81.         CALL    $+3
  82.         POP     DX
  83.         ADD     DX,OFFSET MSG - OFFSET PROG - 3
  84.         MOV     AH,9
  85.         INT     21H
  86.         INT     20H
  87. MSG     DB      'I am a mutation program.$'
  88. PROG_END:
  89.  
  90.  
  91.         END     BEGIN
  92.  
  93.  
  94.