Posted by Anonymous Thu 1st Mar 2007 00:50 - Syntax is C - 53 views
Download | New Post | Modify | Hide line numbers
Description:
found this somewhere

  1.  
  2. /* patch your proxy with this and it might work with ruff rose again */
  3.  
  4. #include
  5. #include
  6. #include
  7.  
  8. int main(int argc, char *argv[]){
  9.   if (argc < 2){
  10.     printf("usage: proxypatch \n");
  11.     return 0;
  12.   }
  13.  
  14.   FILE *i=fopen(argv[1], "rb");
  15.   if (!i){
  16.     printf("could not open input file!\n");
  17.     return 0;
  18.   }
  19.  
  20.   char fn[512];
  21.   snprintf(fn, 512, "%s-patched.exe", argv[1]);
  22.   FILE *o=fopen(fn, "wb");
  23.   if (!o){
  24.     fclose(i);
  25.     printf("could not open output file!\n");
  26.     return 0;
  27.   }
  28.  
  29.   unsigned char c[32] = {0x00,0x5e,0xbc,0xe2,0x61,0x3f,0xdd,0x83,0xc2,0x9c,0x7e,0x20,0xa3,0xfd,0x1f,0x41,
  30.                          0x9d,0xc3,0x21,0x7f,0xfc,0xa2,0x40,0x1e,0x5f,0x01,0xe3,0xbd,0x3e,0x60,0x82,0xdc};
  31.   unsigned char b[32];
  32.   bool f=false;
  33.   int n;
  34.   while (!feof(i)){
  35.     n=fread(b,1,32,i);
  36.      
  37.     if (memcmp(b,c,32) == 0 && n == 32){
  38.       f=true;
  39.       for(int k=0;k<32;k++)
  40.         b[k]=k;
  41.        
  42.       fwrite(b,1,32,o);
  43.     } else {
  44.       fwrite(b,1,n,o);
  45.     }
  46.   }
  47.  
  48.   fclose(o);
  49.   fclose(i);
  50.  
  51.   if (!f){
  52.     printf( "signature not found, can't be patched!\n" );
  53.     unlink( fn );
  54.   } else {
  55.     printf( "file patched, written to: %s\n", fn );
  56.   }
  57.  
  58.   return 0;
  59. }
  60.  

PermaLink to this entry https://pastebin.co.uk/11184
Posted by Anonymous Thu 1st Mar 2007 00:50 - Syntax is C - 53 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0