Exemplo n.º 1
0
        private void ExtractToWindow(ref string moduleData)
        {
            String str = moduleName;

            int index = FindModuleInDictionary(dictionary, moduleName, 0, MatchType.full);

            if (index < 0)
            {
                return;
            }

            DictionaryEntry entry = dictionary.entries[index];

            libStatus status = GetModuleFromLibrary(dictionary, entry, ref moduleData);
        }
Exemplo n.º 2
0
        private Module FindModuleInLibraries(string moduleName, MatchType matchType)
        {
            int             index       = -1;
            string          libFileName = "";
            string          moduleData  = "";
            DictionaryEntry entry       = new DictionaryEntry();
            Module          module      = new Module();

            foreach (string libraryFileName in libraryFiles)
            {
                if (File.Exists(libraryFileName))
                {
                    libFileName = libraryFileName;
                    FileStream   inFile     = new FileStream(libFileName, FileMode.Open, FileAccess.Read);
                    DcDictionary dictionary = new DcDictionary();
                    GetDictionary(inFile, dictionary);
                    index = FindModuleInDictionary(dictionary, moduleName, 0, matchType);
                    inFile.Close();
                    if (index >= 0)
                    {
                        entry = dictionary.entries[index];
                        libStatus status = GetModuleFromLibrary(dictionary, entry, ref moduleData);
                        break;
                    }
                }
            }
            if (index >= 0)
            {
                Console.WriteLine("Found. Index = " + index + " in library file " + libFileName);
                module.processed = false;
                module.found     = true;
                module.inLibrary = true;
                module.fName     = libFileName;
                module.index     = index;
                module.name      = entry.name;
                module.data      = moduleData;
            }
            return(module);
        }