How to Compile and Run PeToPe

CCI Metadata

The complete PeToPe sample, including a Visual Studio 2008 project file, is in the CCI Metadata source tree under the Samples folder.

To compile and run PeToPe:
  1. If you have not done so already, download the CCI Metadata source tree. For details on how to download the CCI Metadata sources, see Getting Started.
  2. In the source tree’s root folder, double-click the tree’s Visual Studio 2008 solution file, Metadata.sln. This solution encompasses the entire source tree, including the samples.
  3. If you have not done so already, build the entire source tree. This builds the CCI Metadata DLLs that the sample requires, along with the PeToPe application, PeToPe.exe.
  4. To view the complete PeToPe source code, go to Solution Explorer and expand the Samples folder, which contains all the CCI Metadata samples.
  5. To run PeToPe, open a command window, navigate to the PeToPe project’s bin\Debug folder, and run PeToPe.exe against a .NET DLL or EXE.
The following example runs PeToPe against one of the CCI MetadataHelper DLLs and its associated PDB file, which are in the PeToPe project’s Debug folder.
...\Debug>PeToPe.exe Microsoft.Cci.MetadataHelper.dll

PeToPe creates copies of the DLL and PDB files and names them and Microsoft.Cci.MetadataHelper.dll.pdb.

Note: You do not explicitly pass a PDB file to PeToPe. Instead, PeToPe assumes that the PDB file has the same name as the input PE file (except for the extension), and is located in the same folder. If the folder doesn’t contain an appropriately named PDB file, PeToPe simply makes a copy of the input PE file.

Last edited Jan 12, 2010 at 3:27 PM by Guy_Smith, version 1


No comments yet.