»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
¼¼ÊõÎĵµ > VCÎĵµ > ÆäËûÎĵµ
¹²ÏíÈí¼þµÄ×¢²á¼ÓÃÜ·¨
·¢±íÈÕÆÚ£º2004-10-10 09:31:54×÷ÕߣºË ³ö´¦£ºCSDN  

×÷Õß: ÁÉÄþÌúÁë ËÎÁ¢²¨
À´×ÔÓÚ: ²»Ïê

ÄÚÈÝ:
InternetÍøÂçµÄѸËÙ·¢Õ¹£¬ÎªÈí¼þ¸ßЧ´«²¥¿ª±Ù¸ü¼Ó¹ãÀ«µÄÌìµØ¡£Èç¹úÄÚÖøÃûµÄ½ðÖ©ÖëÈí¼þÏÂÔØÖÐÐÄ£¬¾ÍÊÇÒ»¸öµäÐ͵ķ¢²¼Èí¼þ¼¯É¢µØ¡£·¢²¼¹²ÏíÈí¼þÖ÷Òª°üÀ¨Á½ÖÖÐÎʽ£ºÈÕÆÚÏÞÖÆÐÎʽºÍµç×Ó×¢²áÐÎʽ¡£ÈÕÆÚÏÞÖÆÐÎʽÔÊÐíÏÂÔØÈí¼þµÄÓû§Ê¹ÓÃÈí¼þÒ»¶Îʱ¼ä£¬ÈçÒ»¸öÔµȣ¬Èç¹ûÓû§ÈϿɸÃÈí¼þ£¬¿É¹ºÂò¸ÃÈí¼þµÄ×¢²áÐòÁкżÌÐøʹÓ㻵ç×Ó×¢²áÐÎʽ¾ÍÊǸù¾ÝÓû§ËùÓûúÆ÷µÄÓ²¼þÐÅÏ¢²úÉú×¢²áÂ룬²¢ÔÚÈí¼þÖжÔijЩÏȽø»ò³£Óù¦ÄܽøÐÐÏÞÖÆ£¬Èç¹ûÓû§ÒªÊ¹ÓÃÆäÈ«²¿¹¦ÄÜ£¬±ØÐ뽫Èí¼þ²É¼¯µÄÓйØÓ²¼þÐÅÏ¢·´À¡¸ø¿ª·¢Õߣ¬²¢½»Ò»¶¨µÄ×¢²á·Ñ¿É»ñµÃ¸ÃÈí¼þÔÚ×Ô¼º»úÆ÷ÖеÄ×¢²áÂ룬²ÅÄÜÕý³£Ê¹Óá£
Ç°Ò»ÖÖÐÎʽºÜÈÝÒ׸øµÁ°æÕßÔì³É¿É³ËÖ®»ú£¬Èç¹ûÖÆ×÷µÁ°æÕß¹ºÂòÁËÒ»¸ö×¢²áÐòÁкŲ¢¹«²¼ÓÚÌìÏ£¬ÔòËùÓÐÓû§Ê¹ÓÃÕâ¸ö×¢²áºÅ¶¼¿É½øÐÐÕý³£Ê¹Ó㻺óÕ߶ÔÓû§À´Ëµ×¢²áÊÖ¶ÎÉÔÏÔ¸´ÔÓЩ£¬¶Ô¿ª·¢ÕßÀ´ËµÒ²ÐèÒªÒ»¶¨µÄ±à³ÌÕ湦·ò£¬µ«Æä¾ßÓÐ"°ËµãËø½ô"¹¦ÄÜ£¬·ÀµÁÐÔÈ´ÊDz»ÈÝÖÃÒÉ¡£±¾Îĸù¾Ý×Ô¼ºµÄʵ¼ù£¬½«ºóÕßµÄʵÏÖ¹ý³Ì½éÉܸøÏëÒªÖÆ×÷·¢²¼¹²ÏíÈí¼þµÄ¶ÁÕß¡£
Ò»¡¢×¢²áÔ´
ÔÚWIN98/95µÄ±£»¤Ä£Ê½Ï£¬Òª¸ù¾ÝÓ²¼þÐÅÏ¢ÐγÉ×¢²áÂë¿É²»ÊÇÒ»¼þÈÝÒ×µÄÊ£¬ÔÚʵģʽÏ¿Éͨ¹ýÓ²Å̶˿Ú1F6HºÍ1F7HÖ±½Ó¶ÁÈ¡Ó²Å̵ÄÐòÁкŵÈÐÅÏ¢×÷Ϊע²áµÄÊý¾ÝÔ´£¬µ«ÕâÒ»·½·¨ÔÚ±£»¤Ä£Ê½ÏÂÈ´±»ÁÁ³öÁ˺ìÅÆ¡£ÀûÓÃBIOSÖеÄÖ÷°åÐòÁкš¢BIOS°æ±¾ÐòÁкŻòÖ÷»ú³ö³§ÈÕÆںͱêÖ¾µÈ£¬ÍêÈ«¿ÉÒÔ×÷Ϊע²áÂëµÄ×¢²áÔ´¡£ÈçROMBIOSÖÐF000H-FFFFHÇøÓòÖоʹæÔÚÓëÓ²¼þÅäÖÃÓйصÄÐÅÏ¢£¬»¹¿ÉÒԲɼ¯ÆäËüÒ»´¦»ò¼¸´¦Ö÷°åµÈµÄÐÅÏ¢×÷Ϊע²áÂëµÄÉú²ú»ùµØ¡£ÀýÈç¿É¸ù¾ÝF000H:FFF5H-F000H:FFFFH Öдæ·ÅµÄÖ÷»ú³ö³§ÈÕÆÚºÍÖ÷»ú±êÖ¾Öµ£¬²úÉúÓ¦ÓóÌÐòµÄ×¢²áÂë¡£ÓÉÓÚ¼ÆËã»ú²úÆ·µÄ¸üл»´ú±È½Ï¿ì£¬¶øÇÒËùÓÐÓû§Ê¹ÓõļÆËã»ú²»¿ÉÄÜÅäÖö¼ÍêÈ«Ïàͬ£¬ËùÒÔ×¢²áÂë²úÉúµÄÔ´Ò²²»»áÍêÈ«Ïàͬ¡£¶øÇÒÕâЩӲ¼þÐÅÏ¢ÄÚÈÝÔÚÈκβÙ×÷ϵͳϾùÍêÈ«Ïàͬ£¬¼æÈÝÐԷdz£ºÃ£¬¸ü²»»áÒòΪ²Ù×÷ϵͳµÄ¸üжøÔì³É×¢²á¹¦ÄÜʧЧ¡£
×¢²áÔ´È·¶¨Ö®ºó£¬¹Ø¼üµÄÎÊÌâ¾ÍÊǹ²ÏíÈí¼þ°²×°³ÌÐòÈçºÎ²É¼¯×¢²áÔ´ÐÅÏ¢£¬²¢ÈÃÓû§½«Æä·µ»Ø¸ø¿ª·¢Õß¡£×î¼òµ¥µÄ·½·¨¾ÍÊǽ«²É¼¯µ½µÄ×¢²áÔ´ÐÅÏ¢¾­¹ýλ²Ù×÷¼ÓÃܺó´æ·Åµ½Ò»¸öÎı¾ÖУ¬ÐγÉ×¢²áÂëµÄÊý¾ÝÔ´×ÊÁÏ¡£Õâ¸ö×¢²áÔ´Êý¾Ý´®¿ÉÉÔ³¤Ò»Ð©£¬µ«²»Ò˹ý³¤£¬Ê¹Óû§Äܹ»Í¨¹ýµç×ÓÓÊÏä¡¢µç»°»òÐżþ˳Àûת¸ø¿ª·¢ÕßΪÒË¡£Èç±ÊÕß°²×°³ÌÐòÊÇÓãÃÓïÑÔ±àÖƵģ¬Èç¹û½«ÉÏÊöÄÚ´æµØÖ·×÷Ϊע²áÔ´£¬Êý¾Ý´®Îı¾ÎļþÃûΪKEYID.DOC£¬³¤¶ÈΪ20¸ö×Ö·û¡£ÆäʾÀý´úÂëÈçÏ£º
´úÂë:
FILE  *fp2;
    unsigned int keyrom[9];
    unsigned char buff[0x410];
    unsigned char pathstmp[80];
    unsigned char path[80]={"C:\\WBCOOL"};
    unsigned int far *pt=(unsigned int far*)0xf000fff6L;
    ......
    outportb(0x21,0x2);
    strcpy(pathstmp,path);
    strcat(pathstmp,"\\");
    strcat(pathstmp,"KEYID.DOC");
    for(i=0;i<5;i++)
      keyrom[i]=(*(pt+i)+0x1818)^0x5858;//µÚÒ»¼¶¼ÓÃÜËã·¨
    sprintf(buff,"KEYID:%04x%04x%04x%04x%04x",
      keyrom[0],keyrom[1],keyrom[2],keyrom[3],keyrom[4]);
    buff[0x1a]=0;
    if((fp2=fopen(pathstmp,"wb"))==NULL)
    {
      printf("FILE %s CREATE ERROR!",pathtmp);
    } else {
      fseek(fp2,0L,SEEK_SET);
      fprintf(fp2,"%s\xd\xa",buff);
      fclose(fp2);
    }
    outportb(0x21,0x0);

¶þ¡¢×¢²á»ú

¿ª·¢Õߵõ½Óû§ÌṩµÄ×¢²áÔ´Êý¾ÝÖ®ºó£¬¾ÍÐèÒªÀûÓÃ×¢²á»úÉú³É×¢²áÂë²¢·µ»Ø¸øÓû§¡£×¢²á»úÀûÓüȶ¨µÄλ²Ù×÷ºÍ²»¿ÉÄæËã·¨£¬ÐγÉÓû§±È½ÏÈÝÒײÙ×÷µÄ×Ö·û´®×¢²áÂ룬ע²áÂëµÄ³¤¶ÈÒ»°ãΪ8-16λΪÒË£¬Óû§Ö»Ðè×¢²áÒ»´Î¾Í¿ÉÒÔ³¤ÆÚʹÓã¬ËùÒÔ×¢²áÂëµÄ³¤¶È²»»áÓ°ÏìÓû§µÄ×¢²á²Ù×÷¡£µ±È»×¢²á»úµÄËã·¨Ó¦Óë¹²ÏíÈí¼þÖеÄËã·¨²¿·Ö»ù±¾Ïàͬ¡£¶ÔÓÚÔ¶³ÌÓû§£¬×¢²á»úÓ¦¸Ã¾ßÓдӼüÅ̺ÍÄÚ´æÁ½ÖÖÈ¡µÃ×¢²áÔ´Êý¾ÝµÄ¹¦ÄÜ£¬ËùÒÔ×¢²á»úµÄ¼ÓÃÜË㷨ʵ¼ÊΪÁ½¸ö·ÖÖ§£ºµÚÒ»¸ö·ÖÖ§ÊÇ´Ó¼üÅÌ»ñȡע²áÔ´Êý¾ÝºóÖ±½Ó¸ù¾Ý×¢²áËã·¨ÐγÉ×¢²áÂëµÄ¹ý³Ì£¬ÊÇÖ±½Ó¸øÔ¶³ÌÓû§·´À¡×¢²áÂëµÄ¹ý³Ì£»µÚ¶þ¸ö·ÖÖ§ÊÇÖ±½Ó´ÓROM BIOSÖиù¾Ý×¢²áÔ´Ë㷨ȡµÃ×¢²áÔ´Êý¾Ý£¬ÔÙ¸ù¾Ý×¢²áËã·¨ÐγÉ×¢²áÂëµÄ¹ý³Ì£¬ÊÇÖ±½Ó¶ÁÈ¡±¾µØ»ú×¢²áÂëµÄ¡£
Óû§µÃµ½×¢²áÂëºó£¬¸ù¾Ý¹²Ïí·¢²¼Èí¼þµÄ×¢²á·½·¨½øÐÐÒ»´Î×¢²á£¬Ó¦ÓóÌÐò»á×Ô¶¯½«Õâ¸ö×¢²áÂë´æ·Åµ½Èí¼þµÄÌض¨Î»Öô¦£¬µ±Ó¦ÓóÌÐò±»ËûÈË¿½±´µ½ÆäËü»úÆ÷ÖÐÈ¥ºó£¬ÓÉÓÚ×¢²áÂëÒò²»Í¬»úÆ÷¶øÒ죬ËùÒÔÓ¦ÓóÌÐòµÄ¹¦ÄÜ»òʹÓôÎÊýÈÔÈ»ÊÜÏÞ£¬ÒªÔÚÆäËü»úÆ÷ÖÐʹÓøÃÓ¦ÓóÌÐò£¬»¹±ØÐë½øÐÐÖØÐÂ×¢²á£¬´ïµ½¹²ÏíÈí¼þ·¢²¼Ä¿µÄ¡£Í¬Ê±ÓÉÓÚ×¢²áÔ´Êý¾ÝµÄËã·¨ºÍ×¢²áÂëËã·¨¾ù¿ÉÒòÈ˶øÒ죬Òò´ËÕâÖÖ·½·¨·Ç³£¿É¿¿¡£±¾ÈËʵÏÖµÄ×¢²á»ú´ø²ÎÊýʱ½ÓÊܼüÅÌÊäÈë×¢²áÔ´£»²»´øÈκβÎÊýʱ´Ó±¾µØ»úÆ÷ÄÚÖ±½Ó²É¼¯×¢²áÔ´Êý¾Ý¡£ÎÒµÄ×¢²á»úʾÀý³ÌÐòÈçÏ£º
´úÂë:
#include <conio.h>
#include <dos.h>
#include <io.h>
#include <dir.h>
#include <alloc.h>
#include <string.h>
#include <stdio.h>
#include <process.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
unsigned char Buff[18];
unsigned char Buff1[18];
unsigned int  keyrom[9];
unsigned int sum,sum1,sumi,sumj;
unsigned int far *pt=(unsigned int far *)0xf000fff6L;
unsigned int i=0,j=0,m,imecom;
unsigned char p;
unsigned int  nn,nn1,nn2;
unsigned char rbuff[100],cc,cc1,cc2;
int fp;
void main(int argc,char *argv[])
{
  if(argc>=2){
    printf("KEYID:");
    scanf("%s",rbuff);//½ÓÊܼüÅÌÊäÈëÔ¶³Ì×¢²áÔ´
    j=strlen(rbuff);
    if(j!=20) exit(1);
    for(i=0;i<20;i++){//¶ÁÈë20λע²áÔ´Êý¾Ý
      if((rbuff[i]>='a')&&(rbuff[i]<='f')) rbuff[i]&=0xdf;
      if((rbuff[i]>='A')&&(rbuff[i]<='F')) rbuff[i]-=0x37;
      else if((rbuff[i]>='0')&&(rbuff[i]<='9')) rbuff[i]-=0x30;
      else exit(1);
    }
    for(i=0;i<5;i++){//ÐγÉ×Ö·û´®
      cc1=rbuff[i*4]&0xf;
      cc2=rbuff[i*4+1]&0xf;
      cc=(cc1<<4)|cc2;
      nn1=(unsigned int)cc;
      cc1=rbuff[i*4+2]&0xf;
      cc2=rbuff[i*4+3]&0xf;
      cc=(cc1<<4)|cc2;
      nn2=(unsigned int)cc;
      nn=(nn1<<8)|nn2;
      keyrom[i]=nn;
    }
    sum=0x1234;
    sum1=0x7456;
    for(sumj=0;sumj<4;sumj++){//ÐγÉ16λע²áÂë
      for(sumi=0;sumi<5;sumi++){
        sum+=keyrom[sumi];    //ÐγÉÇ°4λÂë
        sum1+=keyrom[sumi];
      }
      sum^=0x1234<<sumj;      //½øÐÐÒÆλÒì»ò´¦Àí
      sum1^=0x7456<<sumj;
      sprintf(Buff+4*sumj,"%04x",sum);
      sprintf(Buff1+4*sumj,"%04x",sum1);
    }                         //ÐγÉ16λע²áÂë
    printf("\nWIN-KEY:");
    printf(Buff);
    printf("\nDOS-KEY:");
    printf(Buff1);
    exit(1);
  } else {
    sum=0x1234;
    sum1=0x7456;
    for(sumj=0;sumj<4;sumj++){//ÐγÉ16λע²áÂë
      for(sumi=0;sumi<5;sumi++){
        sum+=(*(pt+sumi)+0x1818)^0x5858;
        sum1+=(*(pt+sumi)+0x1818)^0x5858;
      }
      sum^=0x1234<<sumj;
      sum1^=0x7456<<sumj;//½øÐÐÒÆλÒì»ò´¦Àí
      sprintf(Buff+4*sumj,"%04x",sum);
      sprintf(Buff1+4*sumj,"%04x",sum1);
    }
    printf("\nWIN-KEY:");
    printf(Buff);
    printf("\nDOS-KEY:");
    printf(Buff1);
  }
}

Èý¡¢×¢²áÂë
µ±Óû§×¢²á³É¹¦ºó£¬×¢²áÂë¾Í±»Ð´µ½¹²ÏíÈí¼þµÄÏàӦλÖá£Õâʱ¹²ÏíÈí¼þ±ØÐë¶ÔÓû§×¢²áÂë½øÐÐʵʱ¼ì²âÓëÅжϣ¬²ÅÄÜʵÏÖ×¢²áÏÞÖƹ¦ÄÜ¡£ÕâʱҪÇó¹²ÏíÈí¼þ±ØÐëÄÚ²¿È¡µÃ×¢²áÔ´Êý¾Ý£¬²¢ÀûÓÃ×¢²á»úÖÐÏàͬµÄËã·¨²úÉúÄÚ²¿×¢²áÂë¡£Õâ¾ÍÒªÇó¹²ÏíÈí¼þÖ±½Ó¶ÁÈ¡ROM BIOSµÄ×¢²áÔ´ÐÅÏ¢£¬²¢ÔÚ¹²ÏíÈí¼þÖÐÐèÒªÏÞÖƵŦÄÜ´¦Ôö¼Ó×¢²áÂë¼ì²âÅжϹ¦ÄÜ£¬ÕâÐèÒª¸ù¾Ý¹²ÏíÈí¼þµÄʵ¼ÊÐèÒª¡¢Èí¼þ´óСºÍʵÏÖµÄÄÑÒ׳̶ÈÀ´È·¶¨ÏÞÖƵÄÊýÁ¿£¬Ê¹µÁ°æÕߺÜÄѽøÐнâÃÜ¡£ÕâÑù¼Èʹ¼ÆËã»úÖжà¸ö¹²ÏíÈí¼þʹÓÃÏàͬµÄ×¢²áÔ´£¬Ò²²»»á·¢Éú×¢²á³åÍ»ÎÊÌ⣻¼ÈʹÊÇʹÓÃÁËÏàͬµÄ×¢²áÔ´Êý¾Ý£¬ÓÉÓÚ×¢²áËã·¨µÄ²»Í¬×¢²áÂëÒ²²»»áÏàͬ£»¼´Ê¹½âÃÜÕßÖªµÀ×¢²áËã·¨µÄ×¢²áÔ´µØÖ·£¬ÓÉÓÚÎÞ·¨ÖªµÀ×¢²áËã·¨¶øÇÒ×¢²áµã±é²¼Õû¸ö¹²ÏíÈí¼þ£¬Ò²ºÜÄѽøÐеÁ°æ¡£Òò´Ë£¬ÕâÒ»×¢²á·½·¨Ê¹¹²ÏíÈí¼þÓÐЧµØ¿çÔ½¸÷ÖÖϵͳƽ̨¡£
ÒªÔÚ¹²ÏíÈí¼þÄÚ²¿²úÉú×¢²áÂ룬±ØÐëÔÚ¹²ÏíÈí¼þÖжÁÈ¡ROM BIOSÊý¾ÝÔ´ÄÚ´æÊý¾Ý¡£WINDOWS±£»¤Ä£Ê½Ï±ØÐëÀûÓöÎÑ¡Ôñ·û·½·¨ºÍAPI±à³Ì½Ó¿ÚÌṩµÄº¯Êý²ÅÄÜʵÏÖ£º
1.AllocSelector(Selector)·ÖÅäÒ»¸öÓë²ÎÊýÏàͬµÄ¿ÕÑ¡ÔñÆ÷
2.FreeSelector(Selector) ÊÍ·Å·ÖÅäµÄÑ¡ÔñÆ÷
3.SetSelectorBase() ÉèÖÃÑ¡ÔñÆ÷ÃèÊö·ûÎïÀíÆðʼµØÖ·
4.GetSelectorBase() »ñÈ¡Ñ¡ÔñÆ÷ÃèÊö·ûÎïÀíÆðʼµØÖ·
5.SetSelectorLimit() ÉèÖÃÑ¡ÔñÆ÷ÃèÊö·û·ÃÎʽçÏÞ
6.GetSelectorLimit() »ñÈ¡Ñ¡ÔñÆ÷ÃèÊö·û·ÃÎʽçÏÞ
ÆäÖк¯ÊýAllocSelector(Selector) ÊDZ£»¤Ä£Ê½ÏÂÎïÀíÄÚ´æ·ÃÎʵĹؼü£¬SelectorÊÇ·ÖÅä¿ÕÑ¡ÔñÆ÷µÄ¶Î¼Ä´æÆ÷Ä£°å£¬¿ÉÒÔÀûÓÃGlobalAlloc()º¯Êý·ÖÅäÄڴ棬ÔÙÀûÓÃGlobalHandleToSel()º¯Êý½«ÄÚ´æ¾ä±úת»»ÎªÏàӦѡÔñÆ÷£¬ÄÚ´æµ¥Ôª·ÃÎʽáÊøºóÔÙÀûÓÃGlobalFree()ÊÍ·Å·ÖÅäµÄÄÚ´æ¡£×î¼òµ¥µÄ·½·¨¾ÍÊǽ«ÏµÍ³µÄÊý¾Ý¶Î¼Ä´æÆ÷__DSÖ±½Ó×÷Ϊģ°å²ÎÊý£¬Õâ¸ö²ÎÊýÔÚÒ»°ãÓ¦ÓóÌÐòÖÐÍêÈ«¿ÉÒÔÕý³£Ê¹Óá£È»ºóÀûÓÃSetSelectorBase()ºÍSetSelectorLimit( )º¯Êý·Ö±ðÉèÖÃÄÚ´æµÄÎïÀíÆðʼµØÖ·ºÍ·ÃÎʽçÏÞÖµ£¬ÀûÓÃÕý³£µÄÖ¸Õë²Ù×÷*pt=ValueºÍValue=*pt·ÃÎÊÎïÀíÄÚ´æµ¥Ôª£¬·ÃÎʽáÊøºó±ØÐëʹÓÃFreeSelector()º¯ÊýÊÍ·Å·ÖÅäµÄÑ¡ÔñÆ÷£¬ÒòΪWINDOWS ²¢²»×Ô¶¯ÊÍ·ÅÎÞÓõÄÑ¡ÔñÆ÷£¬¶øÇÒϵͳµÄÑ¡ÔñÆ÷¹²Ïí×ÊÔ´ÊǷdz£ÓÐÏÞ£¬Ö»ÓÐ8192¸ö¹©Ê¹Ó᣸ù¾ÝÒÔÉÏÔ­Àí¼°×¢²á»úÖеÄ×¢²áÔ´ºÍ×¢²áÂëËã·¨£¬¾Í²»ÄÑʵÏÖ¹²ÏíÈí¼þÄÚ²¿×¢²áÂ뺯Êý£º
´úÂë:
UINT ImeCmpkey(void)
{ //¹²ÏíÈí¼þÄÚ²¿×¢²áÂë²úÉúº¯Êý
    static unsigned int sum;
    static BOOL  flag;
    static unsigned int far *pt;
    static UINT  Sel1,Sel2;
    static WORD  Seg,Off,Start;
    static DWORD Bas,Lim;
    flag=TRUE;
    sum=0x1234;
    __asm mov Sel1,ds;//½«DS×÷Ϊģ°å
    Sel2=AllocSelector(Sel1);//·ÖÅäÒ»¸öÐÂÑ¡Ôñ·û
    if(Sel2==NULL){
      flag=FALSE;
      pt=(unsigned int far*)0xf000fff0L;
    } else {
      Seg=0xffff;    //¾ø¶ÔµØÖ·¶ÎÖ·
      Off=0x10;      //¾ø¶ÔµØÖ·Æ«ÒÆ
      Start=0x0;
      Bas=((unsigned long)Seg)<<4|Start;
      Lim=(unsigned long)Off-1;
      SetSelectorBase(Sel2,Bas);
      SetSelectorLimit(Sel2,Lim);
      pt=(unsigned int far*)((((unsigned long)Sel2)<<16)|Start);
    }
    for(j=0;j<4;j++){//ÐγÉ16λע²áÂë
      for(i=0;i<5;i++) sum+=(*(pt+3+i)+0x1818)^0x5858;//ÐγÉÇ°4λ
      sum^=0x1234<<j;//½øÐÐÒÆλÒì»ò´¦Àí
      wsprintf((LPSTR)sImeG.ImeKey+4*j,(LPSTR)"%04x",sum);
    }
    if(flag==TRUE) FreeSelector(Sel2);
    sImeG.ImeKey[16]=0;//¶Ô×¢²áÂë±¾Éí¼ÓÃÜ
    for(i=16;i>0;i--) sImeG.ImeKey[16-i]^=(unsigned char)i;
    for(i=0;i<16;i++){ //ÅжÏ×¢²áÂë
      if(sImeG.ImeKey[i]!=lpImeL->ZcMyOk[i]) break;
    }
    if(i==16){
      sImeG.ZcFlag=FALSE;
      sImeG.ZcCount=0x0;
      lpImeL->UseNum=0x0;
      for(i=0;i<16;i++) sImeG.ImeKey[i]=0x0;
      return(0);
    } else {
      sImeG.ZcFlag=TRUE;
      sImeG.ZcCount=0x0;
      sImeG.iSel    = 1;
      sImeG.FScrCz  = TRUE;
      lstrcpy(sImeG.szSel[0],(LPSTR)"×¢²á£º_________________");
      sImeG.szSel[0][6]=0x11;
      sImeG.szSel[0][23]=0x0;
      UpdateInList();
      return(~0);
    }
}

ËÄ¡¢×¢²áµã
¹²ÏíÈí¼þÄÚ²¿×¢²áÂë²úÉúºó£¬ÐèÒª¶Ô¿¹µÁ°æµÄ×¢²áµãµÄ¶àÉÙÈ¡¾öÓÚ¹²ÏíÈí¼þµÄ×ÔÉí¼ÛÖµ¡¢¿ª·¢ÕߵļÓÃÜÉî¶ÈºÍÈí¼þʵÏֵĸ´Ôӳ̶ȵÈÖî¶àÒòËØ£¬Í¬Ê±ÕâÒ²¾ö¶¨ÁË×¢²áÌáʾÐÅÏ¢µÄÏÔʾƵ¶È£¬À´Ì×´ÅÓû§½øÐкϷ¨Ê¹Óᣵ«¾Í±ÊÕß×ÔÉí¶øÑÔ£¬ÖÁÉÙÓ¦¸Ã½«¹²ÏíÈí¼þÖÐʵÏÖÄѶȽϴó¡¢ÉîÊÜÓû§»¶Ó­ÒÔ¼°ÆÕ±éʹÓõŦÄܼÓÉÏ×¢²áµã¡£½¨Ò鲻ͬƽ̨֮¼äµÄ×¢²áÂëÒª·Ö±ðÉè¼Æ×¢²áËã·¨ºÍ×¢²áÂë¡£Æä´úÂëʾÀýÈçÏ£º
´úÂë:
    ×¢²áµãÒ»£º
    if(lpImeL->UseNum>=0x3f80){
      if(ImeCmpKey()==~0){
        sImeG.ZcFlag=TRUE;
      } else {
        sImeG.ZcFlag=FALSE;
        lpImeL->UseNum=0x0;
      }
    } else lpImeL->UseNum+=sImeG.iWord;
    ×¢²áµã¶þ£º
    if(ImeCmpKey()==~0){
      sImeG.ZcFlag=TRUE;
      return;
    } else {
      sImeG.ZcFlag=FALSE;
      lpImeL->UseNum=0x0;
    }


Îå¡¢×¢²á¿Ú
¶ÔÓÚ¹²ÏíÈí¼þ£¬²»¹ÜÆäʵÏÖºÎÖÖ¹¦ÄÜ£¬×îºÃ²ÉÈ¡ÔÙÏß×¢²á·½Ê½£¬ÕâÑù¿ÉÒÔ¼õÉÙÓû§ºÜ¶àÖظ´²Ù×÷¡£Í¬Ê±Ó¦¸Ã²ÉÈ¡¶à¸ö×¢²áÈë¿Ú£¬Èç±¾ÈËÈí¼þ¿ÉÒÔÔÚÔö¼Ó»òɾ³ý´Ê×éµÈʱ½øÐÐ×¢²á£¬Ö»ÒªÒ»´¦×¢²á³É¹¦Õû¸öÈí¼þ¾ÍËã×¢²á³É¹¦£¬²¢×¢Òâ¶Ô×¢²á¿ÚÊäÈëµÄ×¢²áÂë½øÐÐÔÙ¼ÓÃÜ´¦Àí¡£
±ÊÕß¹²ÏíÈí¼þÖÐ×¢²á¿Ú´úÂëʾÀý´úÂëÈçÏ£º
´úÂë:
   if(sImeG.ZcFlag==TRUE){
      if((cCharCode==0x8)||(cCharCode==0x4b)){
        if(sImeG.ZcCount>0){ //ɾ³ý¼ü´¦Àí
          if(sImeG.ZcCount<17)
            sImeG.szSel[0][sImeG.ZcCount+6]=0x5f;
          else sImeG.szSel[0][sImeG.ZcCount+6]=0x0;
          sImeG.ZcCount--;
          sImeG.szSel[0][sImeG.ZcCount+6]=0x11;
          lpImeL->ZcMyOk[sImeG.ZcCount]=0x0;
          sImeG.iSel = 0x1;
          sImeG.FScrCz  = TRUE;
          UpdateInList();
        } else MessageBeep(-1);
      } else if (cCharCode==0xd){//»Ø³µ¼ü´¦Àí
        if(sImeG.ZcCount==0x10){
          sImeG.ZcFlag=FALSE;
          sImeG.ZcCount=0x0;
          sImeG.iSel = 0x0;
          ScrnCode(sImeG.iStart);
          sImeG.FScrCz  = TRUE;
          UpdateInList();
          for(i=16;i>0;i--)
            lpImeL->ZcMyOk[16-i]^=(unsigned char)i;
          lpImeL->ZcMyOk[16]=0;
          for(i=0;i<16;i++){
            if(sImeG.ImeKey[i]!=lpImeL->ZcMyOk[i]) break;
          }
          if(i==16){//дÈë×¢²áÂë
            for(i=0;i<16;i++) sImeG.ImeKey[i]=0x0;
            j=GetSystemDirectory(FileName,80);
            if((j==0)||(j>64)){
              wsprintf((LPSTR)sImeG.ImeBuff,(LPSTR)"ϵͳ·¾¶·Ç·¨!");
              ErrMessageBox((LPSTR)sImeG.ImeBuff);
              for(i=0;i<16;i++) lpImeL->ZcMyOk[i]=0x0;
              ShowMessTs(8);
            } else {
              lstrcat(FileName,(LPSTR)"\\");
              lstrcat(FileName,(LPSTR)"WBCOOL.IME");
              if((hTmp=_lopen(FileName,READ_WRITE))==-1){
                wsprintf((LPSTR)sImeG.ImeBuff,(LPSTR)"³ÌÐò´ò¿ª³ö´í!");
                ErrMessageBox((LPSTR)sImeG.ImeBuff);
                for(i=0;i<16;i++) lpImeL->ZcMyOk[i]=0x0;
                ShowMessTs(8);
              } else {
                _llseek(hTmp,0x12345L,SEEK_SET);//12345Ϊע²áÂëµØÖ·
                _lwrite(hTmp,lpImeL->ZcMyOk,16);
                _lclose(hTmp);
                ShowMessTs(7);
              }
            }
          } else {
            for(i=0;i<16;i++){
              sImeG.ImeKey[i]=0x0;
              lpImeL->ZcMyOk[i]=0x0;
            }
            ShowMessTs(8);
          }
        } else MessageBeep(-1);
      } else if ((cCharCode>=0x30)&&(cCharCode<='~')){
        if(sImeG.ZcCount<16){
          if((cCharCode>='A')&&(cCharCode<='Z')) cCharCode^=0x20;
          lpImeL->ZcMyOk[sImeG.ZcCount]=cCharCode;
          sImeG.szSel[0][sImeG.ZcCount+6]=cCharCode;
          sImeG.ZcCount++;
          sImeG.szSel[0][sImeG.ZcCount+6]=0x11;
          sImeG.iSel = 0x1;
          sImeG.FScrCz  = TRUE;
          UpdateInList();
        } else MessageBeep(-1);
      } else MessageBeep(-1);
      return(iRet);
    }
×ÜÖ®£¬¹²Ïí·¢²¼Èí¼þµÄÖÆ×÷Ó¦×öµ½£º×¢²áԴҪѡ׼¡¢×¢²áËã·¨Òª¶à±ä¡¢×¢²áÂëÒªÔÙ¼ÓÃÜ¡¢×¢²á»úÒª¹ÜºÃ¡¢×¢²áµãÒª¶à·½Î»¡¢×¢²á·½Ê½ÒªÔÚÏß¡¢×¢²áÈë¿ÚÒª¶àµã¡£ÕâÑù²ÅÄÜÈ·±£Èí¼þµÄ°²È«¿É¿¿¡£


¡¾·µ»Ø¶¥²¿¡¿ ¡¾´òÓ¡±¾Ò³¡¿ ¡¾¹Ø±Õ´°¿Ú¡¿

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.00404