コード例 #1
0
ファイル: PEBinary.cs プロジェクト: toshipiazza/binskim
 public static bool CanLoadBinary(Uri uri)
 {
     try
     {
         using (FileStream fs = File.OpenRead(Path.GetFullPath(uri.LocalPath)))
         {
             return(PE.CheckPEMagicBytes(fs));
         }
     }
     catch (IOException) { return(false); }
     catch (UnauthorizedAccessException) { return(false); }
 }