title: read boot sector using C on windows8
body: <p>i tried to read the boot sector using this program </p>
  
  <pre><code>int lire_secteur(int num_sect,unsigned char* buf)
  {
  int retCode = 0;
  unsigned char secteur[512];
  char disque[10]   ;
  char partition ;
  FILE* device ;
  do
  {
      disque[0]='\0'  ;       
      scanf("%c",&amp;partition) ;
      if (partition=='0')
      {
          strcpy(disque,"\\\\.\\PHYSICALDRIVE0") ;
      }
      else
      {
          sprintf(disque,"\\\\.\\%c:",partition) ;
      }
      device = fopen(disque, "rb+");
  }
  
  while (device == NULL) ;
  fseek( device,num_sect*512 , SEEK_SET );
  if (fread (secteur, 512,1, device) &lt; 1)
  {
      printf("erreur\n");
      return 1 ;
  }
  else
  {
      memcpy(buf,secteur, 512);
      retCode=0;
  }
  return retCode;
  }
  </code></pre>
  
  <p>i have successfully read all sectors in the hard drive but when i want to read the boot sector i have this:
  <img src="https://i.stack.imgur.com/1GXhd.jpg" alt="enter image description here"></p>
  
  <p>is the problem in my code or it'is due to windows8 ? </p>