home *** CD-ROM | disk | FTP | other *** search
/ Cracking 1 / Cracking I..iso / Tools / Ostatní / aPLib v0.26b / examples / dll_asm / aptest.asm next >
Encoding:
Assembly Source File  |  2001-12-15  |  1.5 KB  |  63 lines

  1. ;;
  2. ;; aPLib compression library  -  the smaller the better :)
  3. ;;
  4. ;; TASM32/TLINK32 example, using aplib.dll
  5. ;;
  6. ;; Copyright (c) 1998-2000 by Joergen Ibsen / Jibz
  7. ;; All Rights Reserved
  8. ;;
  9.  
  10. .386p
  11. .model flat
  12.  
  13. locals
  14. jumps
  15.  
  16. .data?
  17.  
  18.  dest    db 128      dup (?)
  19.  check   db 128      dup (?)
  20.  workmem db 640*1024 dup (?)
  21.  
  22. .data
  23.  
  24.  src    db 'This is just a simple little test, to see if aPLib works!!!',0
  25.  srclen dd ($-src)
  26.  
  27.  capt   db 'aPLib DLL Test',0
  28.  
  29. .code
  30.  
  31.  extrn _aP_pack            : near
  32.  extrn _aP_depack_asm      : near
  33.  extrn _aP_depack_asm_fast : near
  34.  
  35.  extrn MessageBoxA         : proc
  36.  extrn ExitProcess         : proc
  37.  
  38. aplib_asm_test:
  39.         ; compress src -> dest
  40.         push  0                   ; no callback, hence NULL
  41.         push  offset workmem      ; 1mb of workmem
  42.         push  [srclen]            ; length
  43.         push  offset dest         ; destination
  44.         push  offset src          ; source
  45.         call  _aP_pack            ; compress
  46.  
  47.         ; decompress dest -> check
  48.         push  offset check        ; destination
  49.         push  offset dest         ; source
  50.         call  _aP_depack_asm_fast ; decompress
  51.  
  52.         ; print out check to verify
  53.         push  0                   ; uType
  54.         push  offset capt         ; caption
  55.         push  offset check        ; text
  56.         push  0                   ; master handle
  57.         call  MessageBoxA         ; show message
  58.  
  59.         ; exit
  60.         call  ExitProcess
  61.  
  62. END aplib_asm_test
  63.