Esempio n. 1
0
        public async Task <IEnumerable <string> > ProcessFile(FileInfo fileInfo)
        {
            // Detect if file is zip
            if (await ZipHelper.CheckSignature(fileInfo.FullName))
            {
                return(await ProcessZip(fileInfo));
            }
            else
            {
                // TODO : Detect dll and exe
                // Just jump out into the water and see if we survive (no exceptions)
                using (var module = ModuleDefinition.ReadModule(fileInfo.OpenRead()))
                {
                    var createdFile = await ProcessAssembly(module);

                    if (createdFile != null)
                    {
                        return(new[] { createdFile });
                    }
                    else
                    {
                        return(new string[] { });
                    }
                }
            }
        }