C软件加密解密之动态跟踪-1

  • 1、新的中断服务程序
  • void interrupt newint (bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flgs)
    {
        /*用于读取标志寄存器*/
        flag = flgs;
    }
        /*新INT 3H服务程序*/
    void interrupt new13(bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flgs)
    {
    /*实际磁盘操作*/
        (*old13) (bp,di,si,ds,es,dx,cx,bx,as,ip,cs,flgs);   
        
     /*保存出口参数*/
        out_ax = _AX;
        out_cx = _CX;
        out_dx = _DX;

    /*巧取标志寄存器的值*/
        newint();
        flgs = flag;

    /*驱动器*/
        drive = dx&0xff;

    /*记录入口参数*/
        record[number].ax = ax;
        record[number].cx = cx;
        record[number].dx = dx;
        ax = out_ax;
        cx = out_cx;
        dx = out_dx;
        if(number<MAXRECORD)
        if(drive == 0 || drive == 1)
        {
            /*驱动器为A或B即软驱时才记录*/
            parameter = MK_FP(peek(0,0x78+2),peek(0,0x78));
            for(p = 0;p < 11; p++)
            {
            /*记录盘基参数*/
            record[number].parameter[p] = parameter[p];
            /*记录出口参数*/
            record[number].out_ax = ax;
            /*记录标志寄存器*/
            record[number].flags = flgs;
            number++;
            }
        }
    }

    你可能感兴趣的:(加密解密)