Example #1
0
        public NativeLibrary FindOrCreateLibrary(string file)
        {
            var library = Libraries.Find(m => m.FileName.Equals(file));

            if (library == null)
            {
                library = new NativeLibrary(file);
                Libraries.Add(library);
            }

            return library;
        }
Example #2
0
        public static AST.NativeLibrary ConvertLibrary(NativeLibrary library)
        {
            var newLibrary = new AST.NativeLibrary
            {
                FileName = library.FileName,
                ArchType = (ArchType)library.ArchType
            };

            for (int i = 0; i < library.SymbolsCount; ++i)
            {
                var symbol = library.GetSymbols(i);
                newLibrary.Symbols.Add(symbol);
            }
            for (int i = 0; i < library.DependenciesCount; i++)
            {
                newLibrary.Dependencies.Add(library.GetDependencies(i));
            }

            return(newLibrary);
        }
Example #3
0
 public bool FindLibraryBySymbol(string symbol, out NativeLibrary library)
 {
     return Symbols.TryGetValue(symbol, out library);
 }
Example #4
0
        public static AST.NativeLibrary ConvertLibrary(NativeLibrary library)
        {
            var newLibrary = new AST.NativeLibrary { FileName = library.FileName };

            foreach (var symbol in library.Symbols)
                newLibrary.Symbols.Add(symbol);

            return newLibrary;
        }
Example #5
0
 public bool FindLibraryBySymbol(string symbol, out NativeLibrary library)
 {
     return(Symbols.TryGetValue(symbol, out library));
 }
Example #6
0
 public bool FindLibraryBySymbol(string symbol, out NativeLibrary library) =>
 Symbols.TryGetValue(symbol, out library) ||
 Symbols.TryGetValue("_" + symbol, out library) ||
 Symbols.TryGetValue(symbol.TrimStart('_'), out library) ||
 Symbols.TryGetValue("_imp_" + symbol, out library) ||
 Symbols.TryGetValue("__imp_" + symbol, out library);