Hi
If someone can help me out, i will give a 1 month rapidshare or megaupload premium if ou can realy help me out ...
I have skype, just PM me if you are interested.
What i need ?
I want a tool thats read a .WDB file (wow cache) into variable, so i can use it to add into a mysql database.
I started, my i am stuck with the row lenght (bytes)
Code:
private void button1_Click(object sender, EventArgs e)
{
ASCIIEncoding encoder = new ASCIIEncoding();
ItemReader teader = new ItemReader();
byte[] file = teader.FileToArray("itemcache.wdb");
byte starting = file[0 + 24];
int test = 0;
int lengt = 0;
DataTable dt = new DataTable();
dataGridView1.DataSource = dt;
dt.Columns.Add("ID");
dt.Columns.Add("Name");
while (test < 5000)
{
int Id = file[(27 + test) & (26 + test) & (25 + test) & (24 + test)];
lengt = (file[(31 + test) & (30 + test) & (29 + test) & (28 + test)] * 25) / 10;
int namebyte = 24 + 20 + test;
string name = encoder.GetString(file, namebyte, 15);
MessageBox.Show(lengt.ToString());
DataRow anyRow = dt.NewRow();
anyRow["ID"] = Id;
anyRow["Name"] = name;
dt.Rows.Add(anyRow);
test = test + Convert.ToInt32(lengt);
}
}
AND
Code:
public Byte[] FileToArray(string sFilePath)
{
System.IO.FileStream fs = new System.IO.FileStream(sFilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
br.Close();
fs.Close();
return bytes;
}
Thanks