public CodeInMemoryLayout(ulong imageBaseAddress, ulong offsetOfCodeInBytes, ulong codeActualSizeInBytes,
                           ulong codePhysicalSizeInBytes, ulong entryPointOffset, ulong codeVirtualAddress,
                           IRelocationDirectoryInfo relocationDirectoryInfo)
 {
     ImageBaseAddress        = imageBaseAddress;
     OffsetOfCodeInBytes     = offsetOfCodeInBytes;
     CodeActualSizeInBytes   = codeActualSizeInBytes;
     CodePhysicalSizeInBytes = codePhysicalSizeInBytes;
     EntryPointOffset        = entryPointOffset;
     CodeVirtualAddress      = codeVirtualAddress;
     RelocationDirectoryInfo = relocationDirectoryInfo;
 }
 public ICodeInMemoryLayout Create(ulong imageBaseAddress,
                                   ulong offsetOfCodeInBytes, ulong codeActualSizeInBytes,
                                   ulong codePhysicalSizeInBytes, ulong entryPointOffset,
                                   ulong codeVirtualAddress, IRelocationDirectoryInfo relocationDirectoryInfo)
 {
     return(Container.Container.Resolve <ICodeInMemoryLayout>(
                new Parameter(nameof(imageBaseAddress), imageBaseAddress),
                new Parameter(nameof(relocationDirectoryInfo), relocationDirectoryInfo),
                new Parameter(nameof(offsetOfCodeInBytes), offsetOfCodeInBytes),
                new Parameter(nameof(codeActualSizeInBytes), codeActualSizeInBytes),
                new Parameter(nameof(codePhysicalSizeInBytes), codePhysicalSizeInBytes),
                new Parameter(nameof(entryPointOffset), entryPointOffset),
                new Parameter(nameof(codeVirtualAddress), codeVirtualAddress)));
 }
        public IRelocationDirectoryInfo CreateNewRelocationDirectoryInfo(ICode code)
        {
            //in case there is not directory info
            if (code.CodeInMemoryLayout.RelocationDirectoryInfo == null)
            {
                return(null);
            }

            List <RelocationTypeOffset> relocationTypeOffetList = CreateNewRelocationList(code);

            IRelocationDirectoryInfo directoryInfo = CreateDirectoryInfoFromList(
                relocationTypeOffetList, code, m_ImageBaseRelocationSerializer, m_relocationDirectoryInfoFactory);

            return(directoryInfo);
        }