home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / T.ZIP / TPE14.ZIP / TPE-GEN.ASM < prev    next >
Assembly Source File  |  1993-12-24  |  4KB  |  106 lines

  1. ;----------------------------------------------------------------------------
  2. ;   TPE-GEN   -   This program generates 50 TPE encrypted test files
  3. ;   This source can be compiled with MASM 5.0 or TASM 2.01
  4. ;   (and perhaps others too, but this is not tested.)
  5. ;----------------------------------------------------------------------------
  6.  
  7.                 .model  tiny
  8.                 .RADIX  16
  9.  
  10.                 .code
  11.  
  12.                 extrn   crypt:near              ;external routines in engine
  13.                 extrn   rnd_get:near
  14.                 extrn   rnd_init:near
  15.  
  16.  
  17.                 org     0100
  18.  
  19. begin:          call    rnd_init                ;init. random number generator
  20.  
  21.                 mov     dx,offset starttxt      ;print message
  22.                 mov     ah,09
  23.                 int     21
  24.  
  25.                 mov     cx,50d                  ;repeat 50 times
  26. lop:            push    cx
  27.  
  28.                 mov     ah,3C                   ;create a new file
  29.                 mov     dx,offset filename
  30.                 mov     cx,0020
  31.                 int     21
  32.                 xchg    ax,bx
  33.  
  34.                 push    ds
  35.                 push    es
  36.                 push    bx
  37.  
  38.                 mov     ax,cs                   ;input parameters for engine
  39.                 mov     ds,ax
  40.                 add     ax,0400
  41.                 mov     es,ax                   ;ES = DS + 400h
  42.                 xor     si,si                   ;code will be right after decr.
  43.                 mov     dx,offset hello         ;this will be encrtypted
  44.                 mov     cx,100d                 ;length of code to encrypt
  45.                 mov     bp,0100                 ;decryptor will start at 100h
  46.                 call    rnd_get                 ;AX register will be random
  47.  
  48.                 call    crypt                   ;call the engine
  49.  
  50.                 pop     bx                      ;write crypted file
  51.                 mov     ah,40
  52.                 int     21
  53.  
  54.                 mov     ah,3E                   ;close the file
  55.                 int     21
  56.  
  57.                 pop     es
  58.                 pop     ds
  59.                 
  60.                 mov     di,offset filename      ;adjust name for next file
  61.                 mov     bx,7                    ; (increment number)
  62. incnum:         inc     byte ptr ds:[bx+di]
  63.                 cmp     byte ptr ds:[bx+di],'9'
  64.                 jbe     numok
  65.                 mov     byte ptr ds:[bx+di],'0'
  66.                 dec     bx
  67.                 jnz     incnum
  68.  
  69. numok:          pop     cx                      ;do it again...
  70.                 loop    lop
  71.  
  72. exit:           int     20
  73.  
  74.  
  75. ;----------------------------------------------------------------------------
  76. ;               Text and data
  77. ;----------------------------------------------------------------------------
  78.  
  79. starttxt        db      'TPE-GEN  -  Generates 50 TPE encrypted test files.'
  80.                 db      0Dh, 0Ah, '$'
  81.  
  82. filename        db      '00000000.COM',0
  83.  
  84.  
  85. ;----------------------------------------------------------------------------
  86. ;               The small test file that will be encrypted
  87. ;----------------------------------------------------------------------------
  88.  
  89. hello:          call    next                    ;get relative offset
  90. next:           pop     dx
  91.                 add     dx,10d                  ;find begin of message
  92.                 mov     ah,09                   ;print message
  93.                 int     21
  94.                 int     20
  95.  
  96.                 db      'Hello, world!', 0Dh, 0A, '$'
  97.                 db      (100d) dup (90)
  98.  
  99.                 end    begin
  100. 
  101. ;  ─────────────────────────────────────────────────────────────────────────
  102. ;  ───────────────> ReMeMbEr WhErE YoU sAw ThIs pHile fIrSt <───────────────
  103. ;  ───────────> ArReStEd DeVeLoPmEnT +31.77.SeCrEt H/p/A/v/AV/? <───────────
  104. ;  ─────────────────────────────────────────────────────────────────────────
  105.