Example #1
0
        public static bool TryLoad <T>(string fileName, out ELF <T> elf) where T : struct
        {
            switch (CheckELFType(fileName))
            {
            case Class.Bit32:
            case Class.Bit64:
                elf = new ELF <T>(fileName);
                return(true);

            default:
                elf = null;
                return(false);
            }
        }
Example #2
0
        public static bool TryLoad <T>(Stream stream, bool shouldOwnStream, out ELF <T> elf) where T : struct
        {
            switch (CheckELFType(stream))
            {
            case Class.Bit32:
            case Class.Bit64:
                elf = new ELF <T>(stream, shouldOwnStream);
                return(true);

            default:
                elf = null;
                return(false);
            }
        }
Example #3
0
        public static bool TryLoad(string fileName, out IELF elf)
        {
            switch (CheckELFType(fileName))
            {
            case Class.Bit32:
                elf = new ELF <uint>(fileName);
                return(true);

            case Class.Bit64:
                elf = new ELF <long>(fileName);
                return(true);

            default:
                elf = null;
                return(false);
            }
        }
Example #4
0
        public static bool TryLoad(Stream stream, bool shouldOwnStream, out IELF elf)
        {
            switch (CheckELFType(stream))
            {
            case Class.Bit32:
                elf = new ELF <uint>(stream, shouldOwnStream);
                return(true);

            case Class.Bit64:
                elf = new ELF <ulong>(stream, shouldOwnStream);
                return(true);

            default:
                elf = null;
                return(false);
            }
        }
Example #5
0
 public static bool TryLoad <T>(string fileName, out ELF <T> elf) where T : struct
 {
     return(TryLoad <T>(File.OpenRead(fileName), true, out elf));
 }