For getDumpString(), it is an awesome function, but I think this would be better
public static string getDumpString(BinaryReader input, UInt32 pointer)
{
pointer &= 0x0FFFFFFF; //this
input.BaseStream.Seek(pointer, SeekOrigin.Begin);
return readNullTerminatedString(input);
}
before it was pointer -=0x80000000; and I was having trouble with it. The fault was mine though..I was passing an array with the pointers already minused. >.> My solution at the time was to add the 80000000 back before passing it, but after playing are with it for a while and learning about AND and masking, I made dumpAscii(). While writing that I remembered my huge array hat I don't feel like fixing, but I wanted dumpAscii() to be more useful than to just titles...And if I wanted to dump names for whatever reason, I'd have to change dumpAscii(). So I remembered looking at swap to learn how it works and:
public static void DumpAscii(BinaryReader binread, string outtxt, UInt32 beginTable , UInt32 endTable)
{
string arrayout = Path.GetDirectoryName("DUMP80.BIN");
arrayout = Path.Combine(arrayout, outtxt);
TextWriter arraywrite = new StreamWriter(arrayout, true);
int t = 0;
//incase I do that thing with the array again
beginTable &= 0x0FFFFFFF;
endTable &= 0x0FFFFFFF;
while (beginTable <= endTable)
{
if (binread.BaseStream.Position >= binread.BaseStream.Length) break;
binread.BaseStream.Seek(beginTable, SeekOrigin.Begin);
UInt32 pointerHere = Swap(binread.ReadUInt32());
string txtTable = getDumpString(binread, pointerHere);
arraywrite.WriteLine(String.Format("{0:x2}", t).ToUpper() + " = " + txtTable);//8bit digit
//arraywrite.WriteLine(String.Format("{0:x4}", t).ToUpper() + " = " + txtTable);//16bit digit
//arraywrite.WriteLine(String.Format("{0:x8}", t).ToUpper() + " = " + txtTable);//32bit...wut?
beginTable += 0x4;
t++;
}
arraywrite.WriteLine();
arraywrite.Flush();
arraywrite.Close();
return;
}
So I remembered the getDumpString(). I'm sure there will never be a time when you have to read past 0FFFFFFFF.
Also, the attachment doesn't work. I could put what I have in my dropbox when I get home.