-
Notifications
You must be signed in to change notification settings - Fork 28
Description
https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html
Padding is present, if necessary, to ensure 4-byte alignment for the descriptor. Such padding is not included in namesz.
Thats done correctly here with NameSize:
| int nameEnd = reader.Position + (int)note.NameSize; |
But the 4-byte padding to the next note is not considered.
The first descsz bytes in desc hold the note descriptor. If no descriptor is present, descsz contains the value zero. Padding is present, if necessary, to ensure 4-byte alignment for the next note entry. Such padding is not included in descsz.
descsz also needs to be 4 byte padded same as name.
Ghetto fix
SharpDebug/Source/SharpDebug.DwarfSymbolProvider/ElfCoreDump.cs
Lines 115 to 117 in 0a19533
| string name = reader.ReadString(); | |
| reader.Position = nameEnd; | |
| byte[] content = reader.ReadBlock(note.n_descsz); |
string name = reader.ReadString();
reader.Position = nameEnd;
int descEnd = reader.Position + (int)note.DescSizeWithPadding;
byte[] content = reader.ReadBlock(note.n_descsz);
reader.Position = descEnd;Will make a pull request someday when I get the time for it