title: SQLite3 Data rescue on Error: Database disk image is malformed
body: <h2>Background</h2>
  
  <p>I have a database thats been corrpted, and want to save so much of the data possible.</p>
  
  <p>I have tried sql dump the data with numerous of tools, without success.
  Always same error message:  </p>
  
  <blockquote>
    <p>Error: database disk image is malformed</p>
  </blockquote>
  
  <p>I'm pretty sure this did happen due to a power failure.</p>
  
  <h2>Approach?</h2>
  
  <p>Now the the database is in fact a file. And I'm thinking if its possible to treat it so and try to save so much data as possible.</p>
  
  <p>I guessing when the db is opened by a tool or program it first check its headers.
  In my case I get the error message right away. I'm assuming that the headers are corrupt, or miss matching. And due to that no tool will try to read the payload.</p>
  
  <p>In the documents <a href="http://www.sqlite.org/fileformat2.html" rel="noreferrer">http://www.sqlite.org/fileformat2.html</a> there are explanations for the header offsets.</p>
  
  <p><strong>Questions</strong>: Is this is an reasonable approach? And if it possible to repair, modify or exchange headers on the corrupted db. And how do I do it? </p>