Ejemplo n.º 1
0
 internal void loadInstructions(MetaDataLoader mdLoader,
                                PELoader peLoader,
                                Stream fileStream,
                                int[] lines,
                                int[] columns,
                                int[] offsets,
                                String srcFileName,
                                int count)
 {
     if (this.rva != 0)
     {
         if ((this.flags & (short)MethodAttributes.PinvokeImpl) == 0 ||
             (this.flags & (short)MethodAttributes.UnmanagedExport) != 0)
         {
             int codeOffset = peLoader.VaToOffset(rva);
             this.instructions =
                 Instruction.getInstructions(mdLoader, fileStream,
                                             codeOffset, lines, columns,
                                             offsets, srcFileName, count,
                                             out this.ehTable,
                                             out this.bbTable,
                                             out this.maxStack,
                                             out this.locals,
                                             out this.initLocals);
         }
         else
         {
             Console.WriteLine("Not loading embedded native code for " +
                               this);
         }
     }
 }
Ejemplo n.º 2
0
            public void LoadSection(PELoader peLoader)
            {
                Stream fileStream = peLoader.getStream();

                fileStream.Seek(peLoader.VaToOffset(header.virtualAddress), SeekOrigin.Begin);
                BinaryReader reader = new BinaryReader(fileStream);

                this.rawData = reader.ReadBytes(header.sizeOfRawData);
            }