原理不一样吗?都是Hook API

解决方案 »

  1.   

    这是兄弟的代码,谁知道怎么用吗?
    比如加速、原速和慢速,谢谢!void Ring0()
    { //在Windows9x下进入ring0后进行的操作
    __asm
    {
    cli
    mov al,34h
    out 43h,al //写入8253控制寄存器,设置写0号定时器
    mov ax,bx
    out 40h,al //写定时值低位
    mov al,ah
    out 40h,al //写定时值高位
    sti
    iretd;
    }
    }void SetClockNT(int freq)
    { //NT下的操作
    //这里使用了NT Port库
    Outport(0x43,0x34); //写入8253控制寄存器,设置写0号定时器
    Outport(0x40,freq&0xff); //写定时值低位
    Outport(0x40,(freq>>8)&0xff); //写定时值高位
    }void SetClock9x(int freq)
    {
    union Function_Pointer
    {
    void (*pointer)();
    char bytes[sizeof(void *)];
    }OldIntAddress,NewIntAddress; int IDTAddress; //IDT表基地址
    int IDTItemAddress; //要修改的中断门所在地址
    char *Pointer; //要修改的中断门所在地址,指针形式 __asm
    {
    push eax
    sidt [esp-2]
    pop eax
    mov IDTAddress,eax //得到IDT表基地址
    }

    IDTItemAddress=FREE_INT_NO*8+IDTAddress;
    Pointer=(char *)IDTItemAddress;
    NewIntAddress.pointer=Ring0;

    OldIntAddress.bytes[0]=Pointer[0];
    OldIntAddress.bytes[1]=Pointer[1];
    OldIntAddress.bytes[2]=Pointer[6];
    OldIntAddress.bytes[3]=Pointer[7]; //保存旧的中断门 Pointer[0]=NewIntAddress.bytes[0];
    Pointer[1]=NewIntAddress.bytes[1];
    Pointer[6]=NewIntAddress.bytes[2];
    Pointer[7]=NewIntAddress.bytes[3]; //设置新的中断门

    __asm
    {
    mov ebx,freq
    int FREE_INT_NO //产生中断,进入ring0
    } Pointer[0]=OldIntAddress.bytes[0];
    Pointer[1]=OldIntAddress.bytes[1];
    Pointer[6]=OldIntAddress.bytes[2];
    Pointer[7]=OldIntAddress.bytes[3]; //恢复旧的中断门
    }
      

  2.   

    在win9x中是通过进入ring0级 然后对8253控制寄存器进行读写。
    其中在win9x中是通过中断门进入ring0级的,当然进入ring0级还可以用其他的方法,只不过利用中断门比较方便.关于中断门,调用门的概念 可以看看 保护模式 有关的书籍 :)
      

  3.   

    比如这个函数void SetClock9x(int freq)
    我试了一下freq=500速度飞快,5马上死机
    不知道怎么恢复原来速度,谢谢!
      

  4.   

    开发包是VB的,有VC的全部源代码就好了!!!
      

  5.   

    要啊,发我一个谢谢!
    [email protected]
      

  6.   

    >>zshuc(小巧的PE)
    Thank you: [email protected]
      

  7.   

    顺手也发给我个吧,谢谢[email protected]
      

  8.   

    我要
    [email protected]
    谢了!
      

  9.   

    错了:
    [email protected]
      

  10.   

    谢谢,也请发我一个
    [email protected]
      

  11.   

    我看还是公布把!!!!!!!!!!!!
    me too!!!
    :)