Hi all,
I am creating a parser for a pdb taken from a palm device. Though I am having
trouble reading the record entry List.
Everything works up to the point where I try to parse the record entry list.
Here's my code:
-------
class RecordList
{
public UInt32 nextRecordListID;
public UInt16 numRecords;
public SortedList<UInt32, RecordEntry> recordEntries;
public UInt16 placeHolderBytes;
public RecordList(BinaryReader br)
{
nextRecordListID = br.ReadUInt32();
numRecords = br.ReadUInt16();
recordEntries = new SortedList<UInt32, RecordEntry>();
Console.Out.WriteLine("NumRecords: "+numRecords+"; IDChunk:" +
nextRecordListID);
for (int i = 0; i < numRecords; i++)
{
RecordEntry ent = new RecordEntry(br);
recordEntries.Add(ent.dataOffset,ent);
}
placeHolderBytes = br.ReadUInt16();
}
....}
class RecordEntry
{
public UInt32 dataOffset;
public Byte attributes;
public Byte[] uniqueID;
public RecordEntry(BinaryReader br)
{
dataOffset = br.ReadUInt32();
attributes = br.ReadByte();
uniqueID = br.ReadBytes(3);
Console.Out.WriteLine("Offset: " + dataOffset);
}
}
----------------------
I am parsing up to NumRecords fine... but for some reason I get huge numbers
for my offsets. I think I'm inturpreting the offset wrong... but am not quite
sure what to do.
NumRecords: 9; IDChunk:0
Offset: 1083703296
Offset: 1086324736
Offset: 1088946176
Offset: 1074135296
Offset: 1076101376
Offset: 1078067456
Offset: 1079116032
Offset: 1081082112
Offset: 1083048192
In the documentation it states:
typedef struct{
LocalID localChunkID;
UInt8attributes;
UInt8uniqueID[3];
}RecordEntryType;
I'm not quite sure what LocalID is... I assumed it was just a UInt32.
Though I think I may be wrong in doing this... how do I use the 4 bytes
localChunkID to give me the offset of the data?
Thanks for your time.
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/