title: Reading .PAK files with c#
body: <p>I want my app capable of detecting when a certain string is contained in one line, after that, it will return the line number and subtract 8. Then it will search line by line (again) until it <strong>reached the line obtained before, read it,</strong> and <strong>show it</strong> on a messagebox*(the whole line)*.</p>
  
  <p>It always detects the line with the asked string and subtracts 8 to it. The problem, is that <strong>returns an empty string</strong> every time! I'v tried many different things, and always comes an <strong>empty</strong> string. In some lines it returns chars like ";" or "&lt;".</p>
  
  <p>However, all this, must be done to a <strong>.PAK file.</strong> The file has +- 4Gb of size, The speed is not relevant in the case.</p>
  
  <p>Preview of te first lines of the PAK file: <strong><a href="https://imgur.com/1GFBPlN" rel="nofollow noreferrer">https://imgur.com/1GFBPlN</a></strong></p>
  
  <p>Preview of the code:</p>
  
  <pre><code>int counter = 0;
              string line;
              int linhaM = 8;
              int Possivel = 0;
              bool FindCID = false;
              string str = "";
  
              System.IO.StreamReader file =
                  new System.IO.StreamReader("C:/Program Files/mypersonalpath/pakchunk0-WindowsClient.pak");
  
              while ((line = file.ReadLine()) != null)
              {
                  if (line.Contains("Stringxyz"))
                  {                  
                      MessageBox.Show(counter.ToString());
                      break;
                  }
  
                  counter++;
              }
  
              linhaM = counter;
              Possivel = counter -8;
              MessageBox.Show(Possivel.ToString());
              counter = 0;
  
              while (((line = file.ReadLine()) != null) &amp;&amp; FindCID == false)
              {
                  if (counter == Possivel)
                  {
                      MessageBox.Show("The line 8 lines above the line that contains stringxyz is: " + line);
  
                      break;
                  }
  
                  counter++ ;
  
              }
              file.Close();
              textBox1.Text = str;
          }
  </code></pre>
  
  <p>Am I treating PAK files in a wrong way? What am I doing wrong? Is what i'm asking for possible? Thanks</p>
  
  <p>(This is my first time asking a question here, sorry if I did anything wrong)</p>