home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / tools / zippatch / zippatch.c < prev    next >
C/C++ Source or Header  |  1999-12-08  |  693b  |  38 lines

  1. #include <my_tos.h>
  2. #include <my_defs.h>
  3.  
  4. char *value="12";
  5.  
  6. void main(void)
  7. {
  8. long ret,len;
  9. int handle;
  10.     ret=Fopen("ZIP.TTP",O_RDWR);
  11.     if(ret<0L)
  12.     {
  13.         Cconws("ABORT> Can't open ZIP.TTP");
  14.         return;
  15.     }
  16.     handle=(int)ret;
  17.     len=Fseek(0,handle,2);
  18.     if(len!=103678L)
  19.     {
  20.         Cconws("ABORT> File has not correct length. -> Unknown version");
  21.         Fclose(handle);
  22.         return;
  23.     }
  24.     Fseek(0xf238L,handle,0);
  25.     Fread(handle,2,value);
  26.     if((value[0]!='N')||(value[1]!='u'))
  27.     {
  28.         Fseek(0xf238L,handle,0);
  29.         Fwrite(handle,2,"Nu");
  30.         Cconws("File patched");
  31.     }
  32.     else
  33.         Cconws("File already patched");
  34.     Fclose(handle);
  35.     Cconws("\r\nPress any key to continue");
  36.     Cnecin();
  37.     return;
  38. }