Exemplo n.º 1
0
 /// <summary>
 /// a.初始化修改器
 /// </summary>
 /// <param name="installPath">APP安装路径</param>
 public void InitEditors(string installPath)
 {
     // 初始化文件修改器
     editors = new List <FileHexEditor>();
     foreach (TargetInfo info in config.FileTargetInfos.Values)
     {
         FileHexEditor editor = new FileHexEditor(installPath, info);
         editors.Add(editor);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 寻找版本对应的特征码信息
 /// </summary>
 /// <param name="editor">文件编辑器</param>
 private CommonModifyInfo FindCommonModifyInfo(FileHexEditor editor)
 {
     foreach (CommonModifyInfo commonModifyInfo in config.FileCommonModifyInfos[editor.FileName])
     {
         // editor.FileVersion 在 StartVersion 和 EndVersion 之间
         if (IsInVersionRange(editor.FileVersion, commonModifyInfo.StartVersion, commonModifyInfo.EndVersion))
         {
             return(commonModifyInfo);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// a.初始化修改器
 /// </summary>
 /// <param name="installPath">APP安装路径</param>
 public bool InitEditors(string installPath)
 {
     // 初始化文件修改器
     editors = new List <FileHexEditor>();
     foreach (TargetInfo info in config.FileTargetInfos.Values)
     {
         FileHexEditor editor = new FileHexEditor(installPath, info);
         // editor.FileVersion 在 StartVersion 和 EndVersion 之间
         if ((string.IsNullOrEmpty(info.StartVersion) && string.IsNullOrEmpty(info.EndVersion)) ||
             IsInVersionRange(editor.FileVersion, info.StartVersion, info.EndVersion))
         {
             editors.Add(editor);
         }
     }
     if (editors.Count == 0)
     {
         MessageBox.Show("当前版本没有对应的文件修改信息,请确认补丁信息是否正常!");
         return(false);
     }
     return(true);
 }