                   TABLE OF IMPORTANT INTERRUPT FUNCTIONS
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have noticed that a lot of people out there who want to learn how to
program virii don't know the functions needed to do so.  And some beginners
keep on forgetting these functions.  So to help you all here's my handy
Table of Important Interrupt Functions.

THE TABLE
~~~~~~~~~

OPEN FILE:

        ah      =       3dh
        al      =       0-2     Access mode
                        000 =   Read Only
                        001 =   Write Only
                        010 =   Read/Write
        DS:DX = Segment:Offset of Asciiz pathname

CF = 0 ;function succesful
AX = handle
CF = 1 ;error


CLOSE FILE:

        ax      =       3eh
        bx      =       file handle

CF = 0 ;function succesful
AX = destroyed
CF = 1 ;error


READ FILE:

        ah      =       3fh
        bx      =       handle
        cx      =       number of bytes to be read
        DS:DX   =       segment:offset of a buffer

CF = 0 ;function is succesful
AX = number of bytes read
CF = 1 ;error


FIND FIRST MATCHING FILE:

        ah      =       4eh
        cx      =       file attribute (bits can be combined)
                        bit 0 = 1 read only
                        bit 1 = 1 hidden
                        bit 2 = 1 system
                        bit 3 = 1 volume label
                        bit 4 = 1 directory
                        bit 5 = 1 archive
                        bit 6-15  reserved  
        DS:DX = Segment:Offset of ASCIIZ pathname


CF = 0 ;function is succesful
[DTA] Disk Transfer Area = FindFirst Data Block


FIND NEXT:
        mov     ah      =       4fh     ;rest is the same as in Find First



THE DTA
~~~~~~~

0       21      reserved
21      1       File Attributes
22      2       Time Last Modified
24      2       Date Last Modified
26      4       Size of File (in bytes)
30      13      File Name (ASCIIZ)


IMPORTANT FUNCTIONS:

XOR ENCRYPTOR:
~~~~~~~~~~~~~~

encypt_val      dw      ?


decrypt:
encrypt:
        mov     dx, word ptr [bp+encrypt_val]
        lea     bx, [bp+part_to_encrypt_start]
        mov     cx, (part_to_encrypt_end - part_to_encrypt_start + 1) / 2

xor_loop:
        xor     word ptr [bx], dx
        add     bx, 2
        loop    xor_loop

;To use this make sure you have a part to calculate the offset!


OFFSET CALCULATOR
~~~~~~~~~~~~~~~~~

Setup:
        pop si                  ;could use bp!  Depends on which variable you
        sub si, offset setup    ;want to use to represent the offset!  For
                                ;the above encryptor I used bp.


I hope this helps you a bit in your venture against the AV folks.  I will
continue to publish stuff for beginners in the future issues.  So enjoy!

                                                Dark Night
