Skip to content

Commit

Permalink
Merge pull request #10 from the1812/preview
Browse files Browse the repository at this point in the history
Update to v2.9.0
  • Loading branch information
the1812 authored Nov 5, 2019
2 parents 161fe4b + b9834a7 commit fb4707d
Show file tree
Hide file tree
Showing 181 changed files with 6,225 additions and 21 deletions.
File renamed without changes.
20 changes: 10 additions & 10 deletions README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Malware Patch
[中文版](README.md)

Prevent UAC authorization of Chinese malwares, **no** need to run in background.
Prevent UAC authorization of Chinese malware, no need to run in background.

Project inspired by [Windows apps that amaze us](https://amazing-apps.gitbooks.io/windows-apps-that-amaze-us/content/en/blacklist.html).

*This repository contains only version info and binary.*

## CLI Usage
- No parameter : Open GUI.
- `--silent-update` : Silently check and download update.
Expand All @@ -19,9 +17,6 @@ Project inspired by [Windows apps that amaze us](https://amazing-apps.gitbooks.i
- `--allow=file`: Allow UAC authorization of `file`.
- `--disallow=file`: Disallow UAC authorization of `file`.

## About Temp Files
Currently this app only store new version file as `__mwp.exe` in the same directory. You can delete it manually after update.

## System Support
- Windows 10
- Windows 8.1
Expand All @@ -32,13 +27,18 @@ Currently this app only store new version file as `__mwp.exe` in the same direct
- 简体中文

## Block Lists
- [English](Block-List.en.md)
- [English](Block-List.en-US.md)
- [简体中文](Block-List.zh-CN.md)

## Example
### Before
![Before](before.png)

<img height="250" alt="Before" src="before.png">

### Disallow it and save
![Disallow it and save](disallow.png)

<img height="250" alt="Disallow it and save" src="disallow.png">

### After
![After](after.png)

<img height="250" alt="After" src="after.png">
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# 软件屏蔽器
[English version](README.en-US.md)

阻止指定软件的管理员授权,**无需**后台运行.
阻止指定软件的管理员授权, 无需后台运行.

项目灵感来源:[Windows apps that amaze us](https://amazing-apps.gitbooks.io/windows-apps-that-amaze-us/zh-CN/blacklist.html).

*此仓库仅包含版本信息和可执行程序.*

## 命令行参数
- 无参数 : 启动图形界面.
- `--silent-update` : 在后台进行更新.
Expand All @@ -19,9 +17,6 @@
- `--allow=file`: 允许传入的`file`.
- `--disallow=file`: 屏蔽传入的`file`.

## 关于缓存文件
目前此应用只会在同目录中产生更新文件`__mwp.exe`. 更新完成后你可以用手动删除它.

## 系统支持
- Windows 10
- Windows 8.1
Expand All @@ -33,12 +28,17 @@

## 屏蔽列表
- [简体中文](Block-List.zh-CN.md)
- [English](Block-List.en.md)
- [English](Block-List.en-US.md)

## 例子
### 屏蔽前
![屏蔽前](before.png)

<img height="250" alt="屏蔽前" src="before.png">

### 屏蔽并保存
![屏蔽并保存](disallow.png)

<img height="250" alt="屏蔽并保存" src="disallow.png">

### 屏蔽后
![屏蔽后](after.png)

<img height="250" alt="屏蔽后" src="after.png">
2 changes: 1 addition & 1 deletion mwp-ver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.2.0
2.9.0.0
Binary file modified mwp.exe
Binary file not shown.
22 changes: 22 additions & 0 deletions src/MalwarePatch.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MalwarePatch", "MalwarePatch\MalwarePatch.csproj", "{769D2F79-D71B-4F5F-A61F-B1EF3A4C7414}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{769D2F79-D71B-4F5F-A61F-B1EF3A4C7414}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{769D2F79-D71B-4F5F-A61F-B1EF3A4C7414}.Debug|Any CPU.Build.0 = Debug|Any CPU
{769D2F79-D71B-4F5F-A61F-B1EF3A4C7414}.Release|Any CPU.ActiveCfg = Release|Any CPU
{769D2F79-D71B-4F5F-A61F-B1EF3A4C7414}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added src/MalwarePatch/Ace.dll
Binary file not shown.
6 changes: 6 additions & 0 deletions src/MalwarePatch/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
41 changes: 41 additions & 0 deletions src/MalwarePatch/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Application
x:Class="MalwarePatch.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:Ace.Wpf;assembly=Ace"
xmlns:lang="clr-namespace:MalwarePatch.Languages">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="Assets/Icons.xaml" />
<ResourceDictionary
Source="Assets/Icons.UserCertificates.xaml" />
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush
x:Key="DwmColor"
Color="{x:Static wpf:DwmEffect.ColorizationColor}" />
<SolidColorBrush
x:Key="Foreground"
Color="#F8F8F8" />
<SolidColorBrush
x:Key="TitleBarBackground"
Color="#263238" />
<SolidColorBrush
x:Key="TitleBarForeground"
Color="#8FFF" />
<SolidColorBrush
x:Key="Background"
Color="#324049" />
<SolidColorBrush
x:Key="ToolbarBackground"
Color="#703B699D" />
<SolidColorBrush
x:Key="ProgressBackground"
Color="#2000" />
<SolidColorBrush
x:Key="ProgressForeground"
Color="#448CB9" />
</ResourceDictionary>
</Application.Resources>
</Application>
60 changes: 60 additions & 0 deletions src/MalwarePatch/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using MalwarePatch.CliTools;
using MalwarePatch.Languages;
using MalwarePatch.Models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Shell;

namespace MalwarePatch
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
AppDomain.CurrentDomain.AssemblyResolve += assemblyResolveHandler;
//StartupUri = new Uri("MainWindow.xaml", UriKind.RelativeOrAbsolute);
base.OnStartup(e);
// CultureInfo.CurrentUICulture = new CultureInfo("en-US");
AppJumpList.CreateJumpList();
#if DEBUG
File.AppendAllText($"args.txt", string.Join(" ", e.Args));
#endif
if (SilentUpdater.TryParse(e.Args) ||
UserCertificateCli.TryParse(e.Args) ||
MalwareChecker.TryParse(e.Args))
{
Shutdown();
}
else
{
Updater.InstallUpdateAndRun(this, e.Args);
}
}
static Assembly assemblyResolveHandler(object s, ResolveEventArgs e)
{
var dllName = new AssemblyName(e.Name).Name + ".dll";
var assembly = Assembly.GetExecutingAssembly();
var resourceName = assembly.GetManifestResourceNames().FirstOrDefault(name => name.EndsWith(dllName));
if (resourceName == null)
{
return null;
}
using (var stream = assembly.GetManifestResourceStream(resourceName))
{
var assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
}
}
}
Binary file added src/MalwarePatch/AppIcons/01-disallow-small.ico
Binary file not shown.
Binary file added src/MalwarePatch/AppIcons/02-allow-small.ico
Binary file not shown.
37 changes: 37 additions & 0 deletions src/MalwarePatch/AppJumpList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using MalwarePatch.Languages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Shell;

namespace MalwarePatch
{
static class AppJumpList
{
public static void CreateJumpList()
{
var jumpList = new JumpList();
var language = new MainLanguage();
jumpList.JumpItems.Add(new JumpTask
{
Title = language[MainLanguage.Keys.DisallowProgram],
Arguments = "--disallow",
Description = language[MainLanguage.Keys.DisallowProgramDescription],
IconResourceIndex = 1,
});
jumpList.JumpItems.Add(new JumpTask
{
Title = language[MainLanguage.Keys.AllowProgram],
Arguments = "--allow",
Description = language[MainLanguage.Keys.AllowProgramDescription],
IconResourceIndex = 2,
});
jumpList.ShowFrequentCategory = false;
jumpList.ShowRecentCategory = false;
JumpList.SetJumpList(Application.Current, jumpList);
}
}
}
71 changes: 71 additions & 0 deletions src/MalwarePatch/Assets/Icons.UserCertificates.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Viewbox
x:Shared="false"
x:Key="DisallowFile"
Stretch="Uniform">
<Canvas
Width="24"
Height="24"
Canvas.Left="0"
Canvas.Top="0">
<Canvas
Clip="M0,0v15.873c0.0576,-0.0902,0.1249,-0.1761,0.2038,-0.2549l1.4142,-1.4143c0.2813,-0.2813,0.6628,-0.4394,1.0607,-0.4394c0.3978,0,0.7793,0.158,1.0606,0.4394L5,15.4645l1.2607,-1.2606c0.2813,-0.2813,0.6628,-0.4394,1.0606,-0.4394c0.3979,0,0.7794,0.158,1.0607,0.4394l1.4142,1.4143c0.5857,0.5858,0.5857,1.5355,0,2.1213L8.5355,19l1.2606,1.2606c0.5858,0.5857,0.5858,1.5354,0,2.1213L8.382,23.7962c-0.078,0.078,-0.1643,0.1455,-0.256,0.2038H24V0H0z">
<Canvas>
<Canvas.RenderTransform>
<TransformGroup>
<TranslateTransform
X="1"
Y="0" />
</TransformGroup>
</Canvas.RenderTransform>
<Path
Data="M6,2c-1.1,0,-1.99,0.9,-1.99,2L4,20c0,1.1,0.89,2,1.99,2H18c1.1,0,2,-0.9,2,-2V8l-6,-6H6zm7,7V3.5L18.5,9H13z"
Fill="#FFFFFF" />
</Canvas>
</Canvas>
<Canvas>
<Polygon
Points="8.7355,21.3213 6.4142,19 8.7355,16.6787 7.3213,15.2645 5,17.5858 2.6787,15.2645 1.2645,16.6787 3.5858,19 1.2645,21.3213 2.6787,22.7355 5,20.4142 7.3213,22.7355"
Fill="#FFFFFF"
StrokeLineJoin="Miter" />
</Canvas>
</Canvas>
</Viewbox>

<Viewbox
x:Shared="false"
x:Key="AllowFile"
Stretch="Uniform">
<Canvas
Width="24"
Height="24"
Canvas.Left="0"
Canvas.Top="0">
<Canvas
Clip="M0,0v18.336l1.0038,-1.0038c0.2813,-0.2813,0.6628,-0.4394,1.0607,-0.4394c0.3978,0,0.7793,0.158,1.0606,0.4394L4.3929,18.6l3.782,-3.7819c0.5857,-0.5857,1.5354,-0.5857,2.1213,0l1.4142,1.4142c0.2813,0.2813,0.4393,0.6628,0.4393,1.0606c0.0001,0.3979,-0.158,0.7794,-0.4393,1.0606L6.064,24H24V0H0z">
<Canvas>
<Canvas.RenderTransform>
<TransformGroup>
<TranslateTransform
X="1"
Y="0" />
</TransformGroup>
</Canvas.RenderTransform>
<Path
Data="M6,2c-1.1,0,-1.99,0.9,-1.99,2L4,20c0,1.1,0.89,2,1.99,2H18c1.1,0,2,-0.9,2,-2V8l-6,-6H6zm7,7V3.5L18.5,9H13z"
Fill="#FFFFFF" />
</Canvas>
</Canvas>
<Canvas>
<Polygon
Points="9.2355,15.8787 4.3929,20.7213 2.0645,18.3929 0.6503,19.8071 2.9787,22.1355 4.3929,23.5497 5.8071,22.1355 10.6497,17.2929"
Fill="#FFFFFF"
StrokeLineJoin="Miter" />
</Canvas>
</Canvas>
</Viewbox>

</ResourceDictionary>
Loading

0 comments on commit fb4707d

Please sign in to comment.