Example #1
0
 private bool ReadDeferredLoadDescriptors(ImageReader rdr, Address addrLoad)
 {
     var attributes = rdr.ReadLeUInt32();
     var dllName = ReadUtf8String(rdr.ReadLeUInt32(), 0);    // DLL name.
     if (dllName == null)
         return false;
     var rdrModule = rdr.ReadLeInt32();
     var rdrThunks = imgLoaded.CreateLeReader(rdr.ReadLeUInt32());
     var rdrNames = imgLoaded.CreateLeReader(rdr.ReadLeUInt32());
     for (;;)
     {
         var addrThunk = imgLoaded.BaseAddress + rdrThunks.Offset;
         uint rvaName = rdrNames.ReadLeUInt32();
         uint rvaThunk = rdrThunks.ReadLeUInt32();
         if (rvaName == 0)
             break;
         importReferences.Add(
             addrThunk, 
             innerLoader.ResolveImportedFunction(dllName, rvaName, addrThunk));
     }
     rdr.ReadLeInt32();
     rdr.ReadLeInt32();
     rdr.ReadLeInt32();  // time stamp
     return true;
 }
Example #2
0
 private EntryPoint LoadEntryPoint(Address addrLoad, ImageReader rdrAddrs, ImageReader rdrNames)
 {
     uint addr = rdrAddrs.ReadLeUInt32();
     int iNameMin = rdrNames.ReadLeInt32();
     int j;
     for (j = iNameMin; imgLoaded.Bytes[j] != 0; ++j)
         ;
     char[] chars = Encoding.ASCII.GetChars(imgLoaded.Bytes, iNameMin, j - iNameMin);
     return new EntryPoint(addrLoad + addr, new string(chars), arch.CreateProcessorState());
 }
Example #3
0
 private ImageSymbol LoadEntryPoint(Address addrLoad, ImageReader rdrAddrs, ImageReader rdrNames)
 {
     uint rvaAddr = rdrAddrs.ReadLeUInt32();
     int iNameMin = rdrNames.ReadLeInt32();
     int j;
     for (j = iNameMin; imgLoaded.Bytes[j] != 0; ++j)
         ;
     char[] chars = Encoding.ASCII.GetChars(imgLoaded.Bytes, iNameMin, j - iNameMin);
     return new ImageSymbol(addrLoad + rvaAddr)
     {
         Name = new string(chars),
         ProcessorState = arch.CreateProcessorState(),
         Type = SymbolType.Procedure,
     };
 }