├── .tfignore ├── DemonWar ├── Api.cs ├── War.cs ├── Project2.ico ├── CrowdedRoom.cs ├── FileManage.cs ├── GetWarVersion.cs ├── Resources │ ├── yuelun.mdx │ ├── NOCD120E.dll │ ├── NOCD124B.dll │ ├── HeroWarden.mdx │ ├── FrostGlowBall64.blp │ └── Sword_1H_Miev_D_01.blp ├── model │ ├── heroflamelord.mdx │ ├── Units │ │ ├── heroflamelord │ │ │ └── heroflamelord.mdx │ │ └── nightelf │ │ │ └── SpiritOfVengeance │ │ │ └── SpiritOfVengeance.mdx │ └── RowerRange │ │ └── Buildings │ │ ├── Undead │ │ └── ziggurat │ │ │ └── ziggurat.mdx │ │ └── nightelf │ │ └── AncientProtector │ │ └── AncientProtector.mdx ├── Properties │ ├── app.manifest │ ├── AssemblyInfo.cs │ ├── Settings.settings │ ├── Resources.Designer.cs │ ├── Resources.resx │ └── Settings.Designer.cs ├── Program.cs ├── Settings.cs ├── app.config ├── DllInject.cs ├── Video.cs ├── ChangeKey.cs ├── WjeWar.csproj ├── Disconnecter.cs ├── WriteMemory.cs └── FM_DemonWar.cs ├── _UpgradeReport_Files ├── UpgradeReport_Minus.gif ├── UpgradeReport_Plus.gif ├── UpgradeReport.css └── UpgradeReport.xslt ├── .gitignore ├── UpgradeLog.XML ├── WjeWar.sln ├── README.md └── UpgradeLog2.XML /.tfignore: -------------------------------------------------------------------------------- 1 | \.git -------------------------------------------------------------------------------- /DemonWar/Api.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Api.cs -------------------------------------------------------------------------------- /DemonWar/War.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/War.cs -------------------------------------------------------------------------------- /DemonWar/Project2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Project2.ico -------------------------------------------------------------------------------- /DemonWar/CrowdedRoom.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/CrowdedRoom.cs -------------------------------------------------------------------------------- /DemonWar/FileManage.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/FileManage.cs -------------------------------------------------------------------------------- /DemonWar/GetWarVersion.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/GetWarVersion.cs -------------------------------------------------------------------------------- /DemonWar/Resources/yuelun.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/yuelun.mdx -------------------------------------------------------------------------------- /DemonWar/Resources/NOCD120E.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/NOCD120E.dll -------------------------------------------------------------------------------- /DemonWar/Resources/NOCD124B.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/NOCD124B.dll -------------------------------------------------------------------------------- /DemonWar/Resources/HeroWarden.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/HeroWarden.mdx -------------------------------------------------------------------------------- /DemonWar/model/heroflamelord.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/model/heroflamelord.mdx -------------------------------------------------------------------------------- /DemonWar/Resources/FrostGlowBall64.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/FrostGlowBall64.blp -------------------------------------------------------------------------------- /DemonWar/Resources/Sword_1H_Miev_D_01.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/Resources/Sword_1H_Miev_D_01.blp -------------------------------------------------------------------------------- /_UpgradeReport_Files/UpgradeReport_Minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/_UpgradeReport_Files/UpgradeReport_Minus.gif -------------------------------------------------------------------------------- /_UpgradeReport_Files/UpgradeReport_Plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/_UpgradeReport_Files/UpgradeReport_Plus.gif -------------------------------------------------------------------------------- /DemonWar/model/Units/heroflamelord/heroflamelord.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/model/Units/heroflamelord/heroflamelord.mdx -------------------------------------------------------------------------------- /DemonWar/model/RowerRange/Buildings/Undead/ziggurat/ziggurat.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/model/RowerRange/Buildings/Undead/ziggurat/ziggurat.mdx -------------------------------------------------------------------------------- /DemonWar/model/Units/nightelf/SpiritOfVengeance/SpiritOfVengeance.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/model/Units/nightelf/SpiritOfVengeance/SpiritOfVengeance.mdx -------------------------------------------------------------------------------- /DemonWar/model/RowerRange/Buildings/nightelf/AncientProtector/AncientProtector.mdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuethan/wjewar/HEAD/DemonWar/model/RowerRange/Buildings/nightelf/AncientProtector/AncientProtector.mdx -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | *.obj 3 | *.exe 4 | *.pdb 5 | *.user 6 | *.aps 7 | *.pch 8 | *.vspscc 9 | *_i.c 10 | *_p.c 11 | *.ncb 12 | *.suo 13 | *.sln.docstates 14 | *.tlb 15 | *.tlh 16 | *.bak 17 | *.cache 18 | *.ilk 19 | *.log 20 | [Bb]in 21 | [Dd]ebug*/ 22 | *.lib 23 | *.sbr 24 | obj/ 25 | [Rr]elease*/ 26 | _ReSharper*/ 27 | [Tt]est[Rr]esult* 28 | *.vssscc 29 | $tf*/ -------------------------------------------------------------------------------- /DemonWar/Properties/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /UpgradeLog.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WjeWar.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WjeWar", "DemonWar\WjeWar.csproj", "{1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /DemonWar/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using System.Diagnostics; 5 | 6 | namespace WjeWar 7 | { 8 | static class Program 9 | { 10 | 11 | 12 | 13 | /// 14 | /// 应用程序的主入口点。 15 | /// 16 | [STAThread] 17 | static void Main() 18 | { 19 | bool runone; 20 | System.Threading.Mutex run = new System.Threading.Mutex(true, "Wje", out runone); 21 | if (runone) 22 | { 23 | run.ReleaseMutex(); 24 | Application.EnableVisualStyles(); 25 | Application.SetCompatibleTextRenderingDefault(false); 26 | Application.Run(new FM_DemonWar()); 27 | } 28 | else 29 | { 30 | FM_DemonWar.SetForegroundWindow(Api.FindWindow(null, new FM_DemonWar().Text)); 31 | } 32 | 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DemonWar/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列属性集 6 | // 控制。更改这些属性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("WjeWar")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("W.je")] 12 | [assembly: AssemblyProduct("W.je作品")] 13 | [assembly: AssemblyCopyright("版权所有 (C) W.je 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 属性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("86e038aa-2dc0-47db-a4a7-cb706a04ef92")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订号 31 | // 32 | [assembly: AssemblyVersion("1.5.0.0")] 33 | [assembly: AssemblyFileVersion("1.5.0.0")] 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wjewar* 2 | # 目前已不过任何平台,早已开源在cnblog 多年不更新,贡给大家学习娱乐 单机1.24版本没问题,WIN8 WIN10未测试。改键支持Alt+X 在MH流行期间较受欢迎很实用 * 3 | 4 | 一、基本功能介绍: 5 | 6 | 全图:最最基本功能。 7 | 8 | 显蓝:在原有的血条下加一个蓝条 用于显示魔法。(非原创) 9 | 10 | 改键:不仅支持单键的修改,同样支持Alt+任意字母 Ctrl+任意字母 11 | 12 | 喊话:非内存操作,纯模拟按键。 13 | 14 | 防切屏崩溃:使用窗口全屏后- 玩家按Alt+tab 切换可能会造成游戏开始时崩溃。开启此选项可减少几率。| 建议:切屏时只要点显示 桌面,让桌面完全切换。 15 | 16 | 技能无CD:设置面板中对应英雄技能位,设置快捷键在游戏中配合时机触发无CD。详细方法请看【使用必读】 17 | 18 | 物品无CD:对应英雄物品包裹位,同样可以触发无限物品效果。比如【秘法鞋】瞬间满蓝 19 | 20 | 二、扩展功能介绍: 21 | 踢人:Alt+玩家位置 必须自己为房主。 玩家进入房间后交换顺序几率降低 22 | 23 | 挤房:目前把VS的挤房先停用了,以后完善加入。 24 | 25 | 房亮度调整:方便窗口化后显示器不好的玩家。 26 | 27 | 扩大视野:调整游戏中玩家能看到的视野范围 28 | 29 | 塔攻范围:显塔的攻击范围。 30 | 31 | 影魔标记:影魔 影压标记。 32 | 33 | 三、注意事项及更新: 34 | 除 【魔法蓝条】 【技能无CD】 不支持1.24E以外。其他均可在1.20E 1.24E 1.24B的魔兽版本使用。 35 | 36 | 1.5更新内容: 37 | 加入重启魔兽重新开启选项 38 | 优化代码 39 | 禁用了VS挤房功能 40 | 41 | 宣传视频 42 | http://v.youku.com/v_show/id_XMjQ1ODI2NDMy.html 43 | 44 | framwork 2.0 (Winform) 45 | 微软官方下载 | 请根据计算机位数选择下载 46 | x86(32)位: 47 | http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe 48 | 49 | x64 位: 50 | http://download.microsoft.com/download/a/3/f/a3f1bf98-18f3-4036-9b68-8e6de530ce0a/NetFx64.exe 51 | 52 | WjeWar V1.5 WinForm 版 : 53 | 安全检测: 卡巴斯基通过 NOD通过 54 | -------------------------------------------------------------------------------- /UpgradeLog2.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /DemonWar/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace WjeWar.Properties 2 | { 3 | 4 | 5 | // This class allows you to handle specific events on the settings class: 6 | // The SettingChanging event is raised before a setting's value is changed. 7 | // The PropertyChanged event is raised after a setting's value is changed. 8 | // The SettingsLoaded event is raised after the setting values are loaded. 9 | // The SettingsSaving event is raised before the setting values are saved. 10 | internal sealed partial class Settings { 11 | 12 | public Settings() { 13 | // // To add event handlers for saving and changing settings, uncomment the lines below: 14 | // 15 | // this.SettingChanging += this.SettingChangingEventHandler; 16 | // 17 | // this.SettingsSaving += this.SettingsSavingEventHandler; 18 | // 19 | } 20 | 21 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 22 | // Add code to handle the SettingChangingEvent event here. 23 | } 24 | 25 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 26 | // Add code to handle the SettingsSaving event here. 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DemonWar/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | False 7 | 8 | 9 | False 10 | 11 | 12 | False 13 | 14 | 15 | False 16 | 17 | 18 | False 19 | 20 | 21 | False 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | False 49 | 50 | 51 | False 52 | 53 | 54 | False 55 | 56 | 57 | False 58 | 59 | 60 | False 61 | 62 | 63 | False 64 | 65 | 66 | -------------------------------------------------------------------------------- /DemonWar/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | False 12 | 13 | 14 | False 15 | 16 | 17 | False 18 | 19 | 20 | False 21 | 22 | 23 | False 24 | 25 | 26 | False 27 | 28 | 29 | 0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | False 54 | 55 | 56 | False 57 | 58 | 59 | False 60 | 61 | 62 | False 63 | 64 | 65 | False 66 | 67 | 68 | False 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /_UpgradeReport_Files/UpgradeReport.css: -------------------------------------------------------------------------------- 1 | BODY 2 | { 3 | BACKGROUND-COLOR: white; 4 | FONT-FAMILY: "Verdana", sans-serif; 5 | FONT-SIZE: 100%; 6 | MARGIN-LEFT: 0px; 7 | MARGIN-TOP: 0px 8 | } 9 | P 10 | { 11 | FONT-FAMILY: "Verdana", sans-serif; 12 | FONT-SIZE: 70%; 13 | LINE-HEIGHT: 12pt; 14 | MARGIN-BOTTOM: 0px; 15 | MARGIN-LEFT: 10px; 16 | MARGIN-TOP: 10px 17 | } 18 | .note 19 | { 20 | BACKGROUND-COLOR: #ffffff; 21 | COLOR: #336699; 22 | FONT-FAMILY: "Verdana", sans-serif; 23 | FONT-SIZE: 100%; 24 | MARGIN-BOTTOM: 0px; 25 | MARGIN-LEFT: 0px; 26 | MARGIN-TOP: 0px; 27 | PADDING-RIGHT: 10px 28 | } 29 | .infotable 30 | { 31 | BACKGROUND-COLOR: #f0f0e0; 32 | BORDER-BOTTOM: #ffffff 0px solid; 33 | BORDER-COLLAPSE: collapse; 34 | BORDER-LEFT: #ffffff 0px solid; 35 | BORDER-RIGHT: #ffffff 0px solid; 36 | BORDER-TOP: #ffffff 0px solid; 37 | FONT-SIZE: 70%; 38 | MARGIN-LEFT: 10px 39 | } 40 | .issuetable 41 | { 42 | BACKGROUND-COLOR: #ffffe8; 43 | BORDER-COLLAPSE: collapse; 44 | COLOR: #000000; 45 | FONT-SIZE: 100%; 46 | MARGIN-BOTTOM: 10px; 47 | MARGIN-LEFT: 13px; 48 | MARGIN-TOP: 0px 49 | } 50 | .issuetitle 51 | { 52 | BACKGROUND-COLOR: #ffffff; 53 | BORDER-BOTTOM: #dcdcdc 1px solid; 54 | BORDER-TOP: #dcdcdc 1px; 55 | COLOR: #003366; 56 | FONT-WEIGHT: normal 57 | } 58 | .header 59 | { 60 | BACKGROUND-COLOR: #cecf9c; 61 | BORDER-BOTTOM: #ffffff 1px solid; 62 | BORDER-LEFT: #ffffff 1px solid; 63 | BORDER-RIGHT: #ffffff 1px solid; 64 | BORDER-TOP: #ffffff 1px solid; 65 | COLOR: #000000; 66 | FONT-WEIGHT: bold 67 | } 68 | .issuehdr 69 | { 70 | BACKGROUND-COLOR: #E0EBF5; 71 | BORDER-BOTTOM: #dcdcdc 1px solid; 72 | BORDER-TOP: #dcdcdc 1px solid; 73 | COLOR: #000000; 74 | FONT-WEIGHT: normal 75 | } 76 | .issuenone 77 | { 78 | BACKGROUND-COLOR: #ffffff; 79 | BORDER-BOTTOM: 0px; 80 | BORDER-LEFT: 0px; 81 | BORDER-RIGHT: 0px; 82 | BORDER-TOP: 0px; 83 | COLOR: #000000; 84 | FONT-WEIGHT: normal 85 | } 86 | .content 87 | { 88 | BACKGROUND-COLOR: #e7e7ce; 89 | BORDER-BOTTOM: #ffffff 1px solid; 90 | BORDER-LEFT: #ffffff 1px solid; 91 | BORDER-RIGHT: #ffffff 1px solid; 92 | BORDER-TOP: #ffffff 1px solid; 93 | PADDING-LEFT: 3px 94 | } 95 | .issuecontent 96 | { 97 | BACKGROUND-COLOR: #ffffff; 98 | BORDER-BOTTOM: #dcdcdc 1px solid; 99 | BORDER-TOP: #dcdcdc 1px solid; 100 | PADDING-LEFT: 3px 101 | } 102 | A:link 103 | { 104 | COLOR: #cc6633; 105 | TEXT-DECORATION: underline 106 | } 107 | A:visited 108 | { 109 | COLOR: #cc6633; 110 | } 111 | A:active 112 | { 113 | COLOR: #cc6633; 114 | } 115 | A:hover 116 | { 117 | COLOR: #cc3300; 118 | TEXT-DECORATION: underline 119 | } 120 | H1 121 | { 122 | BACKGROUND-COLOR: #003366; 123 | BORDER-BOTTOM: #336699 6px solid; 124 | COLOR: #ffffff; 125 | FONT-SIZE: 130%; 126 | FONT-WEIGHT: normal; 127 | MARGIN: 0em 0em 0em -20px; 128 | PADDING-BOTTOM: 8px; 129 | PADDING-LEFT: 30px; 130 | PADDING-TOP: 16px 131 | } 132 | H2 133 | { 134 | COLOR: #000000; 135 | FONT-SIZE: 80%; 136 | FONT-WEIGHT: bold; 137 | MARGIN-BOTTOM: 3px; 138 | MARGIN-LEFT: 10px; 139 | MARGIN-TOP: 20px; 140 | PADDING-LEFT: 0px 141 | } 142 | H3 143 | { 144 | COLOR: #000000; 145 | FONT-SIZE: 80%; 146 | FONT-WEIGHT: bold; 147 | MARGIN-BOTTOM: -5px; 148 | MARGIN-LEFT: 10px; 149 | MARGIN-TOP: 20px 150 | } 151 | H4 152 | { 153 | COLOR: #000000; 154 | FONT-SIZE: 70%; 155 | FONT-WEIGHT: bold; 156 | MARGIN-BOTTOM: 0px; 157 | MARGIN-TOP: 15px; 158 | PADDING-BOTTOM: 0px 159 | } 160 | UL 161 | { 162 | COLOR: #000000; 163 | FONT-SIZE: 70%; 164 | LIST-STYLE: square; 165 | MARGIN-BOTTOM: 0pt; 166 | MARGIN-TOP: 0pt 167 | } 168 | OL 169 | { 170 | COLOR: #000000; 171 | FONT-SIZE: 70%; 172 | LIST-STYLE: square; 173 | MARGIN-BOTTOM: 0pt; 174 | MARGIN-TOP: 0pt 175 | } 176 | LI 177 | { 178 | LIST-STYLE: square; 179 | MARGIN-LEFT: 0px 180 | } 181 | .expandable 182 | { 183 | CURSOR: hand 184 | } 185 | .expanded 186 | { 187 | color: black 188 | } 189 | .collapsed 190 | { 191 | DISPLAY: none 192 | } 193 | .foot 194 | { 195 | BACKGROUND-COLOR: #ffffff; 196 | BORDER-BOTTOM: #cecf9c 1px solid; 197 | BORDER-TOP: #cecf9c 2px solid 198 | } 199 | .settings 200 | { 201 | MARGIN-LEFT: 25PX; 202 | } 203 | .help 204 | { 205 | TEXT-ALIGN: right; 206 | margin-right: 10px; 207 | } 208 | -------------------------------------------------------------------------------- /DemonWar/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WjeWar.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WjeWar.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// 查找 System.Byte[] 类型的本地化资源。 65 | /// 66 | internal static byte[] AncientProtector { 67 | get { 68 | object obj = ResourceManager.GetObject("AncientProtector", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// 查找 System.Byte[] 类型的本地化资源。 75 | /// 76 | internal static byte[] FrostGlowBall64 { 77 | get { 78 | object obj = ResourceManager.GetObject("FrostGlowBall64", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// 查找 System.Byte[] 类型的本地化资源。 85 | /// 86 | internal static byte[] heroflamelord { 87 | get { 88 | object obj = ResourceManager.GetObject("heroflamelord", resourceCulture); 89 | return ((byte[])(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// 查找 System.Byte[] 类型的本地化资源。 95 | /// 96 | internal static byte[] HeroWarden { 97 | get { 98 | object obj = ResourceManager.GetObject("HeroWarden", resourceCulture); 99 | return ((byte[])(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// 查找 System.Byte[] 类型的本地化资源。 105 | /// 106 | internal static byte[] mana { 107 | get { 108 | object obj = ResourceManager.GetObject("mana", resourceCulture); 109 | return ((byte[])(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// 查找 System.Byte[] 类型的本地化资源。 115 | /// 116 | internal static byte[] NOCD120E { 117 | get { 118 | object obj = ResourceManager.GetObject("NOCD120E", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// 查找 System.Byte[] 类型的本地化资源。 125 | /// 126 | internal static byte[] NOCD124B { 127 | get { 128 | object obj = ResourceManager.GetObject("NOCD124B", resourceCulture); 129 | return ((byte[])(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// 查找 System.Byte[] 类型的本地化资源。 135 | /// 136 | internal static byte[] Sword_1H_Miev_D_01 { 137 | get { 138 | object obj = ResourceManager.GetObject("Sword_1H_Miev_D_01", resourceCulture); 139 | return ((byte[])(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// 查找 System.Byte[] 类型的本地化资源。 145 | /// 146 | internal static byte[] yuelun { 147 | get { 148 | object obj = ResourceManager.GetObject("yuelun", resourceCulture); 149 | return ((byte[])(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// 查找 System.Byte[] 类型的本地化资源。 155 | /// 156 | internal static byte[] ziggurat { 157 | get { 158 | object obj = ResourceManager.GetObject("ziggurat", resourceCulture); 159 | return ((byte[])(obj)); 160 | } 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /DemonWar/DllInject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | using System.Diagnostics; 6 | 7 | 8 | namespace WjeWar 9 | { 10 | class DllInject 11 | { 12 | 13 | //----------------------------------------DLL注入的API------------------------------------------- 14 | 15 | [DllImport("kernel32.dll", EntryPoint = "VirtualAllocEx")] 16 | private static extern int VirtualAllocEx(IntPtr hwnd, int lpaddress, int size, int type, int tect); 17 | 18 | [DllImport("kernel32.dll", EntryPoint = "GetProcAddress")] 19 | public static extern int GetProcAddress(int hwnd, string lpname); 20 | 21 | [DllImport("kernel32.dll", EntryPoint = "GetModuleHandleA")] 22 | private static extern int GetModuleHandleA(string name); 23 | 24 | [DllImport("kernel32.dll", EntryPoint = "CreateRemoteThread")] 25 | private static extern int CreateRemoteThread(IntPtr hwnd, int attrib, int size, int address, int par, int flags, int threadid); 26 | 27 | /// 动态加载DLL 28 | /// 29 | /// 30 | /// 31 | /// 32 | [DllImport("kernel32.dll", EntryPoint = "LoadLibrary")] 33 | public static extern IntPtr LoadLibrary(string DllName); 34 | 35 | /// 使用加载的Dll函数 36 | /// 37 | /// 38 | /// 39 | /// 40 | /// 41 | [DllImport("kernel32.dll", EntryPoint = "GetProcAddress")] 42 | public static extern IntPtr GetProcAddress(IntPtr Dllhandle, string FunctionName); 43 | 44 | /// 等待内核对象信号 45 | /// 46 | /// 47 | /// 48 | /// 49 | /// 50 | [DllImport("kernel32.dll", EntryPoint = "WaitForSingleObject")] 51 | private static extern int WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds); 52 | 53 | 54 | 55 | //------------------------------------------------------------------------------------------------ 56 | 57 | private delegate bool HaveFun(); 58 | 59 | public static bool ManaStart(string dllname,bool isMana) 60 | { 61 | bool IsHaveFun = true; 62 | IntPtr Handle = (IntPtr)0; 63 | string filePath = ""; 64 | int baseaddress; 65 | int temp = 0; 66 | int Kernddr; 67 | int yan; 68 | bool ManaState = true; 69 | 70 | int dlllength; 71 | dlllength = dllname.Length + 1; 72 | 73 | Process[] process = Process.GetProcessesByName(War.ProcessName); 74 | 75 | Handle = process[0].Handle; 76 | filePath = War.Path; 77 | 78 | baseaddress = VirtualAllocEx(Handle, 0, dlllength, 4096, 4); //申请内存空间 79 | 80 | WriteMemory.WriteProcessMemory(Handle, baseaddress, dllname, dlllength, temp); //写内存 81 | 82 | Kernddr = GetProcAddress(GetModuleHandleA("Kernel32"), "LoadLibraryA"); //取得loadlibarary在kernek32.dll地址 83 | 84 | yan = CreateRemoteThread(Handle, 0, 0, Kernddr, baseaddress, 0, temp); //创建远程线程。 85 | 86 | if (yan != 0) 87 | { 88 | ManaState = true; 89 | } 90 | 91 | if (ManaState && isMana) 92 | { 93 | byte[] manaByte = WjeWar.Properties.Resources.mana; 94 | 95 | 96 | if (!System.IO.File.Exists(filePath + "\\" + dllname)) 97 | { 98 | System.IO.FileStream fs = new System.IO.FileStream(filePath + "\\" + dllname, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite); 99 | fs.Write(manaByte, 0, manaByte.Length); 100 | fs.Flush(); 101 | fs.Close(); 102 | } 103 | 104 | IntPtr ManaDll = LoadLibrary(filePath + "\\" + dllname); 105 | 106 | if (ManaDll != IntPtr.Zero) 107 | { 108 | IntPtr api = GetProcAddress(ManaDll, "HaveFun"); 109 | try 110 | { 111 | HaveFun HaveFun = (HaveFun)(Delegate)Marshal.GetDelegateForFunctionPointer(api, typeof(HaveFun)); 112 | IsHaveFun = HaveFun(); 113 | } 114 | catch (Exception ex) 115 | { 116 | Console.WriteLine(ex.Message.ToString()); 117 | } 118 | 119 | } 120 | } 121 | 122 | return IsHaveFun; 123 | } 124 | 125 | 126 | public static bool inject(byte[] fileByte , string proName ,string path , string dllname) 127 | { 128 | const UInt32 INFINITE = 0xFFFFFFFF; 129 | const Int32 PAGE_EXECUTE_READWRITE = 0x40; 130 | const Int32 MEM_COMMIT = 0x1000; 131 | const Int32 MEM_RESERVE = 0x2000; 132 | Int32 AllocBaseAddress; 133 | 134 | string dllPath = path + "\\" + dllname; 135 | 136 | if (!System.IO.File.Exists(dllPath)) 137 | { 138 | FileManage.FileCreate(fileByte, path, dllname); 139 | } 140 | 141 | Process[] process = Process.GetProcessesByName(proName); 142 | IntPtr hWnd = process[0].Handle; 143 | 144 | int umstrcnt = Encoding.Default.GetByteCount(dllPath); 145 | 146 | AllocBaseAddress = VirtualAllocEx(hWnd, 0, umstrcnt, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); 147 | 148 | IntPtr AddrWM = Marshal.StringToHGlobalAnsi(dllPath); 149 | 150 | int readSize; 151 | bool isWrite = WriteMemory.WriteProcessMemory(hWnd, AllocBaseAddress, (int)AddrWM, umstrcnt, out readSize); 152 | 153 | Marshal.FreeHGlobal(AddrWM); 154 | 155 | int loadaddr = GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"); 156 | 157 | IntPtr ThreadHwnd = (IntPtr)CreateRemoteThread(hWnd, 0, 0, loadaddr, AllocBaseAddress, 0, 0); 158 | 159 | WaitForSingleObject(ThreadHwnd, INFINITE); 160 | 161 | return true; 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /DemonWar/Video.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Drawing; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace WjeWar 8 | { 9 | class Video 10 | { 11 | 12 | /// 亮度调节 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | [DllImport("gdi32.dll", EntryPoint = "GetDeviceGammaRamp")] 19 | public static extern int GetDeviceGammaRamp(IntPtr hDC, ref RAMP lpRamp); 20 | static RAMP ramp = new RAMP(); 21 | 22 | [DllImport("gdi32.dll", EntryPoint = "SetDeviceGammaRamp")] 23 | public static extern int SetDeviceGammaRamp(IntPtr hDC, ref RAMP lpRamp); 24 | 25 | [DllImport("user32.dll", EntryPoint = "GetDC")] 26 | static extern IntPtr GetDC(IntPtr hWnd); 27 | 28 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 29 | public struct RAMP 30 | { 31 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] 32 | public UInt16[] Red; 33 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] 34 | public UInt16[] Green; 35 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] 36 | public UInt16[] Blue; 37 | } 38 | 39 | /// 对窗体的大小操作 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | [DllImport("user32.dll", EntryPoint = "GetWindowLong")] 46 | public static extern int GetWindowLong(IntPtr hwnd, int nIndex); 47 | 48 | const int WS_CAPTION = 0xC00000;//有标题栏 49 | const int WS_THICKFRAME = 0x40000; //调整大小用的边框 50 | const int WS_MAXIMIZEBOX = 0x10000; //最大化 51 | 52 | enum GWL : int 53 | { 54 | GWL_ID = (-12), 55 | GWL_STYLE = (-16), 56 | GWL_EXSTYLE = (-20) 57 | } 58 | 59 | 60 | [DllImport("user32.dll", EntryPoint = "SetWindowLong")] 61 | public static extern long SetWindowLong(IntPtr hwnd, int nIndex, long dwNewLong); 62 | 63 | //获得窗口矩形 64 | [DllImport("user32.dll", EntryPoint = "GetWindowRect")] 65 | public static extern int GetWindowRect(IntPtr hWnd, out RECT lpRect); 66 | 67 | // 矩形结构 68 | [StructLayout(LayoutKind.Sequential)] 69 | public struct RECT 70 | { 71 | public int left; 72 | public int top; 73 | public int right; 74 | public int bottom; 75 | } 76 | 77 | [DllImport("user32.dll ", EntryPoint = "ClientToScreen")] 78 | static extern bool ClientToScreen(IntPtr hWnd, ref Point lp); 79 | 80 | [DllImport("user32.dll", EntryPoint = "SetCursorPos")] 81 | private static extern bool SetCursorPos(int x, int y); 82 | 83 | [DllImport("user32.dll", EntryPoint = "GetCursorPos")] 84 | static extern bool GetCursorPos(ref Point lpPoint); 85 | 86 | 87 | /// MoveWindow对窗体大小的操作 88 | /// 89 | /// 句柄窗体 90 | /// 居左距离 91 | /// 居上距离 92 | /// 窗体宽度 93 | /// 窗体高度 94 | /// 是否重画 95 | /// 96 | [DllImport("user32.dll", EntryPoint = "MoveWindow")] 97 | public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); 98 | 99 | public static double GamaValue = 0.1; 100 | public static int SetGamma() 101 | { 102 | ramp.Red = new ushort[256]; 103 | ramp.Green = new ushort[256]; 104 | ramp.Blue = new ushort[256]; 105 | 106 | for (int i = 1; i < 256; i++) 107 | { 108 | // gamma 必须在3和44之间 109 | ramp.Red[i] = ramp.Green[i] = ramp.Blue[i] = (ushort)(Math.Min(65535, Math.Max(0, Math.Pow((i + 1) / 256.0, 10 * GamaValue) * 65535 + 0.5))); 110 | } 111 | return SetDeviceGammaRamp(GetDC(IntPtr.Zero), ref ramp); 112 | } 113 | 114 | 115 | 116 | //伪全屏 117 | public static void PseudoFullScreen(bool isSet) 118 | { 119 | int wins = GetWindowLong(War.HWnd, (int)GWL.GWL_STYLE); 120 | 121 | System.Windows.Forms.Screen sc = System.Windows.Forms.Screen.PrimaryScreen; 122 | int width = sc.Bounds.Width; 123 | int height = sc.Bounds.Height; 124 | 125 | if (isSet) 126 | { 127 | wins &= ~WS_CAPTION; 128 | wins &= ~WS_THICKFRAME; 129 | } 130 | else 131 | { 132 | wins |= WS_CAPTION; 133 | wins |= WS_THICKFRAME; 134 | 135 | width = sc.Bounds.Width - 400; 136 | height = sc.Bounds.Height - 200; 137 | } 138 | 139 | 140 | //设置边框样式 369164288 141 | Video.SetWindowLong(War.HWnd, (int)GWL.GWL_STYLE, wins); 142 | 143 | //对窗体大小调整 144 | Video.MoveWindow(War.HWnd, 0, 0, width, height, true); 145 | } 146 | 147 | //发送鼠标点击 148 | public static void SendMouseDown(IntPtr hWnd, int skillsIndex, int number) 149 | { 150 | Point ptPast = new Point(); 151 | GetCursorPos(ref ptPast); 152 | 153 | Point ptIng = new Point(); 154 | ClientToScreen(hWnd, ref ptIng); 155 | 156 | RECT rc; 157 | GetWindowRect(hWnd, out rc); 158 | 159 | int width = rc.right - (int)ptIng.X; 160 | double wIndex = 0.78; 161 | double hIndex = 0.95; 162 | 163 | switch (skillsIndex) 164 | { 165 | case 0: wIndex = 0.85; hIndex = 0.88; break; 166 | case 1: wIndex = 0.90; hIndex = 0.88; break; 167 | case 2: wIndex = 0.80; hIndex = 0.95; break; 168 | case 3: wIndex = 0.85; hIndex = 0.95; break; 169 | case 4: wIndex = 0.90; hIndex = 0.95; break; 170 | case 5: wIndex = 0.95; hIndex = 0.95; break; 171 | 172 | case 6: wIndex = 0.66; hIndex = 0.82; break; 173 | case 7: wIndex = 0.71; hIndex = 0.82; break; 174 | case 8: wIndex = 0.66; hIndex = 0.89; break; 175 | case 9: wIndex = 0.71; hIndex = 0.89;break; 176 | case 10: wIndex = 0.66; hIndex = 0.95; break; 177 | case 11: wIndex = 0.71; hIndex = 0.95; break; 178 | } 179 | 180 | width = (int)(width - (width * wIndex)); 181 | width = rc.right - width; 182 | 183 | int height = rc.bottom - (int)ptIng.Y; 184 | height = (int)(height - (height * hIndex)); 185 | height = rc.bottom - height; 186 | 187 | SetCursorPos(width, height); 188 | 189 | const int MOUSEEVENTF_LEFTDOWN = 0x0002; 190 | const int MOUSEEVENTF_LEFTUP = 0x0004; 191 | 192 | const uint KEYEVENTF_EXTENDEDKEY = 0x1; 193 | const uint KEYEVENTF_KEYUP = 0x2; 194 | 195 | const uint VK_Control = 0x11; 196 | 197 | ChangeKey.keybd_event((byte)VK_Control, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0); 198 | 199 | for (int i = 0; i <= number; i++) 200 | { 201 | ChangeKey.mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); 202 | System.Threading.Thread.Sleep(5); 203 | } 204 | ChangeKey.keybd_event((byte)VK_Control, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); 205 | 206 | 207 | SetCursorPos(ptPast.X, ptPast.Y); 208 | } 209 | 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /DemonWar/ChangeKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | using System.Windows.Forms; 6 | 7 | namespace WjeWar 8 | { 9 | class ChangeKey 10 | { 11 | 12 | /// 模拟按键 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | [DllImport("user32.dll", EntryPoint = "keybd_event")] 20 | public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo); 21 | 22 | /// 模拟鼠标 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// 31 | [DllImport("user32.dll", EntryPoint = "mouse_event")] 32 | public static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); 33 | 34 | /// 注册系统热键 35 | /// 36 | /// 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | [DllImport("user32.dll", EntryPoint = "RegisterHotKey")] 43 | public static extern bool RegisterHotKey( 44 | IntPtr hWnd, 45 | int id, 46 | uint fsModifiers, 47 | Keys vk 48 | ); 49 | 50 | ////组合键枚举 51 | //public enum KeyModifiers 52 | //{ 53 | // None = 0, 54 | // Alt = 1, 55 | // Control = 2, 56 | // Shift = 4, 57 | // Windows = 8 58 | //} 59 | 60 | 61 | /// 卸载注册过的热键 62 | /// 63 | /// 64 | /// 65 | /// 66 | /// 67 | [DllImport("user32.dll", EntryPoint = "UnregisterHotKey")] 68 | public static extern bool UnregisterHotKey( 69 | IntPtr hWnd, 70 | int id 71 | ); 72 | 73 | /// 发送消息给指定窗体 74 | /// 75 | /// 76 | /// 77 | /// 78 | /// 79 | /// 80 | /// 81 | [DllImport("User32.dll", EntryPoint = "SendMessage")] 82 | public static extern int SendMessage(IntPtr hwnd, int wMsg, uint wParam, uint lParam); 83 | 84 | const uint KEYEVENTF_EXTENDEDKEY = 0x1; 85 | const uint KEYEVENTF_KEYUP = 0x2; 86 | 87 | 88 | public static void KeyBoardDo(int[] key, IntPtr hWnd) 89 | { 90 | 91 | foreach(int k in key) 92 | { 93 | keybd_event((byte)k,0x45, KEYEVENTF_EXTENDEDKEY | 0, 0); 94 | } 95 | foreach(int k in key) 96 | { 97 | //发送一个松开Alt键的消息给War 98 | SendMessage(hWnd, 0x0105, 0x00000012, 0xC0380001); 99 | keybd_event((byte)k, 0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); 100 | } 101 | } 102 | 103 | const int WM_KEYDOWN = 0x100; 104 | const int WM_KEYUP = 0x101; 105 | const uint VK_CONTROL = 0x11; 106 | 107 | //模拟War喊话 108 | public static void WarSpeak(IntPtr hWnd) 109 | { 110 | KeyBoardDo(new int[] { 13 }, hWnd); 111 | keybd_event((byte)0x11, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0); 112 | keybd_event((byte)86, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0); 113 | keybd_event((byte)0x11, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); 114 | keybd_event((byte)16, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); 115 | KeyBoardDo(new int[] { 13 }, hWnd); 116 | } 117 | 118 | //发送按键消息 119 | public static void SendVkMessage(IntPtr hWnd,uint VKValue) 120 | { 121 | SendMessage(hWnd, WM_KEYDOWN, VKValue, 0); 122 | SendMessage(hWnd, WM_KEYUP, VKValue, 0); 123 | } 124 | 125 | //注册热键自定方法 126 | public static void KeyModify(IntPtr hWnd , int Num, string Key, int Group) 127 | { 128 | uint NewNum = (uint)Num; 129 | Keys NewKey = (Keys)Enum.Parse(typeof(Keys), Key); 130 | UnregisterHotKey(hWnd, Num); 131 | RegisterHotKey(hWnd, Num, (uint)Group, NewKey); 132 | } 133 | 134 | //卸载系统热键 135 | public static void UninstallKey(IntPtr hWnd,int[] keyIndex) 136 | { 137 | for (int i = 0; i < keyIndex.Length; i++) 138 | { 139 | UnregisterHotKey(hWnd, keyIndex[i]); 140 | } 141 | } 142 | 143 | //注册单热键或组合热键验证 144 | public static void KeyRegisterValidate(IntPtr hWnd,string keyValue, int sid) 145 | { 146 | if (keyValue != "" && keyValue.IndexOf('+') == -1) 147 | { 148 | ChangeKey.KeyModify(hWnd, sid, keyValue, 0); 149 | } 150 | else 151 | { 152 | switch (keyValue.Split('+')[0].ToLower()) 153 | { 154 | case "alt": ChangeKey.KeyModify(hWnd, sid, keyValue.Split('+')[1], 1); break; 155 | case "control": ChangeKey.KeyModify(hWnd, sid, keyValue.Split('+')[1], 2); break; 156 | case "shift": ChangeKey.KeyModify(hWnd, sid, keyValue.Split('+')[1], 4); break; 157 | } 158 | } 159 | } 160 | 161 | //过滤组合单按键 162 | public static string KeyFilter(PreviewKeyDownEventArgs e, string keyName) 163 | { 164 | if (!"Alt".ToLower().Equals(e.Modifiers.ToString().ToLower()) && !"Shift".Equals(e.Modifiers.ToString()) && !"Control".Equals(e.Modifiers.ToString())) 165 | { 166 | if (!keyName.Equals(e.KeyCode.ToString())) 167 | { 168 | return e.KeyCode.ToString(); 169 | } 170 | } 171 | return ""; 172 | } 173 | 174 | /// 卸载包裹改键 175 | /// 176 | /// 177 | public static void KeyModifyOFF(IntPtr hWnd) 178 | { 179 | int[] keGroup ={ 7, 8, 4, 5, 1, 2, 22, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }; 180 | ChangeKey.UninstallKey(hWnd, keGroup); 181 | } 182 | 183 | /// 安装包裹改键 184 | /// 185 | /// 186 | public static void KeyModifyOn(IntPtr hWnd,string[] sender) 187 | { 188 | KeyModifyOFF(hWnd); 189 | 190 | KeyRegisterValidate(hWnd, sender[0], 7); 191 | KeyRegisterValidate(hWnd, sender[1], 8); 192 | KeyRegisterValidate(hWnd, sender[2], 4); 193 | KeyRegisterValidate(hWnd, sender[3], 5); 194 | KeyRegisterValidate(hWnd, sender[4], 1); 195 | KeyRegisterValidate(hWnd, sender[5], 2); 196 | KeyRegisterValidate(hWnd, sender[6], 22); 197 | KeyRegisterValidate(hWnd, sender[7], 25); 198 | KeyRegisterValidate(hWnd, sender[8], 26); 199 | KeyRegisterValidate(hWnd, sender[9], 27); 200 | KeyRegisterValidate(hWnd, sender[10], 28); 201 | KeyRegisterValidate(hWnd, sender[11], 29); 202 | KeyRegisterValidate(hWnd, sender[12], 30); 203 | KeyRegisterValidate(hWnd, sender[13], 31); 204 | KeyRegisterValidate(hWnd, sender[14], 32); 205 | KeyRegisterValidate(hWnd, sender[15], 33); 206 | KeyRegisterValidate(hWnd, sender[16], 34); 207 | KeyRegisterValidate(hWnd, sender[17], 35); 208 | KeyRegisterValidate(hWnd, sender[18], 36); 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /DemonWar/WjeWar.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.21022 7 | 2.0 8 | {1F1E075A-AB7E-421B-ADAB-A2DA6B869AD0} 9 | WinExe 10 | Properties 11 | WjeWar 12 | WjeWar 13 | LocalIntranet 14 | false 15 | 16 | 17 | Project2.ico 18 | true 19 | false 20 | 18F185CF7538AFCE289B8DD55DB2C78AF1D9409C 21 | DemonWar_1_TemporaryKey.pfx 22 | false 23 | 24 | 25 | false 26 | 27 | 28 | OnBuildSuccess 29 | 30 | 31 | 3.5 32 | 33 | 34 | Properties\app.manifest 35 | http://localhost/DemonWar/ 36 | true 37 | Web 38 | true 39 | Foreground 40 | 7 41 | Days 42 | false 43 | false 44 | true 45 | 0 46 | 1.0.0.%2a 47 | false 48 | true 49 | v2.0 50 | 51 | 52 | true 53 | full 54 | false 55 | bin\Debug\ 56 | DEBUG;TRACE 57 | prompt 58 | 4 59 | true 60 | AllRules.ruleset 61 | 62 | 63 | pdbonly 64 | true 65 | bin\Release\ 66 | TRACE 67 | prompt 68 | 4 69 | AllRules.ruleset 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | Form 92 | 93 | 94 | FM_DemonWar.cs 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | Designer 103 | FM_DemonWar.cs 104 | 105 | 106 | ResXFileCodeGenerator 107 | Resources.Designer.cs 108 | Designer 109 | 110 | 111 | True 112 | Resources.resx 113 | True 114 | 115 | 116 | 117 | SettingsSingleFileGenerator 118 | Settings.Designer.cs 119 | 120 | 121 | True 122 | Settings.settings 123 | True 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | False 133 | .NET Framework 2.0 %28x86%29 134 | true 135 | 136 | 137 | False 138 | .NET Framework 3.0 %28x86%29 139 | false 140 | 141 | 142 | False 143 | .NET Framework 3.5 144 | false 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /DemonWar/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\bin\Debug\model\RowerRange\Buildings\nightelf\AncientProtector\AncientProtector.mdx;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\bin\Debug\model\Units\nightelf\HeroWarden\FrostGlowBall64.blp;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\bin\Debug\model\Units\heroflamelord\heroflamelord.mdx;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 129 | 130 | 131 | ..\bin\Debug\model\Units\nightelf\HeroWarden\HeroWarden.mdx;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\bin\Debug\mana.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\Resources\NOCD120E.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | 140 | ..\Resources\NOCD124B.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\bin\Debug\model\Units\nightelf\HeroWarden\Sword_1H_Miev_D_01.blp;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 144 | 145 | 146 | ..\bin\Debug\model\Units\nightelf\HeroWarden\yuelun.mdx;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 147 | 148 | 149 | ..\bin\Debug\model\RowerRange\Buildings\Undead\ziggurat\ziggurat.mdx;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 150 | 151 | -------------------------------------------------------------------------------- /DemonWar/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WjeWar.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 29 | public bool OpenFullFigure { 30 | get { 31 | return ((bool)(this["OpenFullFigure"])); 32 | } 33 | set { 34 | this["OpenFullFigure"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool FromFalseAllscreen { 42 | get { 43 | return ((bool)(this["FromFalseAllscreen"])); 44 | } 45 | set { 46 | this["FromFalseAllscreen"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 53 | public bool ShowMana { 54 | get { 55 | return ((bool)(this["ShowMana"])); 56 | } 57 | set { 58 | this["ShowMana"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 65 | public bool VideoGama { 66 | get { 67 | return ((bool)(this["VideoGama"])); 68 | } 69 | set { 70 | this["VideoGama"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 77 | public bool KeyDownCloseConnection { 78 | get { 79 | return ((bool)(this["KeyDownCloseConnection"])); 80 | } 81 | set { 82 | this["KeyDownCloseConnection"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 89 | public bool CloseDescConnection { 90 | get { 91 | return ((bool)(this["CloseDescConnection"])); 92 | } 93 | set { 94 | this["CloseDescConnection"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 101 | public int DotaImbaCmd { 102 | get { 103 | return ((int)(this["DotaImbaCmd"])); 104 | } 105 | set { 106 | this["DotaImbaCmd"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("")] 113 | public string KeySpeak { 114 | get { 115 | return ((string)(this["KeySpeak"])); 116 | } 117 | set { 118 | this["KeySpeak"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("")] 125 | public string KeyNum7 { 126 | get { 127 | return ((string)(this["KeyNum7"])); 128 | } 129 | set { 130 | this["KeyNum7"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("")] 137 | public string KeyNum8 { 138 | get { 139 | return ((string)(this["KeyNum8"])); 140 | } 141 | set { 142 | this["KeyNum8"] = value; 143 | } 144 | } 145 | 146 | [global::System.Configuration.UserScopedSettingAttribute()] 147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 148 | [global::System.Configuration.DefaultSettingValueAttribute("")] 149 | public string KeyNum4 { 150 | get { 151 | return ((string)(this["KeyNum4"])); 152 | } 153 | set { 154 | this["KeyNum4"] = value; 155 | } 156 | } 157 | 158 | [global::System.Configuration.UserScopedSettingAttribute()] 159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 160 | [global::System.Configuration.DefaultSettingValueAttribute("")] 161 | public string KeyNum5 { 162 | get { 163 | return ((string)(this["KeyNum5"])); 164 | } 165 | set { 166 | this["KeyNum5"] = value; 167 | } 168 | } 169 | 170 | [global::System.Configuration.UserScopedSettingAttribute()] 171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 172 | [global::System.Configuration.DefaultSettingValueAttribute("")] 173 | public string KeyNum1 { 174 | get { 175 | return ((string)(this["KeyNum1"])); 176 | } 177 | set { 178 | this["KeyNum1"] = value; 179 | } 180 | } 181 | 182 | [global::System.Configuration.UserScopedSettingAttribute()] 183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 184 | [global::System.Configuration.DefaultSettingValueAttribute("")] 185 | public string KeyNum2 { 186 | get { 187 | return ((string)(this["KeyNum2"])); 188 | } 189 | set { 190 | this["KeyNum2"] = value; 191 | } 192 | } 193 | 194 | [global::System.Configuration.UserScopedSettingAttribute()] 195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 196 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 197 | public bool IsModifyKey { 198 | get { 199 | return ((bool)(this["IsModifyKey"])); 200 | } 201 | set { 202 | this["IsModifyKey"] = value; 203 | } 204 | } 205 | 206 | [global::System.Configuration.UserScopedSettingAttribute()] 207 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 208 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 209 | public bool DisplayInvisible { 210 | get { 211 | return ((bool)(this["DisplayInvisible"])); 212 | } 213 | set { 214 | this["DisplayInvisible"] = value; 215 | } 216 | } 217 | 218 | [global::System.Configuration.UserScopedSettingAttribute()] 219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 220 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 221 | public bool PassAH { 222 | get { 223 | return ((bool)(this["PassAH"])); 224 | } 225 | set { 226 | this["PassAH"] = value; 227 | } 228 | } 229 | 230 | [global::System.Configuration.UserScopedSettingAttribute()] 231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 232 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 233 | public bool EnlargeHorizon { 234 | get { 235 | return ((bool)(this["EnlargeHorizon"])); 236 | } 237 | set { 238 | this["EnlargeHorizon"] = value; 239 | } 240 | } 241 | 242 | [global::System.Configuration.UserScopedSettingAttribute()] 243 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 244 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 245 | public bool ScreenBad { 246 | get { 247 | return ((bool)(this["ScreenBad"])); 248 | } 249 | set { 250 | this["ScreenBad"] = value; 251 | } 252 | } 253 | 254 | [global::System.Configuration.UserScopedSettingAttribute()] 255 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 256 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 257 | public bool ClearFog { 258 | get { 259 | return ((bool)(this["ClearFog"])); 260 | } 261 | set { 262 | this["ClearFog"] = value; 263 | } 264 | } 265 | } 266 | } 267 | -------------------------------------------------------------------------------- /DemonWar/Disconnecter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | /// 5 | /// This is a class for disconnecting TCP connections. 6 | /// You can get a list of all connections and close by a connection, localIP, 7 | /// remoteIP, localPort and remotePort. 8 | /// 9 | public class Disconnecter 10 | { 11 | //Enumeration of the states 12 | public enum State 13 | { 14 | All = 0, 15 | Closed = 1, 16 | Listen = 2, 17 | Syn_Sent = 3, 18 | Syn_Rcvd = 4, 19 | Established = 5, 20 | Fin_Wait1 = 6, 21 | Fin_Wait2 = 7, 22 | Close_Wait = 8, 23 | Closing = 9, 24 | Last_Ack = 10, 25 | Time_Wait = 11, 26 | Delete_TCB = 12 27 | } 28 | 29 | //Connection info 30 | private struct MIB_TCPROW 31 | { 32 | public int dwState; 33 | public int dwLocalAddr; 34 | public int dwLocalPort; 35 | public int dwRemoteAddr; 36 | public int dwRemotePort; 37 | } 38 | 39 | 40 | //API to get list of connections 41 | [DllImport("iphlpapi.dll", EntryPoint = "GetTcpTable")] 42 | private static extern int GetTcpTable(IntPtr pTcpTable, ref int pdwSize, bool bOrder); 43 | 44 | //API to change status of connection 45 | [DllImport("iphlpapi.dll", EntryPoint = "SetTcpEntry")] 46 | //private static extern int SetTcpEntry(MIB_TCPROW tcprow); 47 | private static extern int SetTcpEntry(IntPtr pTcprow); 48 | 49 | //Convert 16-bit value from network to host byte order 50 | [DllImport("wsock32.dll", EntryPoint = "ntohs")] 51 | private static extern int ntohs(int netshort); 52 | 53 | //Convert 16-bit value back again 54 | [DllImport("wsock32.dll", EntryPoint = "htons")] 55 | private static extern int htons(int netshort); 56 | 57 | 58 | //Close all connection to the remote IP 59 | public static void CloseRemoteIP(string IP) 60 | { 61 | MIB_TCPROW[] rows = getTcpTable(); 62 | for (int i = 0; i < rows.Length; i++) 63 | { 64 | if (rows[i].dwRemoteAddr == IPStringToInt(IP)) 65 | { 66 | rows[i].dwState = (int)State.Delete_TCB; 67 | IntPtr ptr = GetPtrToNewObject(rows[i]); 68 | int ret = SetTcpEntry(ptr); 69 | } 70 | } 71 | } 72 | 73 | //Close all connections at current local IP 74 | public static void CloseLocalIP(string IP) 75 | { 76 | MIB_TCPROW[] rows = getTcpTable(); 77 | for (int i = 0; i < rows.Length; i++) 78 | { 79 | if (rows[i].dwLocalAddr == IPStringToInt(IP)) 80 | { 81 | rows[i].dwState = (int)State.Delete_TCB; 82 | IntPtr ptr = GetPtrToNewObject(rows[i]); 83 | int ret = SetTcpEntry(ptr); 84 | } 85 | } 86 | } 87 | //Closes all connections to the remote port 88 | public static void CloseRemotePort(int port) 89 | { 90 | MIB_TCPROW[] rows = getTcpTable(); 91 | for (int i = 0; i < rows.Length; i++) 92 | { 93 | if (port == ntohs(rows[i].dwRemotePort)) 94 | { 95 | rows[i].dwState = (int)State.Delete_TCB; 96 | IntPtr ptr = GetPtrToNewObject(rows[i]); 97 | int ret = SetTcpEntry(ptr); 98 | } 99 | } 100 | } 101 | //Closes all connections to the local port 102 | public static void CloseLocalPort(int port) 103 | { 104 | MIB_TCPROW[] rows = getTcpTable(); 105 | for (int i = 0; i < rows.Length; i++) 106 | { 107 | if (port == ntohs(rows[i].dwLocalPort)) 108 | { 109 | rows[i].dwState = (int)State.Delete_TCB; 110 | IntPtr ptr = GetPtrToNewObject(rows[i]); 111 | int ret = SetTcpEntry(ptr); 112 | } 113 | } 114 | } 115 | //Close a connection by returning the connectionstring 116 | public static void CloseConnection(string connectionstring) 117 | { 118 | try 119 | { 120 | //Split the string to its subparts 121 | string[] parts = connectionstring.Split('-'); 122 | if (parts.Length != 4) throw new Exception("Invalid connectionstring - use the one provided by Connections."); 123 | string[] loc = parts[0].Split(':'); 124 | string[] rem = parts[1].Split(':'); 125 | string[] locaddr = loc[0].Split('.'); 126 | string[] remaddr = rem[0].Split('.'); 127 | //Fill structure with data 128 | MIB_TCPROW row = new MIB_TCPROW(); 129 | row.dwState = 12; 130 | byte[] bLocAddr = new byte[] { byte.Parse(locaddr[0]), byte.Parse(locaddr[1]), byte.Parse(locaddr[2]), byte.Parse(locaddr[3]) }; 131 | byte[] bRemAddr = new byte[] { byte.Parse(remaddr[0]), byte.Parse(remaddr[1]), byte.Parse(remaddr[2]), byte.Parse(remaddr[3]) }; 132 | row.dwLocalAddr = BitConverter.ToInt32(bLocAddr, 0); 133 | row.dwRemoteAddr = BitConverter.ToInt32(bRemAddr, 0); 134 | row.dwLocalPort = htons(int.Parse(loc[1])); 135 | row.dwRemotePort = htons(int.Parse(rem[1])); 136 | 137 | //SetTcpEntry的返回值状态 默认87异常 138 | int ret = 87; 139 | 140 | //Make copy of the structure into memory and use the pointer to call SetTcpEntry 141 | IntPtr ptr = GetPtrToNewObject(row); 142 | ret = SetTcpEntry(ptr); 143 | 144 | if (ret == -1) throw new Exception("Unsuccessful"); 145 | if (ret == 65) throw new Exception("User has no sufficient privilege to execute this API successfully"); 146 | if (ret == 87) throw new Exception("Specified port is not in state to be closed down"); 147 | if (ret != 0) throw new Exception("Unknown error (" + ret + ")"); 148 | } 149 | catch (Exception ) 150 | { 151 | //throw new Exception("CloseConnection failed (" + connectionstring + ")! [" + ex.GetType().ToString() + "," + ex.Message + "]"); 152 | } 153 | } 154 | //得到所有连接 155 | public static string[] Connections() 156 | { 157 | return Connections(State.All); 158 | } 159 | 160 | 161 | //Gets a connection list of connections with a defined state 162 | public static string[] Connections(State state) 163 | { 164 | MIB_TCPROW[] rows = getTcpTable(); 165 | 166 | ArrayList arr = new ArrayList(); 167 | 168 | foreach (MIB_TCPROW row in rows) 169 | { 170 | if (state == State.All || state == (State)row.dwState) 171 | { 172 | int WarPortR = ntohs(row.dwLocalPort) ; 173 | 174 | switch(WarPortR) 175 | { 176 | case 6110: 177 | case 6111: 178 | case 6112: 179 | case 6113: 180 | case 6114: 181 | case 6115: 182 | case 6116: 183 | case 6117: 184 | case 6118: 185 | case 6119: 186 | string localaddress = IPIntToString(row.dwLocalAddr) + ":" + ntohs(row.dwLocalPort); 187 | string remoteaddress = IPIntToString(row.dwRemoteAddr) + ":" + ntohs(row.dwRemotePort); 188 | arr.Add(localaddress + "-" + remoteaddress + "-" + ((State)row.dwState).ToString() + "-" + row.dwState); 189 | break; 190 | } 191 | } 192 | } 193 | 194 | return (string[])arr.ToArray(typeof(System.String)); 195 | } 196 | 197 | //The function that fills the MIB_TCPROW array with connectioninfos 198 | private static MIB_TCPROW[] getTcpTable() 199 | { 200 | IntPtr buffer = IntPtr.Zero; 201 | bool allocated = false; 202 | try 203 | { 204 | int iBytes = 0; 205 | GetTcpTable(IntPtr.Zero, ref iBytes, false); //Getting size of return data 206 | buffer = Marshal.AllocCoTaskMem(iBytes); //allocating the datasize 207 | 208 | allocated = true; 209 | GetTcpTable(buffer, ref iBytes, false); //Run it again to fill the memory with the data 210 | int structCount = Marshal.ReadInt32(buffer); // Get the number of structures 211 | IntPtr buffSubPointer = buffer; //Making a pointer that will point into the buffer 212 | buffSubPointer = (IntPtr)((int)buffer + 4); //Move to the first data (ignoring dwNumEntries from the original MIB_TCPTABLE struct) 213 | MIB_TCPROW[] tcpRows = new MIB_TCPROW[structCount]; //Declaring the array 214 | //Get the struct size 215 | MIB_TCPROW tmp = new MIB_TCPROW(); 216 | int sizeOfTCPROW = Marshal.SizeOf(tmp); 217 | //Fill the array 1 by 1 218 | for (int i = 0; i < structCount; i++) 219 | { 220 | tcpRows[i] = (MIB_TCPROW)Marshal.PtrToStructure(buffSubPointer, typeof(MIB_TCPROW)); //copy struct data 221 | buffSubPointer = (IntPtr)((int)buffSubPointer + sizeOfTCPROW); //move to next structdata 222 | } 223 | 224 | return tcpRows; 225 | } 226 | catch (Exception ex) 227 | { 228 | throw new Exception("getTcpTable failed! [" + ex.GetType().ToString() + "," + ex.Message + "]"); 229 | } 230 | finally 231 | { 232 | if (allocated) Marshal.FreeCoTaskMem(buffer); //Free the allocated memory 233 | } 234 | } 235 | private static IntPtr GetPtrToNewObject(object obj) 236 | { 237 | IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(obj)); 238 | Marshal.StructureToPtr(obj, ptr, false); 239 | return ptr; 240 | } 241 | 242 | //Convert an IP string to the INT value 243 | private static int IPStringToInt(string IP) 244 | { 245 | if (IP.IndexOf(".") < 0) throw new Exception("Invalid IP address"); 246 | string[] addr = IP.Split('.'); 247 | if (addr.Length != 4) throw new Exception("Invalid IP address"); 248 | byte[] bytes = new byte[] { byte.Parse(addr[0]), byte.Parse(addr[1]), byte.Parse(addr[2]), byte.Parse(addr[3]) }; 249 | return BitConverter.ToInt32(bytes, 0); 250 | } 251 | 252 | //Convert an IP integer to IP string 253 | private static string IPIntToString(int IP) 254 | { 255 | byte[] addr = System.BitConverter.GetBytes(IP); 256 | return addr[0] + "." + addr[1] + "." + addr[2] + "." + addr[3]; 257 | } 258 | 259 | //---------------------------------------------------------------------------- 260 | 261 | 262 | public static int[] GetProt(State state) 263 | { 264 | MIB_TCPROW[] rows = getTcpTable(); 265 | 266 | ArrayList arr = new ArrayList(); 267 | 268 | foreach (MIB_TCPROW row in rows) 269 | { 270 | if (state == State.All || state == (State)row.dwState) 271 | { 272 | int WarPortR = ntohs(row.dwLocalPort); 273 | 274 | if (WarPortR == 6112) 275 | { 276 | int remoteaddress = ntohs(row.dwRemotePort); 277 | arr.Add(remoteaddress); 278 | } 279 | } 280 | } 281 | return (int[])arr.ToArray(typeof(System.Int32)); 282 | } 283 | 284 | public static int[] GetRemoteProt() 285 | { 286 | return GetProt(State.All); 287 | } 288 | 289 | 290 | 291 | 292 | } -------------------------------------------------------------------------------- /_UpgradeReport_Files/UpgradeReport.xslt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

63 | 解决方案: 64 | 项目: 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |

73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 92 | 102 | 103 | 104 | 105 | 106 | 107 | src 108 | 109 | 126 | 127 | 128 | 129 | 130 | 131 | 139 | 143 | 144 | 145 | 146 |
文件名状态错误警告
90 | javascript:document.images[''].click()src 91 | 93 | 94 | 95 | 已转换 96 | 97 | 98 | 99 | 已转换 100 | 101 |
132 | 133 | 个文件 134 | 135 | 136 | 1 个文件 137 | 138 | 140 | 已转换:
141 | 未转换: 142 |
147 |
148 |
149 | 150 | 151 | 152 | : 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 转换报告 162 | <xsl:if test="Properties/Property[@Name='LogNumber']"> 163 | <xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/> 164 | </xsl:if> 165 | 166 | 189 | 190 | 191 |

转换报告 -

192 | 193 |

194 | 转换时间:
195 |

196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |

221 | 222 | 223 | 226 | 227 | 228 |
224 | 转换设置 225 |

229 | 230 | 231 |
232 |
233 | -------------------------------------------------------------------------------- /DemonWar/WriteMemory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | using System.Diagnostics; 6 | 7 | namespace WjeWar 8 | { 9 | 10 | class WriteMemory 11 | { 12 | //关闭一个内核对象 13 | [DllImport("kernel32.dll", EntryPoint = "CloseHandle")] 14 | public static extern void CloseHandle(IntPtr hObject); 15 | 16 | //读取byte[]内存 17 | [DllImport("kernel32.dll", EntryPoint = "ReadProcessMemory")] 18 | public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAdress,byte[] lpBuffer, int size, int lpNumberOfBytesWritten); 19 | 20 | //读取int内存值 21 | [DllImportAttribute("kernel32.dll", EntryPoint = "ReadProcessMemory")] 22 | public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, int nSize, IntPtr lpNumberOfBytesRead); 23 | 24 | 25 | //写内存float[] 26 | [DllImportAttribute("kernel32.dll", EntryPoint = "WriteProcessMemory")] 27 | private static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, float[] lpBuffer, int nSize, IntPtr lpNumberOfBytesWritten); 28 | 29 | //写内存byte[] 30 | [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")] 31 | public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, Byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten); 32 | 33 | //写内存byte[] 34 | [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")] 35 | public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, Byte[] lpBuffer, int nSize, int lpNumberOfBytesWritten); 36 | 37 | //写内存int 38 | [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")] 39 | public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, int lpBuffer,int nSize, out int lpNumberOfBytesWritten); 40 | 41 | //写string 42 | [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")] 43 | public static extern int WriteProcessMemory(IntPtr hwnd, int baseaddress, string buffer, int nsize, int filewriten); 44 | 45 | //获得句柄ID 46 | [DllImport("user32.dll", EntryPoint = "GetWindowThreadProcessId")] 47 | public static extern int GetWindowThreadProcessId(int hWnd, IntPtr ProcessId); 48 | 49 | //OpenProcess用来打开一个已存在的进程对象,并返回进程的句柄。 50 | [DllImportAttribute("kernel32.dll", EntryPoint = "OpenProcess")] 51 | public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId); 52 | 53 | //改变保护区域 54 | [DllImport("kernel32.dll", EntryPoint = "VirtualProtectEx")] 55 | static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress,UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); 56 | 57 | //改变某地址保护区域 58 | [DllImport("kernel32.dll", EntryPoint = "VirtualProtectEx")] 59 | public static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, uint flNewProtect, ref uint lpfOldProtect); 60 | 61 | //进程快照 62 | [DllImport("Kernel32.dll", EntryPoint = "CreateToolhelp32Snapshot")] 63 | public static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processid); 64 | 65 | //得到进程信息 66 | [DllImport("Kernel32.dll", EntryPoint = "Module32First")] 67 | public static extern int Module32First(IntPtr Handle, ref MODULEENTRY32 Me); 68 | 69 | [DllImport("Kernel32.dll", EntryPoint = "Module32Next")] 70 | public static extern int Module32Next(IntPtr Handle, ref MODULEENTRY32 Me); 71 | 72 | //枚举进程信息 73 | [StructLayoutAttribute(LayoutKind.Sequential)] 74 | public struct MODULEENTRY32 75 | { 76 | public uint dwSize; 77 | public uint th32ModuleID; 78 | public uint th32ProcessID; 79 | public uint GlblcntUsage; 80 | public uint ProccntUsage; 81 | IntPtr modBaseAddr; 82 | public uint modBaseSize; 83 | public IntPtr hModule; 84 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] 85 | public string szModule; 86 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] 87 | public string szExePath; 88 | } 89 | 90 | public enum Protection : uint 91 | { 92 | NoAccess = 0x00000001, 93 | ReadOnly = 0x00000002, 94 | ReadWrite = 0x00000004, 95 | WriteCopy = 0x00000008, 96 | Execute = 0x00000010, 97 | ExecuteRead = 0x00000020, 98 | ExecuteWriteCopy = 0x00000040, 99 | Guard = 0x00000100, 100 | NoCache = 0x00000200, 101 | WriteCombine = 0x00000400 102 | } 103 | 104 | //00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 105 | //10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 106 | //20 21 22 …… 107 | 108 | //根据进程名获取PID 109 | public static int GetPidByProcessName(string processName) 110 | { 111 | Process[] arrayProcess = Process.GetProcessesByName(processName); 112 | 113 | foreach (Process p in arrayProcess) 114 | { 115 | return p.Id; 116 | } 117 | return 0; 118 | } 119 | 120 | 121 | //遍历进程加载的Dll信息 122 | public static IntPtr GetDllAddre(string ProcessName, string DllName) 123 | { 124 | IntPtr handle = CreateToolhelp32Snapshot(8, (uint)War.PId); 125 | IntPtr GameDllAddre = IntPtr.Zero; 126 | 127 | MODULEENTRY32 Module32 = new MODULEENTRY32(); 128 | if (handle != IntPtr.Zero) 129 | { 130 | Module32.dwSize = (uint)1024; 131 | int Mhandle = Module32First(handle, ref Module32); 132 | while (Mhandle != 0) 133 | { 134 | Mhandle = Module32Next(handle, ref Module32); 135 | 136 | if (Module32.szModule.ToLower().Equals(DllName.ToLower())) 137 | { 138 | GameDllAddre = Module32.hModule; 139 | break; 140 | } 141 | } 142 | if (GameDllAddre == IntPtr.Zero && War.HWnd != IntPtr.Zero) 143 | { 144 | GetWarVersion.GetModules(GetWarVersion.GetProcess(ProcessName).Handle, DllName); 145 | GameDllAddre = GetWarVersion.dllBaseInfo.BaseAddress; 146 | } 147 | } 148 | 149 | CloseHandle(handle); 150 | 151 | return GameDllAddre; 152 | } 153 | 154 | 155 | //读byte数组内存 156 | public static byte[] ReadMemoryValueBYTE(int baseAddress, string processName) 157 | { 158 | try 159 | { 160 | byte[] buffer = new byte[4]; 161 | 162 | //内存操作权限(最高0x1F0FFF) 163 | int PROCESS_ALL_ACCESS = 0x1F0FFF; 164 | 165 | //第三个参数 获取PID的方法 166 | IntPtr hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, War.PId); 167 | 168 | //将制定内存中的值读入缓冲区 169 | ReadProcessMemory(hProcess, (IntPtr)((int)War.BaseAddre + baseAddress), buffer, buffer.Length, 0); 170 | 171 | CloseHandle(hProcess); 172 | 173 | return buffer; 174 | } 175 | catch 176 | { 177 | return new byte[4]; 178 | } 179 | } 180 | 181 | //读整数内存 182 | public static int ReadMemoryValueINT(int baseAddress, string processName) 183 | { 184 | try 185 | { 186 | byte[] buffer = new byte[4]; 187 | 188 | //内存操作权限(最高0x1F0FFF) 189 | int PROCESS_ALL_ACCESS = 0x1F0FFF; 190 | 191 | //获取缓冲区地址 192 | IntPtr byteAddress = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0); 193 | 194 | //打开进程权限 195 | IntPtr hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, War.PId); 196 | 197 | //将制定内存中的值读入缓冲区 198 | ReadProcessMemory(hProcess, (IntPtr)((int)War.BaseAddre + baseAddress), byteAddress, 4, IntPtr.Zero); 199 | 200 | CloseHandle(hProcess); 201 | 202 | return Marshal.ReadInt32(byteAddress); 203 | } 204 | catch 205 | { 206 | return 0; 207 | } 208 | } 209 | 210 | //写入内存 211 | public static void patch(int BaseAddress, string strBuffer) 212 | { 213 | int DllAddr = (int)War.BaseAddre; 214 | 215 | int GradeBaseAddress = DllAddr + BaseAddress; 216 | int RealSize; 217 | IntPtr hProcess = IntPtr.Zero; 218 | try 219 | { 220 | int PROCESS_ALL_ACCESS = 0x1F0FFF; 221 | hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, War.PId); 222 | 223 | uint oldpro = 0; 224 | uint PAGE_EXECUTE_READWRITE = 0x40; 225 | //改变对WAR内存的保护 226 | VirtualProtectEx(hProcess, (IntPtr)(DllAddr + 0x01000), (UIntPtr)0x87E000, PAGE_EXECUTE_READWRITE, out oldpro); 227 | 228 | if (strBuffer.IndexOf('/') != -1) 229 | { 230 | int BufferLength = strBuffer.Split('/').Length; 231 | byte[] BufferValue = new byte[BufferLength]; 232 | 233 | for (int i = 0; i < BufferLength; i++) 234 | { 235 | string Buffer = strBuffer.Split('/')[i]; 236 | byte Value = Convert.ToByte("0" + Buffer, 16); 237 | BufferValue[i] = Value; 238 | if (!WriteProcessMemory(hProcess, GradeBaseAddress, BufferValue, BufferValue.Length, out RealSize)) { 239 | System.Windows.Forms.MessageBox.Show("写入失败:" + BaseAddress.ToString()); 240 | } 241 | } 242 | } 243 | else 244 | { 245 | byte Value = Convert.ToByte("0" + strBuffer, 16); 246 | byte[] BufferValue = new byte[1]; 247 | BufferValue[0] = Value; 248 | if (!WriteProcessMemory(hProcess, GradeBaseAddress, BufferValue, BufferValue.Length, out RealSize)) 249 | { 250 | System.Windows.Forms.MessageBox.Show("写入失败:" + BaseAddress.ToString()); 251 | } 252 | } 253 | } 254 | catch (Exception) 255 | { 256 | throw; 257 | } 258 | finally 259 | { 260 | CloseHandle(hProcess); 261 | } 262 | } 263 | 264 | 265 | 266 | //1.20E版本 267 | public static void SetWriteMemoryOneTwoE() 268 | { 269 | //大地图显示单位 270 | patch(0x2A0930, "xD2"); 271 | 272 | //分辨幻影 273 | patch(0x1ACFFC, "x40/xC3"); 274 | 275 | //显示神符 276 | patch(0x2A07C5, "x49/x4B/x33/xDB/x33/xC9"); 277 | 278 | //小地图去除迷雾 279 | patch(0x147C53, "xEC"); 280 | 281 | //显示单位 282 | patch(0x1491A8, "x00"); 283 | 284 | //显示隐形 285 | patch(0x1494E0, "x33/xC0/x0F/x85"); 286 | 287 | //敌方信号 288 | patch(0x321CC4, "x39/xC0/x0F/x85"); 289 | patch(0x321CD7, "x39/xC0/x75"); 290 | 291 | //他人提示 292 | patch(0x124DDD, "x39/xC0/x0F/x85"); 293 | 294 | //盟友头像 295 | //patch(0x137BA5, "xE7/x7D"); 296 | //patch(0x137BB1, "xEB/xCE/x90/x90/x90/x90"); 297 | 298 | //建筑显资源 299 | patch(0x13EF03, "xEB"); 300 | 301 | //允许交易 302 | patch(0x127B3D, "x40/xB8/x64"); 303 | 304 | //显示技能 305 | patch(0x12DC1A, "x33"); 306 | patch(0x12DC1B, "xC0"); 307 | patch(0x12DC5A, "x33"); 308 | patch(0x12DC5B, "xC0"); 309 | patch(0x1BFABE, "xEB"); 310 | patch(0x442CC0, "x90"); 311 | patch(0x442CC1, "x40"); 312 | patch(0x442CC2, "x30"); 313 | patch(0x442CC3, "xC0"); 314 | patch(0x442CC4, "x90"); 315 | patch(0x442CC5, "x90"); 316 | patch(0x443375, "x30"); 317 | patch(0x443376, "xC0"); 318 | patch(0x45A641, "x90"); 319 | patch(0x45A642, "x90"); 320 | patch(0x45A643, "x33"); 321 | patch(0x45A644, "xC0"); 322 | patch(0x45A645, "x90"); 323 | patch(0x45A646, "x90"); 324 | patch(0x45E79E, "x90"); 325 | patch(0x45E79F, "x90"); 326 | patch(0x45E7A0, "x33"); 327 | patch(0x45E7A1, "xC0"); 328 | patch(0x45E7A2, "x90"); 329 | patch(0x45E7A3, "x90"); 330 | patch(0x466527, "x90"); 331 | patch(0x466528, "x90"); 332 | patch(0x46B258, "x90"); 333 | patch(0x46B259, "x33"); 334 | patch(0x46B25A, "xC0"); 335 | patch(0x46B25B, "x90"); 336 | patch(0x46B25C, "x90"); 337 | patch(0x46B25D, "x90"); 338 | patch(0x4A11A0, "x33"); 339 | patch(0x4A11A1, "xC0"); 340 | patch(0x54C0BF, "x90"); 341 | patch(0x54C0C0, "x33"); 342 | patch(0x54C0C1, "xC0"); 343 | patch(0x54C0C2, "x90"); 344 | patch(0x54C0C3, "x90"); 345 | patch(0x54C0C4, "x90"); 346 | patch(0x5573FE, "x90"); 347 | patch(0x5573FF, "x90"); 348 | patch(0x557400, "x90"); 349 | patch(0x557401, "x90"); 350 | patch(0x557402, "x90"); 351 | patch(0x557403, "x90"); 352 | patch(0x55E15C, "x90"); 353 | patch(0x55E15D, "x90"); 354 | 355 | //资源条 356 | patch(0x150981, "xEB/x02"); 357 | patch(0x1509FE, "xEB/x02"); 358 | patch(0x151597, "xEB/x02"); 359 | patch(0x151647, "xEB/x02"); 360 | patch(0x151748, "xEB/x02"); 361 | patch(0x1BED19, "xEB/x02"); 362 | patch(0x314A9E, "xEB/x02"); 363 | patch(0x21EAD4, "xEB"); 364 | patch(0x21EAE8, "x03"); 365 | 366 | //野外显血 367 | patch(0x166E5E, "x90/x90/x90/x90/x90/x90/x90/x90"); 368 | patch(0x16FE0A, "x33/xC0/x90/x90"); 369 | 370 | //无限取消 371 | patch(0x23D60F, "xEB"); 372 | patch(0x21EAD4, "x03"); 373 | patch(0x21EAE8, "x03"); 374 | 375 | //防秒 376 | //patch(0x704BB0, "x83/xF9/x00/xF/x85/x3/x0/x0/x0/x6A/x3/x59/x83/xF9/x12/xF/x87/xEF/x87/x83/xFF/xE9/x4B/x86/xB3/xFF"); 377 | //patch(0x23D20C, "xE9/x9F/x79/x4C/x00"); 378 | 379 | //特殊 380 | //过检测 381 | 382 | 383 | ////设置单位动作 384 | //patch(0x2C1E10, "xC3/x90/x90"); 385 | 386 | ////用户控制强制关闭 387 | //patch(0x2D3300, "xC3/x90/x90"); 388 | 389 | ////防选单位 -过MH 390 | //patch(0x2C5A7E, "x90/x90"); 391 | 392 | ////防清选 393 | //patch(0x2C5AB0, "xC3"); 394 | } 395 | 396 | 397 | 398 | 399 | //1.24E 400 | public static void SetWriteMemoryOneFourE() 401 | { 402 | //大地图显示单位 403 | patch(0x39EBBC, "x70"); 404 | patch(0x3A2030,"x90/x90"); 405 | patch(0x3A20DB,"x90/x90"); 406 | 407 | //分辨幻想 408 | patch(0x28357C, "x40"); 409 | patch(0x28357D, "xC3"); 410 | 411 | //显示物品神符 412 | patch(0x3A201B, "xEB"); 413 | patch(0x40A864, "x90"); 414 | patch(0x40A865, "x90"); 415 | 416 | //清除小地图迷雾 417 | patch(0x357065, "x90/x90"); 418 | 419 | //显示小地图单位 420 | patch(0x361F7C, "x00"); 421 | 422 | //敌方信号 423 | patch(0x43F9A6, "x3B"); 424 | patch(0x43F9A9, "x85"); 425 | patch(0x43F9B9, "x3B"); 426 | patch(0x43F9BC, "x85"); 427 | 428 | //小地图他人提示 429 | patch(0x3345E9, "x39/xC0/x0F/x85"); 430 | 431 | //显示资源 432 | patch(0x36058A, "x90"); 433 | patch(0x36058B, "x90"); 434 | 435 | //建筑规模 436 | patch(0x34E8E2, "xB8"); 437 | patch(0x34E8E3, "xC8"); 438 | patch(0x34E8E4, "x00"); 439 | patch(0x34E8E5, "x00"); 440 | patch(0x34E8E7, "x90"); 441 | patch(0x34E8EA, "xB8"); 442 | patch(0x34E8EB, "x64"); 443 | patch(0x34E8EC, "x00"); 444 | patch(0x34E8ED, "x00"); 445 | patch(0x34E8EF, "x90"); 446 | 447 | 448 | //显示技能 449 | patch(0x2031EC, "x90"); 450 | patch(0x2031ED, "x90"); 451 | patch(0x2031EE, "x90"); 452 | patch(0x2031EF, "x90"); 453 | patch(0x2031F0, "x90"); 454 | patch(0x2031F1, "x90"); 455 | patch(0x34FDE8, "x90"); 456 | patch(0x34FDE9, "x90"); 457 | 458 | //显示冷却时间 459 | patch(0x28ECFE, "xEB"); 460 | patch(0x34FE26, "x90"); 461 | patch(0x34FE27, "x90"); 462 | patch(0x34FE28, "x90"); 463 | patch(0x34FE29, "x90"); 464 | 465 | //无限取消 466 | patch(0x57BA7C, "xEB"); 467 | patch(0x5B2D77, "x03"); 468 | patch(0x5B2D8B, "x03"); 469 | 470 | 471 | //数显移速 472 | patch(0x87EA63, "x25/x30/x2e/x32/x66/x7c/x52/x00"); 473 | patch(0x87EA70, "x8d/x4c/x24/x18/xd9/x44/x24/x60/x83/xec/x08/xdd/x1c/x24/x68"); 474 | int tmp = 0x87EA63 + (int)GetDllAddre("War3","game.dll"); 475 | 476 | byte[] tmpB = BitConverter.GetBytes((int)(new IntPtr(tmp))); 477 | 478 | string temC = ""; 479 | for(int i=0;i窗体前置 31 | /// 32 | /// 33 | /// 34 | /// 35 | [DllImport("User32.dll", EntryPoint = "SetForegroundWindow")] 36 | public static extern int SetForegroundWindow(IntPtr FromUp); 37 | 38 | [DllImport("User32.dll", EntryPoint = "ReleaseDC")] 39 | static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); 40 | 41 | /// 获得焦点句柄 42 | /// 43 | /// 44 | /// 45 | [DllImport("user32.dll", EntryPoint = "GetForegroundWindow")] 46 | public static extern IntPtr GetForegroundWindow(); 47 | 48 | /// 重写WndProc()方法,通过监视系统消息,来调用过程 49 | /// 50 | /// 51 | /// 52 | protected override void WndProc(ref Message m)//监视Windows消息 53 | { 54 | const int WM_HOTKEY = 0x0312;//m.Msg值为0x0312表示按下热键 55 | //const int WM_MOVE = 0x3; 56 | 57 | 58 | switch (m.Msg) 59 | { 60 | case WM_HOTKEY: 61 | ProcessHotkey(m);//按下热键时调用ProcessHotkey()函数 62 | break; 63 | } 64 | 65 | base.WndProc(ref m); //将系统消息传递自父类的WndProc 66 | } 67 | 68 | 69 | /// 是否在聊天 70 | /// 71 | /// 72 | /// 73 | public bool IsChatByVersion(string version) 74 | { 75 | int address = 0; 76 | if ("1.20E".Equals(version) || "1.21".Equals(version)) 77 | address = 0x45CB8C; 78 | else if ("1.24E".Equals(version) || "1.24B".Equals(version)) 79 | address = 0xAE8450; 80 | 81 | int isChat = WriteMemory.ReadMemoryValueINT(address, War.ProcessName); 82 | 83 | if (isChat == 0) 84 | { 85 | return false; 86 | } 87 | else 88 | { 89 | return true; 90 | } 91 | } 92 | 93 | /// 写注册表 94 | /// 95 | /// 96 | /// 97 | /// 98 | public static void SetRegEditData(string strName, string strValue) 99 | { 100 | RegistryKey hklm = Registry.CurrentUser; 101 | try 102 | { 103 | //System.Security.AccessControl.RegistrySecurity rs = new System.Security.AccessControl.RegistrySecurity(); 104 | //rs.AddAccessRule(new System.Security.AccessControl.RegistryAccessRule("Administrator", System.Security.AccessControl.RegistryRights.FullControl, System.Security.AccessControl.InheritanceFlags.ObjectInherit, System.Security.AccessControl.PropagationFlags.InheritOnly, System.Security.AccessControl.AccessControlType.Allow)); 105 | RegistryKey software = hklm.OpenSubKey("SOFTWARE\\Blizzard Entertainment\\Warcraft III", true); 106 | software.SetValue(strName, strValue, RegistryValueKind.DWord); 107 | } 108 | catch (Exception ex) 109 | { 110 | MessageBox.Show("塔攻范围可能无法使用,原因:"+ex.Message.ToString()); 111 | } 112 | finally 113 | { 114 | hklm.Close(); 115 | } 116 | } 117 | 118 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx功能区xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 119 | 120 | /// 提权 121 | /// 122 | /// 123 | /// 124 | /// 125 | /// 126 | /// 127 | /// 128 | /// 129 | /// 130 | [DllImport("advapi32.dll", SetLastError = true)] 131 | [return: MarshalAs(UnmanagedType.Bool)] 132 | static extern bool AdjustTokenPrivileges( 133 | IntPtr TokenHandle, 134 | [MarshalAs(UnmanagedType.Bool)]bool DisableAllPrivileges, 135 | ref TOKEN_PRIVILEGES NewState, 136 | UInt32 Zero, 137 | IntPtr Null1, 138 | IntPtr Null2); 139 | 140 | [DllImport("kernel32.dll", ExactSpelling = true)] 141 | internal static extern IntPtr GetCurrentProcess(); 142 | 143 | [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] 144 | internal static extern bool OpenProcessToken( 145 | IntPtr ProcessHandle, 146 | int DesiredAccess, 147 | ref IntPtr TokenHandle); 148 | 149 | [DllImport("advapi32.dll", SetLastError = true)] 150 | internal static extern bool LookupPrivilegeValue( 151 | string lpSystemName, 152 | string lpName, 153 | ref LUID lpLuid); 154 | 155 | [StructLayout(LayoutKind.Sequential)] 156 | internal struct TOKEN_PRIVILEGES 157 | { 158 | public int PrivilegeCount; 159 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] 160 | public LUID_AND_ATTRIBUTES[] Privileges; 161 | } 162 | 163 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 164 | internal struct LUID_AND_ATTRIBUTES 165 | { 166 | public LUID_AND_ATTRIBUTES(LUID Luid, int Attributes) 167 | { 168 | this.Luid = Luid; 169 | this.Attributes = Attributes; 170 | } 171 | public LUID Luid; 172 | public int Attributes; 173 | } 174 | 175 | 176 | internal const int SE_PRIVILEGE_ENABLED = 0x00000002; 177 | internal const int TOKEN_QUERY = 0x00000008; 178 | internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; 179 | internal const string SE_PRIVILEGE_NAMETEXT = "SeDebugPrivilege"; 180 | 181 | 182 | //提权 183 | public static bool SetPrivilege() 184 | { 185 | TOKEN_PRIVILEGES tmpKP = new TOKEN_PRIVILEGES(); 186 | 187 | tmpKP.PrivilegeCount = 1; 188 | 189 | LUID_AND_ATTRIBUTES[] LAA = new LUID_AND_ATTRIBUTES[1]; 190 | 191 | LAA[0] = new LUID_AND_ATTRIBUTES(0, SE_PRIVILEGE_ENABLED); 192 | 193 | tmpKP.Privileges = LAA; 194 | 195 | bool retVal = false; 196 | 197 | IntPtr hdlProcessHandle = IntPtr.Zero; 198 | IntPtr hdlTokenHandle = IntPtr.Zero; 199 | try 200 | { 201 | hdlProcessHandle = GetCurrentProcess(); 202 | 203 | retVal = OpenProcessToken(hdlProcessHandle, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref hdlTokenHandle); 204 | 205 | retVal = LookupPrivilegeValue(null, SE_PRIVILEGE_NAMETEXT, ref tmpKP.Privileges[0].Luid); 206 | 207 | retVal = AdjustTokenPrivileges(hdlTokenHandle, false, ref tmpKP, 0, IntPtr.Zero, IntPtr.Zero); 208 | } 209 | finally 210 | { 211 | WriteMemory.CloseHandle(hdlProcessHandle); 212 | WriteMemory.CloseHandle(hdlTokenHandle); 213 | } 214 | 215 | return retVal; 216 | } 217 | 218 | 219 | 220 | 221 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx自定义方法 开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 222 | 223 | 224 | 225 | /// 加载配置 226 | /// 227 | /// 228 | public void LoadConfig() 229 | { 230 | CK_OpenFullFigure.Checked = Properties.Settings.Default.OpenFullFigure; 231 | CK_FromFalseAllscreen.Checked = Properties.Settings.Default.FromFalseAllscreen; 232 | CK_VideoGama.Checked = Properties.Settings.Default.VideoGama; 233 | RB_KeyDownCloseConnection.Checked = Properties.Settings.Default.KeyDownCloseConnection; 234 | RB_CloseDescConnection.Checked = Properties.Settings.Default.CloseDescConnection; 235 | CB_EnlargeHorizon.Checked = Properties.Settings.Default.EnlargeHorizon; 236 | CB_ScreenBad.Checked = Properties.Settings.Default.ScreenBad; 237 | CB_ClearFog.Checked = Properties.Settings.Default.ClearFog; 238 | TX_KeySpeak.Text = Properties.Settings.Default.KeySpeak; 239 | 240 | TX_KeyNum7.Text = Properties.Settings.Default.KeyNum7; 241 | TX_KeyNum8.Text = Properties.Settings.Default.KeyNum8; 242 | TX_KeyNum4.Text = Properties.Settings.Default.KeyNum4; 243 | TX_KeyNum5.Text = Properties.Settings.Default.KeyNum5; 244 | TX_KeyNum1.Text = Properties.Settings.Default.KeyNum1; 245 | TX_KeyNum2.Text = Properties.Settings.Default.KeyNum2; 246 | } 247 | 248 | 249 | /// 保存配置 250 | /// 251 | /// 252 | public void SaveConfig() 253 | { 254 | Properties.Settings.Default.OpenFullFigure = CK_OpenFullFigure.Checked; 255 | Properties.Settings.Default.FromFalseAllscreen = CK_FromFalseAllscreen.Checked; 256 | Properties.Settings.Default.VideoGama = CK_VideoGama.Checked; 257 | Properties.Settings.Default.KeyDownCloseConnection = RB_KeyDownCloseConnection.Checked; 258 | Properties.Settings.Default.CloseDescConnection = RB_CloseDescConnection.Checked; 259 | Properties.Settings.Default.EnlargeHorizon = CB_EnlargeHorizon.Checked; 260 | Properties.Settings.Default.ScreenBad = CB_ScreenBad.Checked; 261 | Properties.Settings.Default.ClearFog = CB_ClearFog.Checked; 262 | 263 | Properties.Settings.Default.DotaImbaCmd = CB_DotaImbaCmd.SelectedIndex; 264 | 265 | 266 | Properties.Settings.Default.KeySpeak = TX_KeySpeak.Text; 267 | 268 | Properties.Settings.Default.KeyNum7 = TX_KeyNum7.Text; 269 | Properties.Settings.Default.KeyNum8 = TX_KeyNum8.Text; 270 | Properties.Settings.Default.KeyNum4 = TX_KeyNum4.Text; 271 | Properties.Settings.Default.KeyNum5 = TX_KeyNum5.Text; 272 | Properties.Settings.Default.KeyNum1 = TX_KeyNum1.Text; 273 | Properties.Settings.Default.KeyNum2 = TX_KeyNum2.Text; 274 | Properties.Settings.Default.Save(); 275 | 276 | } 277 | 278 | 279 | /// 根据数组索引断开端口 280 | /// 281 | /// 282 | /// 283 | public void ClosRemoteByIndex(int index) 284 | { 285 | if (Disconnecter.GetRemoteProt().Length >= index) 286 | { 287 | int[] RemoteProt = Disconnecter.GetRemoteProt(); 288 | Array.Sort(RemoteProt); 289 | 290 | for (int i = 1; i < RemoteProt.Length; i++) 291 | { 292 | Console.WriteLine(RemoteProt[i]); 293 | } 294 | 295 | try 296 | { 297 | Disconnecter.CloseRemotePort(RemoteProt[index]); 298 | } 299 | catch (Exception ex) 300 | { 301 | ex.Message.ToString(); 302 | } 303 | } 304 | } 305 | 306 | /// 转UTF-8 307 | /// 308 | /// 309 | /// 310 | /// 311 | private string ConvertEncode(string input) 312 | { 313 | byte[] b_utf8 = Encoding.UTF8.GetBytes(input); 314 | byte[] dst_utf8 = Encoding.Convert(Encoding.Default, Encoding.UTF8, b_utf8, 0, b_utf8.Length); 315 | string result = Encoding.UTF8.GetString(dst_utf8, 0, dst_utf8.Length); 316 | return result; 317 | } 318 | 319 | 320 | public void NotWinAccess(Win32Exception ex) 321 | { 322 | MessageBox.Show(ex.Message.ToString() + "\n权限不足,如果是Windows7或Vista用户请右键管理员运行或使用该软件Win7版! "); 323 | FM_DemonWar_FormClosing(null, null); 324 | FM_DemonWar_FormClosed(null, null); 325 | } 326 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx自定义方法 结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 327 | 328 | 329 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx窗体控件事件 开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 330 | 331 | 332 | private bool isChat = false; 333 | 334 | public bool IsChat 335 | { 336 | get { return isChat; } 337 | set 338 | { 339 | if (isChat != value) 340 | { 341 | if (value) 342 | { 343 | ChangeKey.KeyModifyOFF(this.Handle); 344 | } 345 | else 346 | { 347 | string[] keyGroup = new string[] { 348 | TX_KeyNum7.Text , TX_KeyNum8.Text, 349 | TX_KeyNum4.Text , TX_KeyNum5.Text, 350 | TX_KeyNum1.Text , TX_KeyNum2.Text, 351 | TX_KeySpeak.Text, TX_Skill0.Text, 352 | TX_Skill1.Text , TX_Skill2.Text, 353 | TX_Skill3.Text , TX_Skill4.Text, 354 | TX_Skill5.Text , TX_bag1.Text, 355 | TX_bag2.Text , TX_bag3.Text, 356 | TX_bag4.Text , TX_bag5.Text, 357 | TX_bag6.Text }; 358 | 359 | ChangeKey.KeyModifyOn(this.Handle, keyGroup); 360 | } 361 | isChat = value; 362 | } 363 | 364 | isChat = value; 365 | } 366 | } 367 | 368 | 369 | private IntPtr foregroundWin = IntPtr.Zero; 370 | 371 | bool isElse = true; //标示:是否执行最后的else; 372 | 373 | //封装字段:当前前置窗体 374 | public IntPtr ForegroundWin 375 | { 376 | set 377 | { 378 | if (foregroundWin != value) 379 | { 380 | foregroundWin = value; 381 | if (value == War.HWnd) 382 | { 383 | isElse = true; 384 | string[] keyGroup = new string[] { 385 | TX_KeyNum7.Text , TX_KeyNum8.Text, 386 | TX_KeyNum4.Text , TX_KeyNum5.Text, 387 | TX_KeyNum1.Text , TX_KeyNum2.Text, 388 | TX_KeySpeak.Text, TX_Skill0.Text, 389 | TX_Skill1.Text , TX_Skill2.Text, 390 | TX_Skill3.Text , TX_Skill4.Text, 391 | TX_Skill5.Text , TX_bag1.Text, 392 | TX_bag2.Text , TX_bag3.Text, 393 | TX_bag4.Text , TX_bag5.Text, 394 | TX_bag6.Text }; 395 | 396 | ChangeKey.KeyModifyOn(this.Handle, keyGroup); 397 | 398 | if (CK_VideoGama.Checked) 399 | { 400 | Video.GamaValue = War.GamaValue; 401 | Video.SetGamma(); 402 | } 403 | else 404 | { 405 | War.GamaValue = 0.1; 406 | Video.GamaValue = War.GamaValue; 407 | Video.SetGamma(); 408 | } 409 | } 410 | else 411 | { 412 | if (isElse) 413 | { 414 | isElse = false; 415 | Video.GamaValue = 0.1; 416 | Video.SetGamma(); 417 | ChangeKey.KeyModifyOFF(this.Handle); 418 | } 419 | } 420 | } 421 | } 422 | } 423 | 424 | 425 | 426 | 427 | public void AutoStart() 428 | { 429 | DialogResult result = MessageBox.Show("检测到您重新启动游戏,是否开启选项?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question); 430 | if (result == DialogResult.Yes) 431 | { 432 | CK_FromFalseAllscreen_CheckedChanged(null, null); //气全图 433 | CB_DisplayInvisible_CheckedChanged(null, null); //显示隐形 434 | CB_ClearFog_CheckedChanged(null, null); //清除迷雾 435 | CB_FogSelected_CheckedChanged(null, null); 436 | CB_PassAH_CheckedChanged(null, null); //过-Ah 437 | CB_ShowHp_CheckedChanged(null, null); //1.20E显血 438 | CB_ScreenBad_CheckedChanged(null, null); //DotaIMBA防切屏崩溃 439 | CK_ShowMana_CheckedChanged(null, null); //显蓝 440 | CK_OpenFullFigure_CheckedChanged(null, null); //窗口全屏 441 | CB_EnlargeHorizon_CheckedChanged(null, null); //扩大视野 442 | CK_VideoGama_CheckedChanged(null, null); //亮度调整 443 | CB_SkillNoCD_CheckedChanged(null, null); //技能无CD 444 | } 445 | } 446 | 447 | 448 | private void FM_DemonWar_Load(object sender, EventArgs e) 449 | { 450 | bool IsProcess = SetPrivilege(); //获得内存操作权限 451 | if (IsProcess) 452 | { 453 | War.GameName = "Warcraft III"; 454 | War.ProcessName = "War3"; 455 | War.DllName = "game.dll"; 456 | War.State = "未运行"; 457 | War.GamaValue = 0.1; 458 | 459 | 460 | War.CallForm = new War.callForm(AutoStart); 461 | 462 | War.HWnd = Api.FindWindow(War.GameName, War.GameName); 463 | 464 | 465 | if (War.HWnd != IntPtr.Zero) 466 | { 467 | War.BaseAddre = WriteMemory.GetDllAddre(War.ProcessName, War.DllName); 468 | //War.Version = GetWarVersion.GetVersion(War.ProcessName, War.DllName); 469 | //string WarPath = GetWarVersion.GetUrPath(War.ProcessName); 470 | //War.Path = WarPath.Substring(0, WarPath.LastIndexOf("\\")); 471 | //War.PId = WriteMemory.GetPidByProcessName(War.ProcessName); 472 | } 473 | 474 | LoadConfig(); //加载配置 475 | TM_State.Enabled = true; //打开计时器 476 | } 477 | else 478 | { 479 | MessageBox.Show("取权失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); 480 | } 481 | } 482 | 483 | 484 | private void TM_State_Tick(object sender, EventArgs e) 485 | { 486 | 487 | War.HWnd = Api.FindWindow(War.GameName, War.GameName); 488 | 489 | if (War.HWnd != IntPtr.Zero) 490 | { 491 | ForegroundWin = GetForegroundWindow(); 492 | IsChat = IsChatByVersion(War.Version); 493 | 494 | if (LB_WarSate.ForeColor != Color.Red) 495 | { 496 | LB_WarSate.ForeColor = Color.Red; 497 | } 498 | LB_Version.Text = "版本:" + War.Version; 499 | } 500 | else 501 | { 502 | if (LB_WarSate.ForeColor != Color.Gray) 503 | { 504 | LB_WarSate.ForeColor = Color.Gray; 505 | } 506 | } 507 | LB_WarSate.Text = War.State; 508 | 509 | } 510 | 511 | private void WarOver_Click(object sender, EventArgs e) 512 | { 513 | if (War.HWnd != IntPtr.Zero) 514 | { 515 | //GameOver 516 | Disconnecter.CloseLocalPort(6112); 517 | } 518 | } 519 | 520 | private void Click_CloseAllRemote(object sender, EventArgs e) 521 | { 522 | if (War.HWnd != IntPtr.Zero) 523 | { 524 | string[] TCPlist = Disconnecter.Connections(); 525 | 526 | //TCP连接的位置 527 | if (RB_CloseDescConnection.Checked) 528 | { 529 | int[] remoteProt = Disconnecter.GetRemoteProt(); 530 | string orderRemote = TX_ClosOrderRemote.Text; 531 | 532 | if (orderRemote.Length > remoteProt.Length) 533 | { 534 | orderRemote = orderRemote.Substring(0, remoteProt.Length); 535 | } 536 | if (remoteProt.Length != 0) 537 | { 538 | for (int i = 0; i < TX_ClosOrderRemote.Text.Length; i++) 539 | { 540 | Disconnecter.CloseRemotePort(remoteProt[(int)orderRemote[i]]); 541 | } 542 | } 543 | 544 | } 545 | else 546 | { 547 | //MessageBox.Show("请选择踢出方式", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 548 | } 549 | } 550 | } 551 | 552 | 553 | //按下设定的键时调用该函数 554 | private void ProcessHotkey(Message m) 555 | { 556 | IntPtr id = m.WParam; 557 | string sid = id.ToString(); 558 | switch (sid) 559 | { 560 | case "7": 561 | int[] Num7 = { 103}; 562 | ChangeKey.KeyBoardDo(Num7, War.HWnd); 563 | break; 564 | case "8": 565 | int[] Num8 = { 104 }; 566 | ChangeKey.KeyBoardDo(Num8, War.HWnd); 567 | break; 568 | case "4": 569 | int[] Num4 = { 100 }; 570 | ChangeKey.KeyBoardDo(Num4, War.HWnd); 571 | break; 572 | case "5": 573 | int[] Num5 = { 101 }; 574 | ChangeKey.KeyBoardDo(Num5, War.HWnd); 575 | break; 576 | case "1": 577 | int[] Num1 = { 97 }; 578 | ChangeKey.KeyBoardDo(Num1, War.HWnd); 579 | break; 580 | case "2": 581 | int[] Num2 = { 98 }; 582 | ChangeKey.KeyBoardDo(Num2, War.HWnd); 583 | break; 584 | case "10": 585 | ClosRemoteByIndex(1); 586 | break; 587 | case "11": 588 | ClosRemoteByIndex(2); 589 | break; 590 | case "12": 591 | ClosRemoteByIndex(3); 592 | break; 593 | case "13": 594 | ClosRemoteByIndex(4); 595 | break; 596 | case "14": 597 | ClosRemoteByIndex(5); 598 | break; 599 | case "15": 600 | ClosRemoteByIndex(6); 601 | break; 602 | case "16": 603 | ClosRemoteByIndex(7); 604 | break; 605 | case "17": 606 | ClosRemoteByIndex(8); 607 | break; 608 | case "18": 609 | ClosRemoteByIndex(9); 610 | break; 611 | case "20": 612 | if (War.GamaValue > 0.05) 613 | Video.GamaValue = War.GamaValue -= 0.01; 614 | if (CK_VideoGama.Checked) Video.SetGamma(); break; 615 | case "21": 616 | if (War.GamaValue < 0.1) 617 | Video.GamaValue = War.GamaValue += 0.01; 618 | if (CK_VideoGama.Checked) Video.SetGamma(); break; 619 | case "22": 620 | if (War.HWnd == GetForegroundWindow()) 621 | { 622 | if (War.IsCanSpeak) 623 | { 624 | string str = TX_SpeakContent.Text; 625 | if (str != "") 626 | { 627 | War.IsCanSpeak = false; 628 | Clipboard.SetText(ConvertEncode(str)); 629 | ChangeKey.WarSpeak(War.HWnd); 630 | War.IsCanSpeak = true; 631 | } 632 | } 633 | } break; 634 | case "23": 635 | CrowdedRoom.VsRoom(); 636 | break; 637 | case "24": 638 | War.LensValue = War.LensValue + 300; break; 639 | case "25": 640 | Video.SendMouseDown(War.HWnd, 0, 30); break; 641 | case "26": 642 | Video.SendMouseDown(War.HWnd, 1, 30); break; 643 | case "27": 644 | Video.SendMouseDown(War.HWnd, 2, 30); break; 645 | case "28": 646 | Video.SendMouseDown(War.HWnd, 3, 30); break; 647 | case "29": 648 | Video.SendMouseDown(War.HWnd, 4, 30); break; 649 | case "30": 650 | Video.SendMouseDown(War.HWnd, 5, 30); break; 651 | case "31": 652 | Video.SendMouseDown(War.HWnd, 6, 30); break; 653 | case "32": 654 | Video.SendMouseDown(War.HWnd, 7, 30); break; 655 | case "33": 656 | Video.SendMouseDown(War.HWnd, 8, 30); break; 657 | case "34": 658 | Video.SendMouseDown(War.HWnd, 9, 30); break; 659 | case "35": 660 | Video.SendMouseDown(War.HWnd, 10,30); break; 661 | case "36": 662 | Video.SendMouseDown(War.HWnd, 11,30); break; 663 | } 664 | } 665 | 666 | 667 | 668 | private void CK_OpenFullFigure_CheckedChanged(object sender, EventArgs e) 669 | { 670 | if (War.HWnd != IntPtr.Zero) 671 | { 672 | if (CK_OpenFullFigure.Checked) 673 | { 674 | switch (War.Version) 675 | { 676 | case "1.20E": WriteMemory.SetWriteMemoryOneTwoE(); break; 677 | case "1.24E": WriteMemory.SetWriteMemoryOneFourE(); break; 678 | case "1.24B": WriteMemory.SetWriteMemoryOneFourB(); break; 679 | } 680 | //前置窗体 681 | SetForegroundWindow(War.HWnd); 682 | } 683 | } 684 | } 685 | 686 | private void CK_FromFalseAllscreen_CheckedChanged(object sender, EventArgs e) 687 | { 688 | if (War.HWnd != IntPtr.Zero) 689 | { 690 | if (CK_FromFalseAllscreen.Checked) 691 | { 692 | Video.PseudoFullScreen(true); 693 | } 694 | else 695 | { 696 | Video.PseudoFullScreen(false); 697 | } 698 | } 699 | } 700 | 701 | private void CK_ShowMana_CheckedChanged(object sender, EventArgs e) 702 | { 703 | if (War.HWnd != IntPtr.Zero) 704 | { 705 | if (CK_ShowMana.Checked) 706 | { 707 | bool isOpen = false; 708 | 709 | if (File.Exists(War.Path + "\\" + "TempReplay.w3g")) 710 | { 711 | DialogResult result = MessageBox.Show("游戏中开启此选项可能会导致魔兽崩溃,如果只运行并未开始游戏可开启该功能,是否开启?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); 712 | if (result == DialogResult.Yes) 713 | { 714 | isOpen = true; 715 | } 716 | } 717 | else 718 | { 719 | isOpen = true; 720 | } 721 | if (isOpen) 722 | { 723 | bool isOk = DllInject.ManaStart("mana.dll", true); 724 | } 725 | } 726 | } 727 | } 728 | 729 | 730 | //按键前事件验证 731 | private void TX_PreviewKey_Validate(object sender, PreviewKeyDownEventArgs e) 732 | { 733 | TextBox key = (TextBox)sender; 734 | if (!"Delete".Equals(e.KeyCode.ToString()) && !"Back".Equals(e.KeyCode.ToString())) 735 | { 736 | string keyContent = ChangeKey.KeyFilter(e, ((TextBox)sender).Name); 737 | 738 | if (keyContent != "") 739 | { 740 | key.Text = e.KeyCode.ToString(); 741 | } 742 | } 743 | else 744 | { 745 | key.Text = ""; 746 | } 747 | } 748 | 749 | //按键后事件验证 750 | public void TX_KeyNumModify_Validate(Object sender, KeyEventArgs e) 751 | { 752 | switch (e.Modifiers.ToString().ToLower()) 753 | { 754 | case "alt": if (e.KeyCode.ToString().ToLower().IndexOf("menu") == -1) 755 | if (sender is TextBox) 756 | (sender as TextBox).Text = "Alt+" + e.KeyCode.ToString(); break; 757 | case "shift": if (e.KeyCode.ToString().ToLower().IndexOf("shiftkey") == -1) 758 | if (sender is TextBox) 759 | (sender as TextBox).Text = "Shift+" + e.KeyCode.ToString(); break; 760 | case "control": if (e.KeyCode.ToString().ToLower().IndexOf("controlkey") == -1) 761 | if (sender is TextBox) 762 | (sender as TextBox).Text = "Control+" + e.KeyCode.ToString(); break; 763 | } 764 | } 765 | 766 | 767 | 768 | private void CK_VideoGama_CheckedChanged(object sender, EventArgs e) 769 | { 770 | if (War.HWnd != IntPtr.Zero) 771 | { 772 | if (CK_VideoGama.Checked) 773 | { 774 | int ResultGammaValue = Video.SetGamma(); 775 | 776 | ChangeKey.UninstallKey(this.Handle, new int[] { 21, 22 }); 777 | 778 | ChangeKey.KeyModify(this.Handle,20, "Up", 1); 779 | ChangeKey.KeyModify(this.Handle,21, "Down", 1); 780 | } 781 | else 782 | { 783 | War.GamaValue = 0.1; 784 | Video.GamaValue = War.GamaValue; 785 | Video.SetGamma(); 786 | 787 | ChangeKey.UninstallKey(this.Handle, new int[] { 21, 22 }); 788 | } 789 | } 790 | } 791 | 792 | private void RB_CloseConnection_CheckedChanged(object sender, EventArgs e) 793 | { 794 | if (War.HWnd != IntPtr.Zero) 795 | { 796 | int[] keyIndexGroup ={ 10, 11, 12, 13, 14, 15, 16, 17, 18 }; 797 | 798 | if (RB_CloseDescConnection.Checked) 799 | { 800 | ChangeKey.UninstallKey(this.Handle, keyIndexGroup); 801 | TX_ClosOrderRemote.Enabled = true; 802 | BT_CloseALLRemote.Enabled = true; 803 | } 804 | else if (RB_KeyDownCloseConnection.Checked) 805 | { 806 | ChangeKey.UninstallKey(this.Handle, keyIndexGroup); 807 | 808 | ChangeKey.KeyModify(this.Handle, 10, "D1", 1); 809 | ChangeKey.KeyModify(this.Handle, 11, "D2", 1); 810 | ChangeKey.KeyModify(this.Handle, 12, "D3", 1); 811 | ChangeKey.KeyModify(this.Handle, 13, "D4", 1); 812 | ChangeKey.KeyModify(this.Handle, 14, "D5", 1); 813 | ChangeKey.KeyModify(this.Handle, 15, "D6", 1); 814 | ChangeKey.KeyModify(this.Handle, 16, "D7", 1); 815 | ChangeKey.KeyModify(this.Handle, 17, "D8", 1); 816 | ChangeKey.KeyModify(this.Handle, 18, "D9", 1); 817 | 818 | TX_ClosOrderRemote.Enabled = false; 819 | BT_CloseALLRemote.Enabled = false; 820 | } 821 | } 822 | } 823 | 824 | 825 | 826 | private void TX_KeySpeak_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) 827 | { 828 | if (!"Alt".Equals(e.Modifiers.ToString())) 829 | { 830 | string keyContent = ChangeKey.KeyFilter(e, ""); 831 | 832 | if (keyContent != "") 833 | { 834 | TX_KeySpeak.Text = keyContent; 835 | } 836 | } 837 | } 838 | 839 | 840 | private void CN_DotaImbaCmd_SelectedIndexChanged(object sender, EventArgs e) 841 | { 842 | switch(CB_DotaImbaCmd.SelectedIndex) 843 | { 844 | case 0: TX_SpeakContent.Text = "-sdimstscfefnfrakbb"; break; 845 | case 1: TX_SpeakContent.Text = "-ardmimstakssscfefnbb-nd"; break; 846 | case 2: TX_SpeakContent.Text = "-ardmimstakssscfefnbb"; break; 847 | case 3: TX_SpeakContent.Text = "-ardmimstakssscfefnbb-wtf"; break; 848 | case 4: TX_SpeakContent.Text = "-ay"; break; 849 | case 5: TX_SpeakContent.Text = "-apimoxay"; break; 850 | } 851 | } 852 | 853 | 854 | private void BT_DeleteKeyModify_Click(object sender, EventArgs e) 855 | { 856 | TX_KeyNum7.Text = ""; 857 | TX_KeyNum8.Text = ""; 858 | TX_KeyNum4.Text = ""; 859 | TX_KeyNum5.Text = ""; 860 | TX_KeyNum1.Text = ""; 861 | TX_KeyNum2.Text = ""; 862 | TX_KeySpeak.Text = ""; 863 | } 864 | private void FM_DemonWar_FormClosing(object sender, FormClosingEventArgs e) 865 | { 866 | Video.GamaValue = (float)0.1; //恢复屏幕亮度 867 | Video.SetGamma(); 868 | SaveConfig(); //保存配置 869 | } 870 | 871 | private void FM_DemonWar_FormClosed(object sender, FormClosedEventArgs e) 872 | { 873 | this.Dispose(true); 874 | this.Close(); 875 | CrowdedRoom.OverCrowded(); 876 | Application.Exit(); 877 | Application.ExitThread(); 878 | } 879 | 880 | private void CB_DisplayInvisible_CheckedChanged(object sender, EventArgs e) 881 | { 882 | if (War.HWnd != IntPtr.Zero) 883 | { 884 | if (CB_DisplayInvisible.Checked) 885 | { 886 | switch (War.Version) 887 | { 888 | case "1.20E": WriteMemory.DisplayInvisible120E(); break; 889 | case "1.24E": WriteMemory.DisplayInvisible124E(); break; 890 | case "1.24B": WriteMemory.DisplayInvisible124B(); break; 891 | } 892 | } 893 | } 894 | } 895 | 896 | private void CB_FogSelected_CheckedChanged(object sender, EventArgs e) 897 | { 898 | if (War.HWnd != IntPtr.Zero) 899 | { 900 | if (CB_FogSelected.Checked) 901 | { 902 | switch (War.Version) 903 | { 904 | case "1.20E": WriteMemory.FogSelected120E(); break; 905 | case "1.24E": WriteMemory.FogSelected124E(); break; 906 | case "1.24B": WriteMemory.FogSelected124B(); break; 907 | } 908 | } 909 | } 910 | } 911 | 912 | private void CB_PassAH_CheckedChanged(object sender, EventArgs e) 913 | { 914 | if (War.HWnd != IntPtr.Zero) 915 | { 916 | if (CB_PassAH.Checked) 917 | { 918 | switch (War.Version) 919 | { 920 | case "1.20E": WriteMemory.PassAH120E(); break; 921 | case "1.24E": WriteMemory.PassAH124E(); break; 922 | case "1.24B": WriteMemory.PassAH124B(); break; 923 | } 924 | } 925 | } 926 | } 927 | 928 | private void CB_EnlargeHorizon_CheckedChanged(object sender, EventArgs e) 929 | { 930 | if (War.HWnd != IntPtr.Zero) 931 | { 932 | if (CB_EnlargeHorizon.Checked) 933 | { 934 | ChangeKey.KeyModify(this.Handle,24, "Left", 1); 935 | } 936 | else 937 | { 938 | ChangeKey.UnregisterHotKey(Handle, 24); 939 | } 940 | } 941 | } 942 | 943 | private void BT_VSROOM_Click(object sender, EventArgs e) 944 | { 945 | if (BT_VSROOM.Text.IndexOf("V S 擠 房") != -1) 946 | { 947 | BT_VSROOM.Text = "选择房间按下 Alt+空格 键"; 948 | 949 | ChangeKey.KeyModify(this.Handle,23, "Space", 1); 950 | } 951 | else 952 | { 953 | BT_VSROOM.Text = "V S 擠 房"; 954 | CrowdedRoom.iSquit = true; 955 | ChangeKey.UnregisterHotKey(Handle, 23); 956 | CrowdedRoom.OverCrowded(); 957 | } 958 | } 959 | 960 | private void BT_HFROOM_Click(object sender, EventArgs e) 961 | { 962 | if (BT_HFROOM.Text.IndexOf("浩 方 挤 房") != -1) 963 | { 964 | BT_HFROOM.Text = "取 消 挤 房"; 965 | 966 | CrowdedRoom.HfRoom(); 967 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx浩方配置 968 | } 969 | else 970 | { 971 | BT_HFROOM.Text = "浩 方 挤 房"; 972 | CrowdedRoom.iSquit = true; 973 | CrowdedRoom.OverCrowded(); 974 | } 975 | } 976 | 977 | private void CB_RowerRange_CheckedChanged(object sender, EventArgs e) 978 | { 979 | if (War.HWnd != IntPtr.Zero) 980 | { 981 | byte[][] modelByte = { WjeWar.Properties.Resources.AncientProtector, WjeWar.Properties.Resources.ziggurat }; 982 | string[] modelPath = { "Buildings\\nightelf\\AncientProtector", "Buildings\\Undead\\ziggurat" }; 983 | string[] modelName = { "AncientProtector.mdx", "ziggurat.mdx" }; 984 | 985 | if (CB_RowerRange.Checked) 986 | { 987 | string path = War.Path + "\\" + modelPath[0]; 988 | bool isSetup = FileManage.SetupModel(modelByte[0], path, modelName[0]); 989 | 990 | path = War.Path + "\\" + modelPath[1]; 991 | isSetup = FileManage.SetupModel(modelByte[1], path, modelName[1]); 992 | } 993 | else 994 | { 995 | FileManage.deleteFile(War.Path +"\\"+ modelPath[0] +"\\"+ modelName [0]); 996 | FileManage.deleteFile(War.Path + "\\" + modelPath[1] + "\\" + modelName[1]); 997 | } 998 | } 999 | } 1000 | 1001 | private void CB_SkillsMarkers_CheckedChanged(object sender, EventArgs e) 1002 | { 1003 | if (War.HWnd != IntPtr.Zero) 1004 | { 1005 | 1006 | byte[] modelByte = WjeWar.Properties.Resources.heroflamelord; 1007 | string modelName = "heroflamelord.mdx"; 1008 | 1009 | if (CB_SkillsMarkers.Checked) 1010 | { 1011 | bool isSetup = FileManage.SetupModel(modelByte, War.Path, modelName); 1012 | if (isSetup) 1013 | { 1014 | SetRegEditData("Allow Local Files", "00000001"); 1015 | } 1016 | else 1017 | { 1018 | MessageBox.Show("安装失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); 1019 | } 1020 | } 1021 | else 1022 | { 1023 | FileManage.deleteFile(War.Path + "\\" + modelName); 1024 | } 1025 | } 1026 | } 1027 | 1028 | private void CB_ShowFuzzy_CheckedChanged(object sender, EventArgs e) 1029 | { 1030 | if (War.HWnd != IntPtr.Zero) 1031 | { 1032 | 1033 | byte[][] modelByte = { WjeWar.Properties.Resources.FrostGlowBall64, WjeWar.Properties.Resources.Sword_1H_Miev_D_01, WjeWar.Properties.Resources.HeroWarden, WjeWar.Properties.Resources.yuelun }; 1034 | string modelPath = "Units\\nightelf\\HeroWarden"; 1035 | string[] modelName = { "FrostGlowBall64.blp", "Sword_1H_Miev_D_01.blp", "HeroWarden.mdx", "yuelun.mdx" }; 1036 | string path = War.Path + "\\" + modelPath; 1037 | 1038 | if (CB_ShowFuzzy.Checked) 1039 | { 1040 | bool isSetup = false; 1041 | for (int i = 0; i < modelName.Length; i++) 1042 | { 1043 | isSetup = FileManage.SetupModel(modelByte[i], path, modelName[i]); 1044 | } 1045 | 1046 | if (isSetup) 1047 | { 1048 | SetRegEditData("Allow Local Files", "00000001"); 1049 | } 1050 | else 1051 | { 1052 | MessageBox.Show("安装失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); 1053 | } 1054 | } 1055 | else 1056 | { 1057 | FileManage.deleteFile(path + "\\" + modelName[0]); 1058 | FileManage.deleteFile(path + "\\" + modelName[1]); 1059 | FileManage.deleteFile(path + "\\" + modelName[2]); 1060 | FileManage.deleteFile(path + "\\" + modelName[3]); 1061 | } 1062 | } 1063 | } 1064 | 1065 | 1066 | 1067 | private void CB_ShowHp_CheckedChanged(object sender, EventArgs e) 1068 | { 1069 | if (War.HWnd != IntPtr.Zero) 1070 | { 1071 | if (CB_ShowHp.Checked) 1072 | { 1073 | switch (War.Version) 1074 | { 1075 | case "1.20E": WriteMemory.patch(0x17F141, "x75"); break; 1076 | } 1077 | } 1078 | } 1079 | } 1080 | 1081 | private void CB_ScreenBad_CheckedChanged(object sender, EventArgs e) 1082 | { 1083 | if (War.HWnd != IntPtr.Zero) 1084 | { 1085 | if (CB_ScreenBad.Checked) 1086 | { 1087 | switch (War.Version) 1088 | { 1089 | case "1.20E": WriteMemory.ScreenBad120E(); break; 1090 | case "1.24E": WriteMemory.ScreenBad124E(); break; 1091 | case "1.24B": WriteMemory.ScreenBad124B(); break; 1092 | } 1093 | } 1094 | } 1095 | } 1096 | 1097 | 1098 | private void TX_ClosOrderRemote_TextChanged(object sender, EventArgs e) 1099 | { 1100 | bool isInt = System.Text.RegularExpressions.Regex.IsMatch(TX_ClosOrderRemote.Text, @"^[0-9]*[1-9][0-9]*$"); 1101 | } 1102 | 1103 | private void LB_NoCdSet_Click(object sender, EventArgs e) 1104 | { 1105 | if (PN_SkillNoCd.Visible) 1106 | { 1107 | PN_SkillNoCd.Hide(); 1108 | } 1109 | else 1110 | { 1111 | PN_SkillNoCd.Show(); 1112 | } 1113 | } 1114 | 1115 | 1116 | private void BT_DelAllNoCdKey_Click(object sender, EventArgs e) 1117 | { 1118 | TX_Skill0.Text = ""; 1119 | TX_Skill1.Text = ""; 1120 | TX_Skill2.Text = ""; 1121 | TX_Skill3.Text = ""; 1122 | TX_Skill4.Text = ""; 1123 | TX_Skill5.Text = ""; 1124 | } 1125 | 1126 | private void CB_SkillNoCD_CheckedChanged(object sender, EventArgs e) 1127 | { 1128 | if (War.HWnd != IntPtr.Zero) 1129 | { 1130 | if (CB_SkillNoCD.Checked) 1131 | { 1132 | switch (War.Version) 1133 | { 1134 | case "1.20E": 1135 | byte[] fileByte = WjeWar.Properties.Resources.NOCD120E; 1136 | DllInject.inject(fileByte, War.ProcessName, War.Path ,"NOCD_1.20e.dll"); 1137 | break; 1138 | case "1.24E": break; 1139 | case "1.24B": 1140 | fileByte = WjeWar.Properties.Resources.NOCD124B; 1141 | DllInject.inject(fileByte, War.ProcessName,War.Path ,"NOCD_1.24b.dll"); 1142 | break; 1143 | } 1144 | } 1145 | } 1146 | } 1147 | 1148 | private void LB_NoCdHelp_Click(object sender, EventArgs e) 1149 | { 1150 | MessageBox.Show( 1151 | "使用方法:\n 1.开启【技能无CD】后点击【设置】根据游戏中技能位置设置快捷键! \n " 1152 | +"2.请先释放 有施法动作的技能(如:拍拍熊第二个技能:超强力量)\n" 1153 | + " 3.按下【技能无CD】【设置】的快捷键相对位置,施放无指向性技能(如:拍拍熊 第一个技能)\n 4.成功释放后造成无法移动时,按 H 键保持原位恢复。\n" 1154 | +"例子:设置潮汐的第四个技能快捷键为【F4】,对敌人使用第一个技能后,马上按下F4施放大招,无法移动时请按H,保持原位恢复。" 1155 | , "| 无CD使用方法 |"); 1156 | } 1157 | 1158 | private void LB_About_Click(object sender, EventArgs e) 1159 | { 1160 | MessageBox.Show("未经允许,请忽非法传播!", "提示", MessageBoxButtons.OK); 1161 | } 1162 | 1163 | private void 打开WjeWarToolStripMenuItem_Click(object sender, EventArgs e) 1164 | { 1165 | WjeNotifyIcon_MouseDoubleClick(null,null); 1166 | } 1167 | 1168 | private void 开启基本功能ToolStripMenuItem_Click(object sender, EventArgs e) 1169 | { 1170 | this.CK_OpenFullFigure.Checked = false; 1171 | this.CK_OpenFullFigure.Checked = true; 1172 | } 1173 | 1174 | private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) 1175 | { 1176 | FM_DemonWar_FormClosing(null,null); 1177 | FM_DemonWar_FormClosed(null,null); 1178 | } 1179 | 1180 | private void WjeNotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) 1181 | { 1182 | this.WjeNotifyIcon.Visible = false; 1183 | this.ShowInTaskbar = true; 1184 | this.Show(); 1185 | WindowState = FormWindowState.Normal; 1186 | } 1187 | 1188 | private void FM_DemonWar_SizeChanged(object sender, EventArgs e) 1189 | { 1190 | if (this.WindowState == FormWindowState.Minimized) 1191 | { 1192 | this.Hide(); 1193 | this.ShowInTaskbar = false; 1194 | this.WjeNotifyIcon.Visible = true; 1195 | } 1196 | } 1197 | 1198 | private void LB_Wje_Click(object sender, EventArgs e) 1199 | { 1200 | MessageBox.Show("github:https://github.com/wuethan \n如有建议或Bug请提交邮箱:wuethanopen@gmail.com", "提示"); 1201 | } 1202 | 1203 | private void CB_ClearFog_CheckedChanged(object sender, EventArgs e) 1204 | { 1205 | if (War.HWnd != IntPtr.Zero) 1206 | { 1207 | if (CB_ClearFog.Checked) 1208 | { 1209 | switch (War.Version) 1210 | { 1211 | case "1.20E": WriteMemory.ClearFog120E(); break; 1212 | case "1.24E": WriteMemory.ClearFog124E(); break; 1213 | case "1.24B": WriteMemory.ClearFog124B(); break; 1214 | } 1215 | } 1216 | } 1217 | } 1218 | 1219 | private void LB_update_Click(object sender, EventArgs e) 1220 | { 1221 | System.Diagnostics.Process currentProcess; 1222 | currentProcess = System.Diagnostics.Process.Start("http://catfan.me/csharp/blog"); 1223 | } 1224 | 1225 | //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx窗体控件事件 结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1226 | 1227 | 1228 | } 1229 | } --------------------------------------------------------------------------------