home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / tools / nsk.arj / FTRACE / TRACER.C < prev   
Encoding:
C/C++ Source or Header  |  1992-01-20  |  2.1 KB  |  76 lines

  1. /*******************************************
  2. *                                          *
  3. *    Åα«úαá¼á TRACER                    *
  4. *    éÑαß¿∩ 3.1                         *
  5. *    ìỿßá¡á Å«Γá¡¿¡δ¼ î. ₧.           *
  6. ********************************************/
  7. #include"ftrace.h"
  8. #include"cpu.h"
  9.  
  10. #include<stdio.h>
  11. #include<stdlib.h>
  12. #include<alloc.h>
  13. #include<process.h>
  14.  
  15. int steptest(void);
  16.  
  17. void inittrace(funct t);
  18. void texit(int);
  19.  
  20. void main(int argv,char ** argc)
  21. {
  22.  unsigned int num,max,min;
  23.  
  24.  puts("TRACER Vercion 3.1\nMake by M.Potanin.\n");
  25.  
  26.  switch(argv)
  27.  {
  28.   char * x;
  29.   case 3: num=(unsigned)strtoul(argc[1],&x,16);
  30.           if(argc[1] == x) goto erri;
  31.           switch(*(argc[2]))
  32.           {
  33.            case 'l':
  34.            case 'L':min = (unsigned)strtoul(argc[2]+1,&x,16);
  35.                     if(argc[2]+1 == x) goto erri;
  36.                     max = 0xffff;
  37.                     break;
  38.            default:max = (unsigned)strtoul(argc[2]+1,&x,16);
  39.                     if(argc[2]+1 == x) goto erri;
  40.                     min = 0;
  41.                     break;
  42.           }
  43.           break;
  44.   case 4: num=(unsigned)strtoul(argc[1],&x,16);
  45.           if(argc[1] == x) goto erri;
  46.           switch(*(argc[2]))
  47.           {
  48.            case 'l':
  49.            case 'L':min = (unsigned)strtoul(argc[2]+1,&x,16);
  50.                     if(argc[2]+1 == x) goto erri;
  51.                     max = (unsigned)strtoul(argc[3]+1,&x,16);;
  52.                     if(argc[2]+1 == x) goto erri;
  53.                     break;
  54.            default:max = (unsigned)strtoul(argc[2]+1,&x,16);
  55.                     if(argc[2]+1 == x) goto erri;
  56.                     min = (unsigned)strtoul(argc[3]+1,&x,16);;
  57.                     if(argc[2]+1 == x) goto erri;
  58.                     break;
  59.           }
  60.           break;
  61.   default:
  62.   erri:
  63.        puts("TRACER hex_int_num {l|m}hex_seg");
  64.        exit(3);
  65.   }
  66.  
  67.  inittrace((funct)getvect(num));
  68.  
  69.  while((topstack->CS_IP.Words.cs < max) &&
  70.        (topstack->CS_IP.Words.cs > min))
  71.  {
  72.  if(steptest()){puts("Error.");texit(1);}
  73.  }
  74.  setvect(num,(interr)(adress));
  75.  texit(0);
  76. }