-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElfFileParser.cs
64 lines (52 loc) · 1.56 KB
/
ElfFileParser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// This file is part of bugreport.
// Copyright (c) 2006-2009 The bugreport Developers.
// See AUTHORS.txt for details.
// Licensed under the GNU General Public License, Version 3 (GPLv3).
// See LICENSE.txt for details.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
namespace bugreport
{
public sealed class ElfFileParser : IParsable,
IDisposable
{
private readonly Stream stream;
private readonly Byte[] textData;
public ElfFileParser(Stream stream)
{
this.stream = stream;
textData = new Byte[stream.Length];
}
#region IDisposable Members
public void Dispose()
{
if (null != stream)
{
stream.Dispose();
}
}
#endregion
#region IParsable Members
public UInt32 BaseAddress
{
get { return 0x080482e0; }
}
public UInt32 EntryPointAddress
{
get { return 0x080482e0; }
}
public ReadOnlyCollection<ReportItem> ExpectedReportItems
{
get { return new ReadOnlyCollection<ReportItem>(new List<ReportItem>()); }
}
public Byte[] GetBytes()
{
stream.Seek(0x2e0, SeekOrigin.Begin);
stream.Read(textData, 0, (Int32)(stream.Length - stream.Position));
return textData;
}
#endregion
}
}