Skip to content

Commit

Permalink
Some cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkinsella committed Jun 19, 2016
1 parent b49715e commit 0357b8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 87 deletions.
2 changes: 0 additions & 2 deletions Src/Demo Application/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ static void Main(string[] args)

ExecutableImage image = ExecutableImage.FromFile(file_name);

/*
LoadConfigDirectory load_config = LoadConfigDirectory.Get(image);
Certificate cert = Certificate.Get(image);
DebugDirectory debug_dir = DebugDirectory.Get(image);
Expand All @@ -56,7 +55,6 @@ static void Main(string[] args)
Imports imports = Imports.Get(ilt,hint_name_table);

Resources resources = Resources.Get(image);
*/

CLR clr = CLR.Get(image);
CLRHeader header = CLRHeader.Get(clr);
Expand Down
85 changes: 0 additions & 85 deletions Src/Workshell.PE/Content/CLR/CLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,93 +39,8 @@ public static CLR Get(ExecutableImage image)
return result;
}

/*
public static CLRMetaData GetMetaData(CLRHeader header)
{
LocationCalculator calc = header.CLR.DataDirectory.Directories.Image.GetCalculator();
ulong image_base = header.CLR.DataDirectory.Directories.Image.NTHeaders.OptionalHeader.ImageBase;
uint rva = header.MetaDataAddress;
ulong va = image_base + rva;
ulong offset = calc.RVAToOffset(rva);
uint size = header.MetaDataSize;
Section section = calc.RVAToSection(rva);
Location location = new Location(offset, rva, va, size, size, section);
//CLRMetaDataHeader meta_data_header = new CLRMetaDataHeader(this, header);
//CLRMetaDataStreamTable stream_table = new CLRMetaDataStreamTable(this, imageBase);
//CLRMetaDataStreamCollection streams = new CLRMetaDataStreamCollection(this, imageBase);
CLRMetaData meta_data = new CLRMetaData(header.CLR, location, header);
return meta_data;
}
*/

#endregion

}

/*
public sealed class CLRContent : DataDirectoryContent
{
private CLRHeader header;
private CLRMetaData meta_data;
internal CLRContent(DataDirectory dataDirectory, ulong imageBase) : base(dataDirectory, imageBase)
{
LocationCalculator calc = DataDirectory.Directories.Reader.GetCalculator();
Stream stream = DataDirectory.Directories.Reader.GetStream();
LoadHeader(calc, stream, imageBase);
LoadMetaData(calc, stream, imageBase);
}
#region Methods
private void LoadHeader(LocationCalculator calc, Stream stream, ulong imageBase)
{
ulong offset = calc.RVAToOffset(DataDirectory.VirtualAddress);
uint size = Convert.ToUInt32(Utils.SizeOf<IMAGE_COR20_HEADER>());
Location location = new Location(offset,DataDirectory.VirtualAddress,imageBase + DataDirectory.VirtualAddress,size,size);
Section section = calc.RVAToSection(DataDirectory.VirtualAddress);
stream.Seek(Convert.ToInt64(offset),SeekOrigin.Begin);
IMAGE_COR20_HEADER clr_header = Utils.Read<IMAGE_COR20_HEADER>(stream,Convert.ToInt32(size));
header = new CLRHeader(this,clr_header,location,section);
}
private void LoadMetaData(LocationCalculator calc, Stream stream, ulong imageBase)
{
meta_data = new CLRMetaData(this,imageBase);
}
#endregion
#region Properties
public CLRHeader Header
{
get
{
return header;
}
}
public CLRMetaData MetaData
{
get
{
return meta_data;
}
}
#endregion
}
*/

}

0 comments on commit 0357b8a

Please sign in to comment.