Exemple #1
0
        public static int Compare(PESection x, PESection y)
        {
            if (!x.Name.Contains("$") && !y.Name.Contains("$"))
            {
                // COFF file ordinal is used as tie-breaker
                return(COFFTool.Compare(x.SourceCoff, y.SourceCoff));
            }

            // Always give preference to sections with no $
            else if (!x.Name.Contains("$") && y.Name.Contains("$"))
            {
                return(-1);
            }
            else if (x.Name.Contains("$") && !y.Name.Contains("$"))
            {
                return(1);
            }

            // If both have a $ grouping, order by $ suffix.
            else // (x.Name.Contains("$") && y.Name.Contains("$"))
            {
                string xdollar = x.Name.Substring(x.Name.IndexOf('$') + 1);
                string ydollar = y.Name.Substring(x.Name.IndexOf('$') + 1);

                int cmp = String.Compare(xdollar, ydollar);
                // COFF file ordinal is used as tie-breaker
                if (cmp == 0)
                {
                    return(COFFTool.Compare(x.SourceCoff, y.SourceCoff));
                }
                else
                {
                    return(cmp);
                }
            }
        }
Exemple #2
0
 public PESection(COFFTool coff, IMAGE_SECTION_HEADER header)
 {
     this.sourceCoff  = coff;
     this.header      = header;
     this.relocations = null;
 }
Exemple #3
0
 public static int Compare(COFFTool x, COFFTool y)
 {
     return(x.Ordinal.CompareTo(y.Ordinal));
 }
Exemple #4
0
 public static int Compare(COFFTool x, COFFTool y)
 {
     return x.Ordinal.CompareTo(y.Ordinal);
 }