├── .gitattributes
├── .github
└── ISSUE_TEMPLATE
│ └── 提交bug.md
├── .gitignore
├── LICENSE
├── README.md
├── jsmhToolChest.sln
└── jsmhToolChest
├── App.config
├── ClientLaunch
├── AddClientForm.Designer.cs
├── AddClientForm.cs
├── AddClientForm.resx
├── Client.cs
├── ModInfomationForm.Designer.cs
├── ModInfomationForm.cs
├── ModInfomationForm.resx
└── Mods.cs
├── Config.cs
├── Download
├── DonwloadForm.Designer.cs
├── DonwloadForm.cs
├── DonwloadForm.resx
└── DownloadUtil.cs
├── FastWin32.xml
├── FodyWeavers.xml
├── Libraries
├── DLLInjector.cs
├── File.cs
├── ProcessModules.cs
├── ProcessPatch.cs
├── ProcessWindows.cs
└── String.cs
├── LocalWebServer.cs
├── MainWindow.Designer.cs
├── MainWindow.cs
├── MainWindow.resx
├── ModsInject
└── ModsInject.cs
├── Netease
├── Antiban.cs
├── ClientLauncher.cs
├── Hook.cs
├── NeteaseClient.cs
├── RegeditRead.cs
└── WPFLauncher.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resource1.Designer.cs
├── Resource1.resx
├── Resources
├── Antiban.dll
├── Authlib.jar
├── CL.dll
├── CLInjector.exe
├── Injector.exe
├── Kupelo.dll
├── Socket.dll
├── add_32px.png
├── add_64px.png
├── copy_32px.png
├── done_32px.png
├── done_64px.png
├── download_32px.png
├── download_64px.png
├── folder_32px.png
├── folder_64px.png
├── reboot_32px.png
├── reboot_64px.png
├── waste_32px.png
└── waste_64px.png
├── UnCompress
├── UnCompressForm.Designer.cs
├── UnCompressForm.cs
├── UnCompressForm.resx
└── UnCompressUtil.cs
├── VersionCheck.cs
├── app.manifest
├── jsmhToolChest.csproj
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/提交bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 提交Bug
3 | about: 提交一个Bug
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Bug描述:**
11 | 请描述此Bug
12 |
13 | **截图:**
14 | 提供关于此Bug的截图
15 |
16 | **设备信息:**
17 | - 系统版本: [例: Windows 10]
18 | - 内部版本: [例: 19045.2846]
19 | - 系统类型: [例: 64位操作系统]
20 | - jsmhToolChest版本: [例: 5.0B14]
21 | - 网络环境: [例: 中国移动]
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # jsmhToolChest
2 | jsmhToolChest is a free and open source tool for WPFLauncher.
3 | Here is our website: [https://jsmh.red/](https://jsmh.red/)
4 |
5 | ## Usage
6 | You can get some usage on our [website](https://jsmh.red/).
7 |
8 | ## Runtime
9 | Please install .NET Framework 4.7.2 or higher version. [Download .NET Framework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472)
10 |
11 | ## Frequently Asked Questions
12 | We have listed some question on our [website](https://jsmh.red/).
13 |
14 | ## Issues
15 | If you notice any bugs or missing features, you can let us know by opening an issue [here](https://github.com/jsms2/jsmhToolChest/issues).
16 |
17 | ## License
18 | This is a project that is licensed under the GPLv3 license. When using, modifying or redistributing this code, it is important to comply with the terms and conditions of the GPLv3 license. The GPLv3 license is a free software license that ensures the freedom and openness of software users.
19 |
20 | ## Authors
21 | This program is made by JS.
22 |
--------------------------------------------------------------------------------
/jsmhToolChest.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.3.32929.385
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jsmhToolChest", "jsmhToolChest\jsmhToolChest.csproj", "{AC0CC16C-48B1-47BE-870D-A7690D12F472}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {AC0CC16C-48B1-47BE-870D-A7690D12F472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {AC0CC16C-48B1-47BE-870D-A7690D12F472}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {AC0CC16C-48B1-47BE-870D-A7690D12F472}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {AC0CC16C-48B1-47BE-870D-A7690D12F472}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {48B340B4-A32A-44E3-8B6C-6C14B0925219}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/jsmhToolChest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/AddClientForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace jsmhToolChest.ClientLaunch
2 | {
3 | partial class AddClientForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.button2 = new System.Windows.Forms.Button();
32 | this.button1 = new System.Windows.Forms.Button();
33 | this.textBox2 = new System.Windows.Forms.TextBox();
34 | this.label3 = new System.Windows.Forms.Label();
35 | this.label2 = new System.Windows.Forms.Label();
36 | this.textBox1 = new System.Windows.Forms.TextBox();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.SuspendLayout();
39 | //
40 | // button2
41 | //
42 | this.button2.Font = new System.Drawing.Font("微软雅黑", 16.125F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
43 | this.button2.Image = global::jsmhToolChest.Properties.Resources.done_64px;
44 | this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
45 | this.button2.Location = new System.Drawing.Point(23, 357);
46 | this.button2.Name = "button2";
47 | this.button2.Size = new System.Drawing.Size(763, 71);
48 | this.button2.TabIndex = 13;
49 | this.button2.Text = "添加";
50 | this.button2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
51 | this.button2.UseVisualStyleBackColor = true;
52 | this.button2.Click += new System.EventHandler(this.button2_Click);
53 | //
54 | // button1
55 | //
56 | this.button1.BackgroundImage = global::jsmhToolChest.Properties.Resources.folder_64px;
57 | this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
58 | this.button1.Location = new System.Drawing.Point(737, 271);
59 | this.button1.Name = "button1";
60 | this.button1.Size = new System.Drawing.Size(50, 50);
61 | this.button1.TabIndex = 12;
62 | this.button1.UseVisualStyleBackColor = true;
63 | this.button1.Click += new System.EventHandler(this.button1_Click);
64 | //
65 | // textBox2
66 | //
67 | this.textBox2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
68 | this.textBox2.Location = new System.Drawing.Point(23, 271);
69 | this.textBox2.Name = "textBox2";
70 | this.textBox2.Size = new System.Drawing.Size(708, 50);
71 | this.textBox2.TabIndex = 11;
72 | //
73 | // label3
74 | //
75 | this.label3.AutoSize = true;
76 | this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
77 | this.label3.Location = new System.Drawing.Point(16, 227);
78 | this.label3.Name = "label3";
79 | this.label3.Size = new System.Drawing.Size(178, 41);
80 | this.label3.TabIndex = 10;
81 | this.label3.Text = "客户端位置";
82 | //
83 | // label2
84 | //
85 | this.label2.AutoSize = true;
86 | this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
87 | this.label2.Location = new System.Drawing.Point(16, 103);
88 | this.label2.Name = "label2";
89 | this.label2.Size = new System.Drawing.Size(178, 41);
90 | this.label2.TabIndex = 9;
91 | this.label2.Text = "客户端名称";
92 | //
93 | // textBox1
94 | //
95 | this.textBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
96 | this.textBox1.Location = new System.Drawing.Point(23, 147);
97 | this.textBox1.Name = "textBox1";
98 | this.textBox1.Size = new System.Drawing.Size(764, 50);
99 | this.textBox1.TabIndex = 8;
100 | this.textBox1.Text = "MyNewClient";
101 | //
102 | // label1
103 | //
104 | this.label1.AutoSize = true;
105 | this.label1.Font = new System.Drawing.Font("微软雅黑", 16.125F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
106 | this.label1.Location = new System.Drawing.Point(13, 23);
107 | this.label1.Name = "label1";
108 | this.label1.Size = new System.Drawing.Size(326, 57);
109 | this.label1.TabIndex = 7;
110 | this.label1.Text = "添加一个客户端";
111 | //
112 | // AddClientForm
113 | //
114 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
115 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
116 | this.ClientSize = new System.Drawing.Size(800, 450);
117 | this.Controls.Add(this.button2);
118 | this.Controls.Add(this.button1);
119 | this.Controls.Add(this.textBox2);
120 | this.Controls.Add(this.label3);
121 | this.Controls.Add(this.label2);
122 | this.Controls.Add(this.textBox1);
123 | this.Controls.Add(this.label1);
124 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
125 | this.MaximizeBox = false;
126 | this.Name = "AddClientForm";
127 | this.ShowIcon = false;
128 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
129 | this.Text = "AddClient";
130 | this.ResumeLayout(false);
131 | this.PerformLayout();
132 |
133 | }
134 |
135 | #endregion
136 |
137 | private System.Windows.Forms.Button button2;
138 | private System.Windows.Forms.Button button1;
139 | private System.Windows.Forms.TextBox textBox2;
140 | private System.Windows.Forms.Label label3;
141 | private System.Windows.Forms.Label label2;
142 | private System.Windows.Forms.TextBox textBox1;
143 | private System.Windows.Forms.Label label1;
144 | }
145 | }
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/AddClientForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 | using System.Data.Odbc;
12 |
13 | namespace jsmhToolChest.ClientLaunch
14 | {
15 | public partial class AddClientForm : Form
16 | {
17 | public AddClientForm()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void button1_Click(object sender, EventArgs e)
23 | {
24 | FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
25 |
26 | folderBrowserDialog1.Description = "请选择一个目录";
27 | folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Desktop;
28 | folderBrowserDialog1.SelectedPath = Config.Config_folder + "\\.minecraft";
29 | folderBrowserDialog1.ShowNewFolderButton = true;
30 |
31 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
32 | {
33 | textBox2.Text = folderBrowserDialog1.SelectedPath;
34 |
35 | }
36 | }
37 |
38 | private void button2_Click(object sender, EventArgs e)
39 | {
40 | if (textBox1.Text.Equals(""))
41 | {
42 | MessageBox.Show("请输入名称","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
43 | return;
44 | }
45 | if (textBox2.Text.Equals(""))
46 | {
47 | MessageBox.Show("请输入目录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
48 | return;
49 | }
50 |
51 | if (!Directory.Exists(textBox2.Text))
52 | {
53 | MessageBox.Show("请输入有效的目录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
54 | return;
55 | }
56 | ClientList.AddClient(textBox1.Text,textBox2.Text);
57 | ClientList.ReloadClientList();
58 | this.Close();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/AddClientForm.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/ModInfomationForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace jsmhToolChest.ClientLaunch
2 | {
3 | partial class ModInfomationForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.label2 = new System.Windows.Forms.Label();
33 | this.label3 = new System.Windows.Forms.Label();
34 | this.label4 = new System.Windows.Forms.Label();
35 | this.label5 = new System.Windows.Forms.Label();
36 | this.label6 = new System.Windows.Forms.Label();
37 | this.label8 = new System.Windows.Forms.Label();
38 | this.label9 = new System.Windows.Forms.Label();
39 | this.label10 = new System.Windows.Forms.Label();
40 | this.label11 = new System.Windows.Forms.Label();
41 | this.label12 = new System.Windows.Forms.Label();
42 | this.label13 = new System.Windows.Forms.Label();
43 | this.label14 = new System.Windows.Forms.Label();
44 | this.linkLabel1 = new System.Windows.Forms.LinkLabel();
45 | this.label15 = new System.Windows.Forms.Label();
46 | this.label16 = new System.Windows.Forms.Label();
47 | this.label7 = new System.Windows.Forms.Label();
48 | this.label17 = new System.Windows.Forms.Label();
49 | this.panel1 = new System.Windows.Forms.Panel();
50 | this.panel1.SuspendLayout();
51 | this.SuspendLayout();
52 | //
53 | // label1
54 | //
55 | this.label1.AutoSize = true;
56 | this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
57 | this.label1.Location = new System.Drawing.Point(50, 28);
58 | this.label1.Name = "label1";
59 | this.label1.Size = new System.Drawing.Size(178, 41);
60 | this.label1.TabIndex = 0;
61 | this.label1.Text = "模组文件名";
62 | //
63 | // label2
64 | //
65 | this.label2.AutoSize = true;
66 | this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
67 | this.label2.Location = new System.Drawing.Point(50, 110);
68 | this.label2.Name = "label2";
69 | this.label2.Size = new System.Drawing.Size(146, 41);
70 | this.label2.TabIndex = 1;
71 | this.label2.Text = "模组名称";
72 | //
73 | // label3
74 | //
75 | this.label3.AutoSize = true;
76 | this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
77 | this.label3.Location = new System.Drawing.Point(50, 274);
78 | this.label3.Name = "label3";
79 | this.label3.Size = new System.Drawing.Size(146, 41);
80 | this.label3.TabIndex = 2;
81 | this.label3.Text = "模组描述";
82 | //
83 | // label4
84 | //
85 | this.label4.AutoSize = true;
86 | this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
87 | this.label4.Location = new System.Drawing.Point(50, 151);
88 | this.label4.Name = "label4";
89 | this.label4.Size = new System.Drawing.Size(146, 41);
90 | this.label4.TabIndex = 3;
91 | this.label4.Text = "模组版本";
92 | //
93 | // label5
94 | //
95 | this.label5.AutoSize = true;
96 | this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
97 | this.label5.Location = new System.Drawing.Point(50, 192);
98 | this.label5.Name = "label5";
99 | this.label5.Size = new System.Drawing.Size(146, 41);
100 | this.label5.TabIndex = 4;
101 | this.label5.Text = "游戏版本";
102 | //
103 | // label6
104 | //
105 | this.label6.AutoSize = true;
106 | this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
107 | this.label6.Location = new System.Drawing.Point(50, 233);
108 | this.label6.Name = "label6";
109 | this.label6.Size = new System.Drawing.Size(210, 41);
110 | this.label6.TabIndex = 5;
111 | this.label6.Text = "模组官方网站";
112 | //
113 | // label8
114 | //
115 | this.label8.AutoSize = true;
116 | this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
117 | this.label8.Location = new System.Drawing.Point(50, 315);
118 | this.label8.Name = "label8";
119 | this.label8.Size = new System.Drawing.Size(146, 41);
120 | this.label8.TabIndex = 7;
121 | this.label8.Text = "模组作者";
122 | //
123 | // label9
124 | //
125 | this.label9.AutoSize = true;
126 | this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
127 | this.label9.Location = new System.Drawing.Point(50, 356);
128 | this.label9.Name = "label9";
129 | this.label9.Size = new System.Drawing.Size(146, 41);
130 | this.label9.TabIndex = 8;
131 | this.label9.Text = "模组依赖";
132 | //
133 | // label10
134 | //
135 | this.label10.AutoSize = true;
136 | this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
137 | this.label10.Location = new System.Drawing.Point(313, 28);
138 | this.label10.Name = "label10";
139 | this.label10.Size = new System.Drawing.Size(0, 41);
140 | this.label10.TabIndex = 9;
141 | //
142 | // label11
143 | //
144 | this.label11.AutoSize = true;
145 | this.label11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
146 | this.label11.Location = new System.Drawing.Point(313, 110);
147 | this.label11.Name = "label11";
148 | this.label11.Size = new System.Drawing.Size(0, 41);
149 | this.label11.TabIndex = 10;
150 | //
151 | // label12
152 | //
153 | this.label12.AutoSize = true;
154 | this.label12.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
155 | this.label12.Location = new System.Drawing.Point(313, 151);
156 | this.label12.Name = "label12";
157 | this.label12.Size = new System.Drawing.Size(0, 41);
158 | this.label12.TabIndex = 11;
159 | //
160 | // label13
161 | //
162 | this.label13.AutoSize = true;
163 | this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
164 | this.label13.Location = new System.Drawing.Point(313, 192);
165 | this.label13.Name = "label13";
166 | this.label13.Size = new System.Drawing.Size(0, 41);
167 | this.label13.TabIndex = 12;
168 | //
169 | // label14
170 | //
171 | this.label14.AutoSize = true;
172 | this.label14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
173 | this.label14.Location = new System.Drawing.Point(313, 274);
174 | this.label14.MaximumSize = new System.Drawing.Size(1000, 0);
175 | this.label14.MinimumSize = new System.Drawing.Size(0, 41);
176 | this.label14.Name = "label14";
177 | this.label14.Size = new System.Drawing.Size(0, 41);
178 | this.label14.TabIndex = 13;
179 | //
180 | // linkLabel1
181 | //
182 | this.linkLabel1.AutoSize = true;
183 | this.linkLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
184 | this.linkLabel1.Location = new System.Drawing.Point(313, 233);
185 | this.linkLabel1.Name = "linkLabel1";
186 | this.linkLabel1.Size = new System.Drawing.Size(0, 41);
187 | this.linkLabel1.TabIndex = 14;
188 | //
189 | // label15
190 | //
191 | this.label15.AutoSize = true;
192 | this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
193 | this.label15.Location = new System.Drawing.Point(313, 315);
194 | this.label15.MaximumSize = new System.Drawing.Size(1000, 0);
195 | this.label15.MinimumSize = new System.Drawing.Size(0, 41);
196 | this.label15.Name = "label15";
197 | this.label15.Size = new System.Drawing.Size(0, 41);
198 | this.label15.TabIndex = 16;
199 | //
200 | // label16
201 | //
202 | this.label16.AutoSize = true;
203 | this.label16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
204 | this.label16.Location = new System.Drawing.Point(313, 356);
205 | this.label16.MaximumSize = new System.Drawing.Size(1000, 0);
206 | this.label16.MinimumSize = new System.Drawing.Size(0, 41);
207 | this.label16.Name = "label16";
208 | this.label16.Size = new System.Drawing.Size(0, 41);
209 | this.label16.TabIndex = 17;
210 | //
211 | // label7
212 | //
213 | this.label7.AutoSize = true;
214 | this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
215 | this.label7.Location = new System.Drawing.Point(50, 69);
216 | this.label7.Name = "label7";
217 | this.label7.Size = new System.Drawing.Size(146, 41);
218 | this.label7.TabIndex = 18;
219 | this.label7.Text = "模组大小";
220 | //
221 | // label17
222 | //
223 | this.label17.AutoSize = true;
224 | this.label17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
225 | this.label17.Location = new System.Drawing.Point(313, 69);
226 | this.label17.Name = "label17";
227 | this.label17.Size = new System.Drawing.Size(0, 41);
228 | this.label17.TabIndex = 19;
229 | //
230 | // panel1
231 | //
232 | this.panel1.Controls.Add(this.label17);
233 | this.panel1.Controls.Add(this.label7);
234 | this.panel1.Controls.Add(this.label16);
235 | this.panel1.Controls.Add(this.label15);
236 | this.panel1.Controls.Add(this.linkLabel1);
237 | this.panel1.Controls.Add(this.label14);
238 | this.panel1.Controls.Add(this.label13);
239 | this.panel1.Controls.Add(this.label12);
240 | this.panel1.Controls.Add(this.label11);
241 | this.panel1.Controls.Add(this.label10);
242 | this.panel1.Controls.Add(this.label9);
243 | this.panel1.Controls.Add(this.label8);
244 | this.panel1.Controls.Add(this.label6);
245 | this.panel1.Controls.Add(this.label5);
246 | this.panel1.Controls.Add(this.label4);
247 | this.panel1.Controls.Add(this.label3);
248 | this.panel1.Controls.Add(this.label2);
249 | this.panel1.Controls.Add(this.label1);
250 | this.panel1.Location = new System.Drawing.Point(0, 0);
251 | this.panel1.Name = "panel1";
252 | this.panel1.Size = new System.Drawing.Size(1383, 575);
253 | this.panel1.TabIndex = 20;
254 | //
255 | // ModInfomationForm
256 | //
257 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
258 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
259 | this.AutoSize = true;
260 | this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
261 | this.ClientSize = new System.Drawing.Size(1385, 605);
262 | this.Controls.Add(this.panel1);
263 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
264 | this.MaximizeBox = false;
265 | this.MinimizeBox = false;
266 | this.Name = "ModInfomationForm";
267 | this.ShowIcon = false;
268 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
269 | this.panel1.ResumeLayout(false);
270 | this.panel1.PerformLayout();
271 | this.ResumeLayout(false);
272 |
273 | }
274 |
275 | #endregion
276 |
277 | public System.Windows.Forms.Label label1;
278 | public System.Windows.Forms.Label label2;
279 | public System.Windows.Forms.Label label3;
280 | public System.Windows.Forms.Label label4;
281 | public System.Windows.Forms.Label label5;
282 | public System.Windows.Forms.Label label6;
283 | public System.Windows.Forms.Label label8;
284 | public System.Windows.Forms.Label label9;
285 | public System.Windows.Forms.Label label10;
286 | public System.Windows.Forms.Label label11;
287 | public System.Windows.Forms.Label label12;
288 | public System.Windows.Forms.Label label13;
289 | public System.Windows.Forms.Label label14;
290 | public System.Windows.Forms.LinkLabel linkLabel1;
291 | public System.Windows.Forms.Label label15;
292 | public System.Windows.Forms.Label label16;
293 | public System.Windows.Forms.Label label7;
294 | public System.Windows.Forms.Label label17;
295 | public System.Windows.Forms.Panel panel1;
296 | }
297 | }
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/ModInfomationForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace jsmhToolChest.ClientLaunch
12 | {
13 | public partial class ModInfomationForm : Form
14 | {
15 | public ModInfomationForm()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/ModInfomationForm.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/jsmhToolChest/ClientLaunch/Mods.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using SharpCompress.Archives;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using SharpCompress.Archives.Zip;
11 | using System.Diagnostics;
12 | using System.Drawing;
13 |
14 | namespace jsmhToolChest.ClientLaunch
15 | {
16 | internal class Mods
17 | {
18 | public class ModInformation
19 | {
20 | public string Name { get; set; }
21 | public string Description { get; set; }
22 | public string ModID { get; set; }
23 | public string Version { get; set; }
24 | public string MCVersion { get; set; }
25 | public string URL { get; set; }
26 | public string[] AuthorList { get; set; }
27 | public string Credits { get; set; }
28 | public string LogoFile { get; set; }
29 | public string[] Screenshots { get; set; }
30 | public string[] Dependencies { get; set; }
31 | }
32 |
33 | public static ModInformation GetModInformation(string path)
34 | {
35 | ModInformation modInfo = null;
36 | try
37 | {
38 | using (IArchive archive = ZipArchive.Open(path))
39 | {
40 | var entry = archive.Entries.FirstOrDefault(x => x.Key.Equals("mcmod.info", StringComparison.OrdinalIgnoreCase));
41 | if (entry != null)
42 | {
43 | using (Stream stream = entry.OpenEntryStream())
44 | {
45 | using (StreamReader reader = new StreamReader(stream))
46 | {
47 | string jsonString = reader.ReadToEnd();
48 | modInfo = JsonConvert.DeserializeObject(jsonString)[0];
49 | }
50 | }
51 | }
52 | else
53 | {
54 | throw new Exception("无法在模组文件内找到mcmod.info");
55 | }
56 | }
57 | }
58 | catch (Exception ex)
59 | {
60 | throw new Exception("无法打开jar文件或解析mcmod.info文件", ex);
61 | }
62 | if (modInfo == null)
63 | {
64 | throw new Exception("无法打开jar文件或解析mcmod.info文件");
65 | }
66 | return modInfo;
67 | }
68 |
69 | public static void ShowModInfomation(string path)
70 | {
71 | try
72 | {
73 | ModInformation mod = GetModInformation(path);
74 |
75 | ModInfomationForm form = new ModInfomationForm();
76 | string modfilename = Path.GetFileName(path);
77 | form.label10.Text = modfilename == null ? "None" : modfilename;
78 | form.label11.Text = mod.Name == null ? "None" : mod.Name;
79 | form.label12.Text = mod.Version == null ? "None" : mod.Version;
80 | form.label13.Text = mod.MCVersion == null ? "None" : mod.MCVersion;
81 | form.linkLabel1.Text = mod.URL == null ? "None" : mod.URL;
82 | if (mod.URL != null)
83 | {
84 | form.linkLabel1.LinkClicked += (object sender, LinkLabelLinkClickedEventArgs e) => {
85 | try
86 | {
87 | Process.Start(mod.URL);
88 | } catch (Exception er)
89 | {
90 | MessageBox.Show("在打开链接时发生错误: " + er.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
91 | }
92 | };
93 | } else
94 | {
95 | form.linkLabel1.LinkBehavior = LinkBehavior.NeverUnderline;
96 | form.linkLabel1.LinkColor = Color.Black;
97 | form.linkLabel1.VisitedLinkColor = Color.Black;
98 | }
99 | form.label14.Text = mod.Description == null ? "None" : mod.Description;
100 | form.label8.Location = new Point(form.label8.Location.X, form.label14.Location.Y + form.label14.Size.Height);
101 | form.label15.Location = new Point(form.label15.Location.X, form.label14.Location.Y + form.label14.Size.Height);
102 | form.label15.Text = MergeStrings(mod.AuthorList);
103 | form.label9.Location = new Point(form.label9.Location.X, form.label15.Location.Y + form.label15.Size.Height);
104 | form.label16.Location = new Point(form.label16.Location.X, form.label15.Location.Y + form.label15.Size.Height);
105 | form.label16.Text = MergeStrings(mod.Dependencies);
106 | form.panel1.Size = new Size(form.panel1.Size.Width, form.label16.Location.Y + form.label16.Size.Height + 135);
107 | FileInfo info = new FileInfo(path);
108 | form.label17.Text = FormatFileSize(info.Length);
109 | form.Text = "模组信息: " + Path.GetFileNameWithoutExtension(path);
110 | form.ShowDialog();
111 |
112 |
113 | } catch (Exception e)
114 | {
115 | MessageBox.Show("在获取模组信息时出现错误: " + e.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
116 |
117 | }
118 |
119 | }
120 | private static string MergeStrings(string[] input)
121 | {
122 | if (input == null || input.Length == 0)
123 | {
124 | return string.Empty;
125 | }
126 |
127 | return string.Join("\r\n", input);
128 | }
129 | private static string FormatFileSize(long fileSizeInBytes)
130 | {
131 | if (fileSizeInBytes < 1024)
132 | {
133 | return fileSizeInBytes + " 字节";
134 | }
135 | else if (fileSizeInBytes < 1024 * 1024)
136 | {
137 | double fileSizeInKB = (double)fileSizeInBytes / 1024;
138 | return fileSizeInBytes + " 字节" + " (" + fileSizeInKB.ToString("0.00") + " KB)";
139 | }
140 | else if (fileSizeInBytes < 1024 * 1024 * 1024)
141 | {
142 | double fileSizeInMB = (double)fileSizeInBytes / (1024 * 1024);
143 | return fileSizeInBytes + " 字节" + " (" + fileSizeInMB.ToString("0.00") + " MB)";
144 | }
145 | else
146 | {
147 | double fileSizeInGB = (double)fileSizeInBytes / (1024 * 1024 * 1024);
148 | return fileSizeInBytes + " 字节" + " (" + fileSizeInGB.ToString("0.00") + " GB)";
149 | }
150 | }
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/jsmhToolChest/Config.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Linq;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.IO;
8 | using System.Threading.Tasks;
9 |
10 | namespace jsmhToolChest
11 | {
12 | internal class Config
13 | {
14 | public static JObject Config_json;
15 | public static string Config_folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\jsmh ToolChest";
16 | public static void Init()
17 | {
18 |
19 | if (!Directory.Exists(Config_folder))
20 | {
21 | Directory.CreateDirectory(Config_folder);
22 | }
23 | if (!Directory.Exists(Config.Config_folder + "\\Hook"))
24 | {
25 | Directory.CreateDirectory(Config.Config_folder + "\\Hook");
26 | }
27 | if (!Directory.Exists(Config.Config_folder + "\\.minecraft"))
28 | {
29 | Directory.CreateDirectory(Config.Config_folder + "\\.minecraft");
30 | }
31 | if (!Directory.Exists(Config.Config_folder + "\\InjectMods"))
32 | {
33 | Directory.CreateDirectory(Config.Config_folder + "\\InjectMods");
34 | }
35 |
36 |
37 | if (File.Exists(Config_folder + "\\Config.json"))
38 | {
39 | try
40 | {
41 | Config_json = JObject.Parse(File.ReadAllText(Config_folder + "\\Config.json"));
42 | }catch (Exception e) {
43 | Program.mainWindow.ShowError("程序在解析配置文件时发生错误\r\n错误文件:" + Config_folder + "\\Config.json\r\n错误信息:" + e.Message + "\r\n你可以尝试手动删除该文件");
44 | }
45 | } else
46 | {
47 | Config_json = new JObject();
48 | }
49 |
50 | if (!Config.Config_json.ContainsKey("Window"))
51 | {
52 | Config.Config_json.Add(new JProperty("Window", new JObject()));
53 | }
54 | if (!((JObject)Config.Config_json["Window"]).ContainsKey("MainWindow"))
55 | {
56 | ((JObject)Config.Config_json["Window"]).Add(new JProperty("MainWindow", new JObject()));
57 | }
58 | if (!((JObject)Config.Config_json["Window"]["MainWindow"]).ContainsKey("MainPage"))
59 | {
60 | ((JObject)Config.Config_json["Window"]["MainWindow"]).Add(new JProperty("MainPage", new JObject()));
61 | }
62 | if (!((JObject)Config.Config_json["Window"]["MainWindow"]).ContainsKey("Settings"))
63 | {
64 | ((JObject)Config.Config_json["Window"]["MainWindow"]).Add(new JProperty("Settings", new JObject()));
65 | }
66 | if (!((JObject)Config.Config_json["Window"]["MainWindow"]).ContainsKey("Client"))
67 | {
68 | ((JObject)Config.Config_json["Window"]["MainWindow"]).Add(new JProperty("Client", new JObject()));
69 | }
70 | if (!((JObject)Config.Config_json["Window"]["MainWindow"]["Client"]).ContainsKey("SelectClientInfo"))
71 | {
72 | ((JObject)Config.Config_json["Window"]["MainWindow"]["Client"]).Add(new JProperty("SelectClientInfo", new JObject()));
73 | }
74 | Save();
75 | }
76 |
77 | public static void Save()
78 | {
79 | File.WriteAllText(Config_folder + "\\Config.json",Config_json.ToString());
80 | }
81 |
82 |
83 |
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/jsmhToolChest/Download/DonwloadForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace jsmhToolChest.Download
2 | {
3 | partial class DonwloadForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.label3 = new System.Windows.Forms.Label();
35 | this.label4 = new System.Windows.Forms.Label();
36 | this.SuspendLayout();
37 | //
38 | // progressBar1
39 | //
40 | this.progressBar1.Location = new System.Drawing.Point(61, 232);
41 | this.progressBar1.Name = "progressBar1";
42 | this.progressBar1.Size = new System.Drawing.Size(1077, 45);
43 | this.progressBar1.TabIndex = 0;
44 | //
45 | // label1
46 | //
47 | this.label1.AutoSize = true;
48 | this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
49 | this.label1.Location = new System.Drawing.Point(54, 40);
50 | this.label1.Name = "label1";
51 | this.label1.Size = new System.Drawing.Size(0, 41);
52 | this.label1.TabIndex = 1;
53 | //
54 | // label2
55 | //
56 | this.label2.AutoSize = true;
57 | this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
58 | this.label2.Location = new System.Drawing.Point(54, 81);
59 | this.label2.Name = "label2";
60 | this.label2.Size = new System.Drawing.Size(0, 41);
61 | this.label2.TabIndex = 2;
62 | //
63 | // label3
64 | //
65 | this.label3.AutoSize = true;
66 | this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
67 | this.label3.Location = new System.Drawing.Point(54, 147);
68 | this.label3.Name = "label3";
69 | this.label3.Size = new System.Drawing.Size(0, 41);
70 | this.label3.TabIndex = 3;
71 | //
72 | // label4
73 | //
74 | this.label4.AutoSize = true;
75 | this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
76 | this.label4.Location = new System.Drawing.Point(54, 188);
77 | this.label4.Name = "label4";
78 | this.label4.Size = new System.Drawing.Size(0, 41);
79 | this.label4.TabIndex = 4;
80 | //
81 | // DonwloadForm
82 | //
83 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
85 | this.ClientSize = new System.Drawing.Size(1202, 323);
86 | this.Controls.Add(this.label4);
87 | this.Controls.Add(this.label3);
88 | this.Controls.Add(this.label2);
89 | this.Controls.Add(this.label1);
90 | this.Controls.Add(this.progressBar1);
91 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
92 | this.MaximizeBox = false;
93 | this.MinimizeBox = false;
94 | this.Name = "DonwloadForm";
95 | this.ShowIcon = false;
96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
97 | this.Text = "DonwloadForm";
98 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DonwloadForm_FormClosing);
99 | this.ResumeLayout(false);
100 | this.PerformLayout();
101 |
102 | }
103 |
104 | #endregion
105 |
106 | public System.Windows.Forms.ProgressBar progressBar1;
107 | public System.Windows.Forms.Label label1;
108 | public System.Windows.Forms.Label label2;
109 | public System.Windows.Forms.Label label3;
110 | public System.Windows.Forms.Label label4;
111 | }
112 | }
--------------------------------------------------------------------------------
/jsmhToolChest/Download/DonwloadForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace jsmhToolChest.Download
12 | {
13 | public partial class DonwloadForm : Form
14 | {
15 | public DonwloadForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void DonwloadForm_FormClosing(object sender, FormClosingEventArgs e)
21 | {
22 | e.Cancel = !DownloadUtil.done;
23 | }
24 |
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/jsmhToolChest/Download/DonwloadForm.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/jsmhToolChest/Download/DownloadUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Net.Http;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.Threading;
11 | using System.Net;
12 |
13 | namespace jsmhToolChest.Download
14 | {
15 | internal class DownloadUtil
16 | {
17 |
18 |
19 | public static bool done = false;
20 | public static async Task StartDownloadAsync(string url, string path, string title = "正在下载文件")
21 | {
22 | done = false;
23 | DonwloadForm form = new DonwloadForm();
24 | form.Show();
25 | form.Text = title;
26 | form.label1.Text = "正在下载" + url;
27 | form.label2.Text = "到" + path;
28 |
29 | var client = new WebClient();
30 |
31 | try
32 | {
33 | var stopwatch = Stopwatch.StartNew();
34 | double last = 0;
35 | client.DownloadProgressChanged += (sender, e) =>
36 | {
37 | if (stopwatch.Elapsed.TotalSeconds - last >= 0.2)
38 | {
39 | last = stopwatch.Elapsed.TotalSeconds;
40 | double speed = e.BytesReceived / stopwatch.Elapsed.TotalSeconds;
41 | form.progressBar1.Value = (int)(((double)e.BytesReceived / e.TotalBytesToReceive) * 100);
42 | form.label3.Text = $"已下载 {((double)e.BytesReceived / 1024d / 1024d):0.00}MB/{((double)e.TotalBytesToReceive / 1024d / 1024d):0.00}MB";
43 | form.label4.Text = $"{((double)speed / 1024d / 1024d):0.00} MB/s";
44 | }
45 | };
46 |
47 | await client.DownloadFileTaskAsync(url, path);
48 |
49 | }
50 | finally
51 | {
52 | client.Dispose();
53 | done = true;
54 | form.Close();
55 | }
56 |
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/jsmhToolChest/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/DLLInjector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 |
8 |
9 | namespace jsmhToolChest.Libraries
10 | {
11 | internal class DLLInjector
12 | {
13 | public static void InjectDLL(string Filename, byte[] DLL, Process TargetProcess)
14 | {
15 | try
16 | {
17 | System.IO.File.WriteAllBytes(Config.Config_folder + "\\DLLInjector.exe", Resource1.Injector);
18 | System.IO.File.WriteAllBytes(Config.Config_folder + "\\" + Filename, DLL);
19 |
20 | }
21 | catch (Exception e)
22 | {
23 | throw new Exception("文件写出失败,详细信息:" + e.Message);
24 | }
25 | try
26 | {
27 | Process process = new Process();
28 | process.StartInfo.FileName = Config.Config_folder + "\\DLLInjector.exe";
29 | process.StartInfo.Arguments = $"{TargetProcess.Id} {Filename}";
30 | process.StartInfo.WorkingDirectory = Config.Config_folder;
31 | process.Start();
32 | } catch (Exception e)
33 | {
34 | throw new Exception("注入器进程创建失败: " + e.Message);
35 | }
36 |
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/File.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 |
10 | namespace jsmhToolChest.Libraries
11 | {
12 | internal class File
13 | {
14 | public static void ClearDirectory(string path)
15 | {
16 | DirectoryInfo directory = new DirectoryInfo(path);
17 |
18 | foreach (DirectoryInfo subDirectory in directory.GetDirectories())
19 | {
20 | ClearDirectory(subDirectory.FullName);
21 | subDirectory.Attributes = FileAttributes.Normal;
22 | subDirectory.Delete();
23 | }
24 |
25 | foreach (FileInfo file in directory.GetFiles())
26 | {
27 | file.Attributes = FileAttributes.Normal;
28 | file.Delete();
29 | }
30 | }
31 |
32 |
33 |
34 | [DllImport("shell32.dll", CharSet = CharSet.Auto)]
35 | static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);
36 |
37 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
38 | public struct SHELLEXECUTEINFO
39 | {
40 | public int cbSize;
41 | public uint fMask;
42 | public IntPtr hwnd;
43 | [MarshalAs(UnmanagedType.LPTStr)]
44 | public string lpVerb;
45 | [MarshalAs(UnmanagedType.LPTStr)]
46 | public string lpFile;
47 | [MarshalAs(UnmanagedType.LPTStr)]
48 | public string lpParameters;
49 | [MarshalAs(UnmanagedType.LPTStr)]
50 | public string lpDirectory;
51 | public int nShow;
52 | public IntPtr hInstApp;
53 | public IntPtr lpIDList;
54 | [MarshalAs(UnmanagedType.LPTStr)]
55 | public string lpClass;
56 | public IntPtr hkeyClass;
57 | public uint dwHotKey;
58 | public IntPtr hIcon;
59 | public IntPtr hProcess;
60 | }
61 |
62 | private const int SW_SHOW = 5;
63 | private const uint SEE_MASK_INVOKEIDLIST = 12;
64 | public static bool ShowFileProperties(string Filename)
65 | {
66 | SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
67 | info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
68 | info.lpVerb = "properties";
69 | info.lpFile = Filename;
70 | info.nShow = SW_SHOW;
71 | info.fMask = SEE_MASK_INVOKEIDLIST;
72 | return ShellExecuteEx(ref info);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/ProcessModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Runtime.InteropServices;
5 |
6 | namespace jsmhToolChest.Libraries.ProcessModules
7 | {
8 | public struct LIST_ENTRY64
9 | {
10 | public ulong Flink;
11 |
12 | public ulong Blink;
13 | }
14 |
15 | public struct LDR_DATA_TABLE_ENTRY64
16 | {
17 | public LIST_ENTRY64 InLoadOrderLinks;
18 |
19 | public LIST_ENTRY64 InMemoryOrderLinks;
20 |
21 | public LIST_ENTRY64 InInitializationOrderLinks;
22 |
23 | public ulong DllBase;
24 |
25 | public ulong EntryPoint;
26 |
27 | public uint SizeOfImage;
28 |
29 | public UNICODE_STRING64 FullDllName;
30 |
31 | public UNICODE_STRING64 BaseDllName;
32 |
33 | public uint Flags;
34 |
35 | public ushort LoadCount;
36 |
37 | public ushort TlsIndex;
38 |
39 | public LIST_ENTRY64 HashLinks;
40 |
41 | public uint CheckSum;
42 |
43 | public ulong LoadedImports;
44 |
45 | public ulong EntryPointActivationContext;
46 |
47 | public ulong PatchInformation;
48 | }
49 |
50 | public struct PROCESS_BASIC_INFORMATION64
51 | {
52 | public uint NTSTATUS;
53 |
54 | public uint Reserved0;
55 |
56 | public ulong PebBaseAddress;
57 |
58 | public ulong AffinityMask;
59 |
60 | public uint BasePriority;
61 |
62 | public uint Reserved1;
63 |
64 | public ulong UniqueProcessId;
65 |
66 | public ulong InheritedFromUniqueProcessId;
67 | }
68 |
69 | public struct UNICODE_STRING64
70 | {
71 | public ushort Length;
72 |
73 | public ushort MaximumLength;
74 |
75 | public ulong Buffer;
76 | }
77 |
78 | public static class DLLTool
79 | {
80 | [DllImport("kernel32.dll")]
81 | public static extern int OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
82 |
83 | [DllImport("kernel32.dll")]
84 | public static extern bool IsWow64Process(int hProcess, out bool Wow64Process);
85 |
86 | [DllImport("ntdll.dll")]
87 | public static extern int NtWow64QueryInformationProcess64(int hProcess, uint ProcessInfoclass, out PROCESS_BASIC_INFORMATION64 pBuffer, uint nSize, out uint nReturnSize);
88 |
89 | [DllImport("kernel32.dll")]
90 | public static extern bool CloseHandle(int hObject);
91 |
92 | [DllImport("ntdll.dll")]
93 | public unsafe static extern int NtWow64ReadVirtualMemory64(int hProcess, ulong pMemAddress, int* pBufferPtr, ulong nSize, out ulong nReturnSize);
94 |
95 | [DllImport("ntdll.dll")]
96 | public static extern int NtWow64ReadVirtualMemory64(int hProcess, ulong pMemAddress, out LDR_DATA_TABLE_ENTRY64 pBufferPtr, ulong nSize, out ulong nReturnSize);
97 |
98 | [DllImport("ntdll.dll")]
99 | public static extern int NtWow64ReadVirtualMemory64(int hProcess, ulong pMemAddress, out ulong pBufferPtr, ulong nSize, out ulong nReturnSize);
100 |
101 | [DllImport("ntdll.dll")]
102 | public static extern int NtWow64ReadVirtualMemory64(int hProcess, ulong pMemAddress, out LIST_ENTRY64 pBufferPtr, ulong nSize, out ulong nReturnSize);
103 |
104 | [DllImport("kernel32.dll", EntryPoint = "RtlMoveMemory")]
105 | public static extern int BinToLDR_DATA_TABLE_ENTRY64(LDR_DATA_TABLE_ENTRY64 lpDestination, byte[] lpSource, int Length);
106 | }
107 |
108 | public class ProcessModule64
109 | {
110 | public ProcessModule64(LDR_DATA_TABLE_ENTRY64 dllInfo, string dllpath)
111 | {
112 | try
113 | {
114 | FileName = dllpath;
115 | BaseAddress = (long)dllInfo.DllBase;
116 | ModuleMemorySize = dllInfo.SizeOfImage;
117 | EntryPointAddress = (long)dllInfo.EntryPoint;
118 | ModuleName = Path.GetFileName(dllpath);
119 | }
120 | catch
121 | {
122 | }
123 | }
124 |
125 | public string ModuleName { get; }
126 |
127 | public string FileName { get; }
128 |
129 | public long BaseAddress { get; }
130 |
131 | public long ModuleMemorySize { get; }
132 |
133 | public long EntryPointAddress { get; }
134 | }
135 |
136 | internal class ProcessModules
137 | {
138 | public unsafe static ProcessModule64[] getWOW64Modules(int PID)
139 | {
140 | uint nReturnSize = 0u;
141 | ulong nReturnSize2 = 0uL;
142 | ulong pBufferPtr = 0uL;
143 | _ = new byte[512];
144 | PROCESS_BASIC_INFORMATION64 pBuffer = default(PROCESS_BASIC_INFORMATION64);
145 | LIST_ENTRY64 pBufferPtr2 = default(LIST_ENTRY64);
146 | LDR_DATA_TABLE_ENTRY64 pBufferPtr3 = default(LDR_DATA_TABLE_ENTRY64);
147 | List list = new List();
148 | int num = DLLTool.OpenProcess(1040u, bInheritHandle: false, (uint)PID);
149 | if (num == 0)
150 | {
151 | return new ProcessModule64[0];
152 | }
153 | if (DLLTool.NtWow64QueryInformationProcess64(num, 0u, out pBuffer, 48u, out nReturnSize) < 0)
154 | {
155 | global::System.Diagnostics.Debug.Write("查询进程信息失败,如果一直出现可能无法获取进程模块");
156 | DLLTool.CloseHandle(num);
157 | return new ProcessModule64[0];
158 | }
159 | if (pBuffer.PebBaseAddress == 0L)
160 | {
161 | global::System.Diagnostics.Debug.Write("获取PEB64结构地址失败,如果一直出现可能无法获取进程模块");
162 | DLLTool.CloseHandle(num);
163 | return new ProcessModule64[0];
164 | }
165 | if (DLLTool.NtWow64ReadVirtualMemory64(num, pBuffer.PebBaseAddress + 24, out pBufferPtr, 8uL, out nReturnSize2) < 0)
166 | {
167 | global::System.Diagnostics.Debug.Write("获取Ldr64结构失败,如果一直出现可能无法获取进程模块");
168 | DLLTool.CloseHandle(num);
169 | return new ProcessModule64[0];
170 | }
171 | if (DLLTool.NtWow64ReadVirtualMemory64(num, pBufferPtr + 16, out pBufferPtr2, 16uL, out nReturnSize2) < 0)
172 | {
173 | global::System.Diagnostics.Debug.Write("获取Ldr64.InLoadOrderModuleList.Flink地址失败,如果一直出现可能无法获取进程模块");
174 | DLLTool.CloseHandle(num);
175 | return new ProcessModule64[0];
176 | }
177 | if (DLLTool.NtWow64ReadVirtualMemory64(num, pBufferPtr2.Flink, out pBufferPtr3, (ulong)Marshal.SizeOf((object)pBufferPtr3), out nReturnSize2) < 0)
178 | {
179 | global::System.Diagnostics.Debug.Write("获取LDTE64结构失败,如果一直出现可能无法获取进程模块");
180 | DLLTool.CloseHandle(num);
181 | return new ProcessModule64[0];
182 | }
183 | while (pBufferPtr3.InLoadOrderLinks.Flink != pBufferPtr2.Flink)
184 | {
185 | try
186 | {
187 | IntPtr intPtr = Marshal.AllocHGlobal(pBufferPtr3.FullDllName.Length);
188 | if (DLLTool.NtWow64ReadVirtualMemory64(num, pBufferPtr3.FullDllName.Buffer, (int*)(void*)intPtr, pBufferPtr3.FullDllName.Length, out nReturnSize2) >= 0)
189 | {
190 | ProcessModule64 item = new ProcessModule64(pBufferPtr3, Marshal.PtrToStringUni(intPtr, (int)pBufferPtr3.FullDllName.Length / 2));
191 | Marshal.FreeHGlobal(intPtr);
192 | list.Add(item);
193 | }
194 | }
195 | catch { }
196 | if (DLLTool.NtWow64ReadVirtualMemory64(num, pBufferPtr3.InLoadOrderLinks.Flink, out pBufferPtr3, (ulong)Marshal.SizeOf((object)pBufferPtr3), out nReturnSize2) < 0)
197 | {
198 | break;
199 | }
200 | }
201 | DLLTool.CloseHandle(num);
202 | return list.ToArray();
203 | }
204 | }
205 | }
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/ProcessPatch.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 |
5 | namespace jsmhToolChest.Libraries.ProcessPatch
6 | {
7 | internal class DLLTool
8 | {
9 | [DllImport("kernel32.dll")]
10 | public static extern int OpenProcess(int a_, int Handle, int dwProcessId);
11 |
12 | [DllImport("kernel32.dll")]
13 | public static extern bool CloseHandle(int hObject);
14 | [DllImport("ntdll.dll")]
15 | public static extern bool ZwWow64ReadVirtualMemory64(int hProcess, ulong pMemAddress, byte[] Buffer, ulong nSize, out ulong nReturnSize);
16 |
17 | [DllImport("ntdll.dll")]
18 | public static extern int ZwWow64WriteVirtualMemory64(int hProcess, ulong pMemAddress, byte[] Buffer, ulong nSize, out ulong nReturnSize);
19 | }
20 |
21 | internal class ProcessPatch
22 | {
23 | public static int WriteProcessMemory(int processId, ulong address, byte[] buffer, ulong size)
24 | {
25 | int num = DLLTool.OpenProcess(2035711, 0, processId);
26 | int retn = DLLTool.ZwWow64WriteVirtualMemory64(num, address, buffer, size, out ulong ret);
27 | DLLTool.CloseHandle(num);
28 | return retn;
29 | }
30 |
31 | public static byte[] ReadProcessMemory(int processId, ulong address, ulong size)
32 | {
33 | int num = DLLTool.OpenProcess(2035711, 0, processId);
34 | byte[] buffer = new byte[size];
35 | bool retn = DLLTool.ZwWow64ReadVirtualMemory64(num, address, buffer, size, out ulong ret);
36 | DLLTool.CloseHandle(num);
37 | return buffer;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/ProcessWindows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace jsmhToolChest.Libraries.ProcessWindows
10 | {
11 | internal class ProcessWindows
12 | {
13 | const int SW_RESTORE = 9;
14 |
15 | [DllImport("user32.dll", SetLastError = true)]
16 | static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
17 |
18 | [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
19 | static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
20 |
21 | [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
22 | static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
23 |
24 | [DllImport("user32.dll")]
25 | static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
26 |
27 | delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
28 |
29 | public class ProcessWindow
30 | {
31 | public ProcessWindow(int WindowHandle, string WindowTitle, string className)
32 | {
33 | Handle = WindowHandle;
34 | Title = WindowTitle;
35 | ClassName = className;
36 | }
37 | public int Handle { get; }
38 | public string Title { get; }
39 | public string ClassName { get; }
40 |
41 | }
42 |
43 | public static ProcessWindow[] GetProcessWindows(Process process) {
44 | List windows = new List();
45 | if (process == null)
46 | {
47 | return null;
48 | }
49 |
50 | int targetProcessId = process.Id;
51 | IntPtr mainWindowHandle = IntPtr.Zero;
52 | EnumWindows((hWnd, lParam) =>
53 | {
54 | uint windowProcessId;
55 | GetWindowThreadProcessId(hWnd, out windowProcessId);
56 | if (windowProcessId == targetProcessId)
57 | {
58 | StringBuilder className = new StringBuilder(256);
59 | StringBuilder windowTitle = new StringBuilder(256);
60 | GetClassName(hWnd, className, className.Capacity);
61 | string classNameString = className.ToString();
62 | GetWindowText(hWnd, windowTitle, windowTitle.Capacity);
63 | string windowTitleString = windowTitle.ToString();
64 |
65 | windows.Add(new ProcessWindow((int)hWnd, windowTitleString, classNameString));
66 | }
67 | return true;
68 | }, IntPtr.Zero);
69 |
70 | return windows.ToArray();
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/jsmhToolChest/Libraries/String.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Text.RegularExpressions;
6 | using System.Threading.Tasks;
7 |
8 | namespace jsmhToolChest.Libraries
9 | {
10 | internal class String
11 | {
12 | public static string GetRandomCharacters(int n = 10, bool Number = true, bool Lowercase = true, bool Capital = true ,string Characters = null)
13 | {
14 | StringBuilder tmp = new StringBuilder();
15 | Random rand = new Random();
16 | string characters = (Capital ? "ABCDEFGHIJKLMNOPQRSTUVWXYZ" : null) + (Number ? "0123456789" : null) + (Lowercase ? "abcdefghijklmnopqrstuvwxyz" : null) + Characters;
17 | if (characters.Length < 1)
18 | {
19 | return (null);
20 | }
21 | for (int i = 0; i < n; i++)
22 | {
23 | tmp.Append(characters[rand.Next(0, characters.Length)].ToString());
24 | }
25 | return (tmp.ToString());
26 | }
27 |
28 | public static string GetMiddleString(string original, string before, string after)
29 | {
30 | string pattern = $@"(?<={Regex.Escape(before)}).+?(?={Regex.Escape(after)})";
31 | Match match = Regex.Match(original, pattern);
32 | if (match.Success)
33 | {
34 | return match.Value;
35 | }
36 | else
37 | {
38 | throw new ArgumentException($"Could not find a matching string between \"{before}\" and \"{after}\" in \"{original}\".");
39 | }
40 | }
41 |
42 | public static string ByteArrayToHexString(byte[] byteArray)
43 | {
44 | StringBuilder hex = new StringBuilder(byteArray.Length * 2);
45 | foreach (byte b in byteArray)
46 | {
47 | hex.AppendFormat("{0:x2}", b);
48 | }
49 | return hex.ToString();
50 | }
51 |
52 |
53 | public static byte[] HexStringToByteArray(string hexString)
54 | {
55 | int length = hexString.Length;
56 | byte[] byteArray = new byte[length / 2];
57 | for (int i = 0; i < length; i += 2)
58 | {
59 | byteArray[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
60 | }
61 | return byteArray;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/jsmhToolChest/LocalWebServer.cs:
--------------------------------------------------------------------------------
1 | using jsmhToolChest.Netease;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Net;
8 | using System.Text;
9 | using System.Threading;
10 | using System.Threading.Tasks;
11 | using Newtonsoft.Json.Linq;
12 | using System.Reflection;
13 |
14 | namespace jsmhToolChest
15 | {
16 | internal class LocalWebServer
17 | {
18 | private static string url = "http://127.0.0.1:20881/";
19 | public static Thread LocalWebServerThreadObj = new Thread(new ThreadStart(Loop));
20 |
21 | public static void Start()
22 | {
23 | try
24 | {
25 | LocalWebServerThreadObj.Start();
26 | } catch(Exception ex)
27 | {
28 | Program.mainWindow.ShowError("本地Web服务线程开始时发生错误: " + ex.Message);
29 | }
30 |
31 | }
32 |
33 | private static void Loop()
34 | {
35 | HttpListener listener = null;
36 | try
37 | {
38 | listener = new HttpListener();
39 | listener.Prefixes.Add(url);
40 | listener.Start();
41 | }
42 | catch (Exception ex) {
43 | Program.mainWindow.ShowError("本地Web服务开启时发生错误: " + ex.Message);
44 | }
45 |
46 | try
47 | {
48 | while (true)
49 | {
50 | var context = listener.GetContext();
51 | new Thread(ProcessRequest).Start(context);
52 | }
53 |
54 | }
55 | catch (Exception ex)
56 | {
57 | Program.mainWindow.ShowError("本地Web服务监听时发生错误: " + ex.Message);
58 | }
59 | finally
60 | {
61 | listener.Close();
62 | }
63 | }
64 |
65 | static void ProcessRequest(object contextTask)
66 | {
67 | try
68 | {
69 | HttpListenerContext context = (HttpListenerContext)contextTask;
70 |
71 | HttpListenerRequest request = context.Request;
72 | HttpListenerResponse response = context.Response;
73 |
74 | if (request == null)
75 | {
76 | Program.mainWindow.LogTime();
77 | Program.mainWindow.ErrorLogs("Web请求处理错误: 请求对象为空");
78 | return;
79 | }
80 |
81 | string responseString = null;
82 | try
83 | {
84 | switch (request.Url.LocalPath)
85 | {
86 | case "/GetConfig":
87 |
88 | JObject json = JObject.Parse(Config.Config_json.ToString());
89 | json.Add(new JProperty("Program" , new JObject()
90 | {
91 | new JProperty("Name", "jsmhToolChest"),
92 | new JProperty("Path", Assembly.GetEntryAssembly().Location)
93 | }));
94 |
95 | responseString = json.ToString();
96 | response.StatusCode = 200;
97 | response.ContentType = "application/json";
98 | break;
99 | case "/PostGameLaunchArgumentsStrAndChange":
100 | string postData;
101 | using (Stream body = request.InputStream)
102 | {
103 | using (StreamReader reader = new StreamReader(body, Encoding.UTF8))
104 | {
105 | postData = reader.ReadToEnd();
106 | }
107 | }
108 | if (postData != null & postData != "")
109 | {
110 | response.StatusCode = 200;
111 | response.ContentType = "text/plain";
112 | responseString = WPFLauncher.ProcessNeteaseClientArguments(postData);
113 | }
114 | else
115 | {
116 | response.StatusCode = 400;
117 | responseString = "400 Bad Request";
118 | response.ContentType = "text/plain";
119 | }
120 |
121 | break;
122 |
123 | default:
124 | Program.mainWindow.LogTime();
125 | Program.mainWindow.ErrorLogs($"Web请求处理错误: 获取到了无效的URL\"{request.Url.LocalPath}\"");
126 | responseString = "404 Not Found";
127 | response.StatusCode = 404;
128 | response.ContentType = "text/plain";
129 | break;
130 | }
131 | } catch (Exception ex)
132 | {
133 | Program.mainWindow.LogTime();
134 | Program.mainWindow.ErrorLogs("Web处理发生错误: " + ex.Message);
135 | responseString = "500 Internal Server Error\r\n" + ex.Message;
136 | response.StatusCode = 500;
137 | response.ContentType = "text/plain";
138 | }
139 |
140 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
141 |
142 |
143 | response.ContentLength64 = buffer.Length;
144 |
145 | response.OutputStream.Write(buffer, 0, buffer.Length);
146 |
147 | response.Close();
148 | }
149 | catch (Exception ex)
150 | {
151 | Program.mainWindow.LogTime();
152 | Program.mainWindow.ErrorLogs("Web请求发生错误: " + ex.Message);
153 | }
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/jsmhToolChest/MainWindow.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 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wGfAeABfgEHAf8B8AEHAeABDwHPAv8B8wH5
226 | AfMBzwGfAfAB/wEfAf8B4QEfAfgBhwHPAf4BfwHzAfkB8wHPAZ8B+AH/AR8B/wHhAfgBHwGHAc8B/gF/
227 | AfMB+QHzAc8BnwH4Af8BHwH/AeAB8AEPAQcBzwH+AX8B8wH5AfMBzwGfAfAB/wEPAf8B8AFgAQYBDwHP
228 | Af4BfwHzAeEB8AEPAYcB4AF+AQcB/wH4AWMBxgEfAc8B/gF/AfMBwQHwAQ8BgwHgATwBCAH/AfwBYwHG
229 | AT8BzwH+AX8B8wHBAv8BgwH0AQABCAHfAfwBYwHGAT8BzwH+AX8B8wHgAv8BBwH+AgABDwH4AWMBxgEf
230 | Ac8B/gF/AfMB8AF/Af4BDwH+AgABBwHwAWABBgEPAc8C/wHzAfgBPwH8AR8B/gEYAQIBDwHgAfABDwEH
231 | Ac8C/wHzAfwBHwH4AT8B/wE9Ao8B4QH4AR8BhwHPAf4BfwHzAf4BDwHwAX8B/wH+AQ8BgwHhAR8B+AGH
232 | Ac8B/gF/AfMB/wEHAeAC/wH+AR8BwwHwAQcB4AEPAc8C/wHzAf8BgwHBAv8B/gEPAYMB+AEBAYABHwHP
233 | Av8B8wH/AcEBgwP/Ao8B+AFBAYIBHwHAAgABAwH/AeABBwP/AYIBDwH/AeEBhwH/AcACAAEDAf8B8AEP
234 | A/8BAAEHAf8B8QGPBv8B+AEfA/8BgAEPAf8B8AEPBv8B/AE/A/8B2AHfAf8B+AEfBv8B/gF/A/8B+Cn/
235 | Cw==
236 |
237 |
238 |
--------------------------------------------------------------------------------
/jsmhToolChest/ModsInject/ModsInject.cs:
--------------------------------------------------------------------------------
1 | using jsmhToolChest.ClientLaunch;
2 | using SharpCompress.Common;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Security.Cryptography;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace jsmhToolChest.ModsInject
13 | {
14 | internal class ModsInjectMain
15 | {
16 | public static string ModsFolder = Config.Config_folder + "\\InjectMods";
17 | public static void Reload()
18 | {
19 | if (Directory.Exists(ModsFolder))
20 | {
21 | Program.mainWindow.listView2.Items.Clear();
22 | foreach (FileInfo file in new DirectoryInfo(ModsFolder).GetFiles("*.jar"))
23 | {
24 | Program.mainWindow.listView2.Items.Add(new ListViewItem(new String[] { Path.GetFileNameWithoutExtension(file.Name), "启用" }));
25 | }
26 | foreach (FileInfo file in new DirectoryInfo(ModsFolder).GetFiles("*.dis"))
27 | {
28 | Program.mainWindow.listView2.Items.Add(new ListViewItem(new String[] { Path.GetFileNameWithoutExtension(file.Name), "禁用" }));
29 | }
30 | }
31 | }
32 |
33 | public static void SwitchMod(int index)
34 | {
35 |
36 | string name = Program.mainWindow.listView2.Items[index].SubItems[0].Text;
37 | string state = Program.mainWindow.listView2.Items[index].SubItems[1].Text;
38 | string finalstate = null;
39 | string finalname = null;
40 | switch (state)
41 | {
42 | case "启用":
43 | finalname = ModsInjectMain.ModsFolder + "\\" + name + ".dis";
44 | finalstate = "禁用";
45 | name = ModsInjectMain.ModsFolder + "\\" + Program.mainWindow.listView2.Items[index].SubItems[0].Text + ".jar";
46 | break;
47 | case "禁用":
48 | finalname = ModsInjectMain.ModsFolder + "\\" + name + ".jar";
49 | finalstate = "启用";
50 | name = ModsInjectMain.ModsFolder + "\\" + Program.mainWindow.listView2.Items[index].SubItems[0].Text + ".dis";
51 | break;
52 | default:
53 | Program.mainWindow.ShowError("程序在处理模组名称时遇到的无法处理的字符串" + state);
54 | break;
55 | }
56 | if (File.Exists(finalname))
57 | {
58 | MessageBox.Show($"程序无法启用/禁用该模组,因为文件{finalname}已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
59 | return;
60 | }
61 |
62 | try
63 | {
64 | File.Move(name, finalname);
65 | Program.mainWindow.listView2.Items[index].SubItems[1].Text = finalstate;
66 | }
67 | catch (Exception e)
68 | {
69 | Program.mainWindow.ShowError("程序在启用/禁用模组时出现错误: " + e.Message);
70 | }
71 | }
72 |
73 | public static void WriteMods()
74 | {
75 | try
76 | {
77 | MD5 md5 = MD5.Create();
78 | foreach (string filepath in Directory.GetFiles(ModsFolder, "*.jar"))
79 | {
80 |
81 | try
82 | {
83 | FileInfo file = new FileInfo(filepath);
84 | string filename = file.Name;
85 | string newfilename = "😅" + Libraries.String.ByteArrayToHexString(md5.ComputeHash(Encoding.UTF8.GetBytes(filename))) + "😅.jar";
86 | file.CopyTo(Program.mainWindow.regedit.GetGamePatch() + "\\Game\\.minecraft\\mods\\" + newfilename);
87 | Program.mainWindow.LogTime();
88 | Program.mainWindow.SuccessLogs($"模组{filename}已注入");
89 | }
90 | catch (Exception e)
91 | {
92 | Program.mainWindow.LogTime();
93 | Program.mainWindow.ErrorLogs($"在注入单个模组{filepath}时发生错误: {e.Message}");
94 | }
95 |
96 |
97 | }
98 | } catch (Exception e)
99 | {
100 | Program.mainWindow.LogTime();
101 | Program.mainWindow.ErrorLogs($"在注入模组时发生错误: {e.Message}");
102 | }
103 |
104 |
105 | }
106 | }
107 |
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/Antiban.cs:
--------------------------------------------------------------------------------
1 | using jsmhToolChest.Libraries;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 |
12 | namespace jsmhToolChest.Netease
13 | {
14 | internal class Antiban
15 | {
16 | private static Thread AntibanThreadObj;
17 | public static void AntiBanThread()
18 | {
19 | Program.mainWindow.LogTime();
20 | Program.mainWindow.CustomLogs("内存防封线程已开启");
21 |
22 | Process NeteaseProcess = NeteaseClient.GetNeteaseClientProcess();
23 | if (NeteaseProcess != null )
24 | {
25 | bool loaded = false;
26 | int timeoutCount = 0;
27 | while (!loaded && timeoutCount < 50)
28 | {
29 | Thread.Sleep(200);
30 | try
31 | {
32 |
33 | foreach(Libraries.ProcessModules.ProcessModule64 module in Libraries.ProcessModules.ProcessModules.getWOW64Modules(NeteaseProcess.Id))
34 | {
35 | if (module.ModuleName.Equals("api-ms-win-crt-utility-l1-1-1.dll"))
36 | {
37 | loaded = true;
38 | break;
39 | }
40 | }
41 | } catch (Exception ex)
42 | {
43 | Program.mainWindow.LogTime();
44 | Program.mainWindow.ErrorLogs("内存防封开启发生错误: " + ex.ToString());
45 | return;
46 | }
47 | if (!loaded)
48 | {
49 | timeoutCount++;
50 | }
51 | }
52 |
53 | if (loaded)
54 | {
55 | try
56 | {
57 | DLLInjector.InjectDLL("AntiBan.dll", Resource1.Antiban, NeteaseProcess);
58 | Program.mainWindow.LogTime();
59 | Program.mainWindow.SuccessLogs("内存防封已写入");
60 | } catch (Exception ex)
61 | {
62 | Program.mainWindow.LogTime();
63 | Program.mainWindow.ErrorLogs("内存防封开启发生错误: " + ex.ToString());
64 | }
65 |
66 | } else
67 | {
68 | Program.mainWindow.LogTime();
69 | Program.mainWindow.ErrorLogs("内存防封开启失败,模块等待超时");
70 | }
71 |
72 | }
73 | }
74 |
75 |
76 |
77 | public static void Start()
78 | {
79 | Stop();
80 | AntibanThreadObj = new Thread(new ThreadStart(AntiBanThread));
81 | AntibanThreadObj.Start();
82 | }
83 | public static void Stop()
84 | {
85 | if ( AntibanThreadObj != null )
86 | {
87 | if (AntibanThreadObj.IsAlive)
88 | {
89 | AntibanThreadObj.Abort();
90 |
91 | }
92 | }
93 |
94 |
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/ClientLauncher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.IO;
7 | using System.Threading;
8 | using System.Diagnostics;
9 | using jsmhToolChest.Libraries.ProcessWindows;
10 | using FastWin32.Diagnostics;
11 |
12 | namespace jsmhToolChest.Netease
13 | {
14 | /*
15 | internal class CL8
16 | {
17 | public static void WriteCL8()
18 | {
19 | Program.mainWindow.LogTime();
20 | try
21 | {
22 | File.WriteAllBytes(Program.mainWindow.regedit.GetGamePatch() + "\\Game\\.minecraft\\mods\\CL8🤔😋😅🤣😂😡.jar", Resource1.CL8);
23 | Program.mainWindow.SuccessLogs("CL8写出成功");
24 | } catch (Exception e)
25 | {
26 | Program.mainWindow.ErrorLogs("CL8写出错误,错误信息: " + e.Message);
27 | }
28 |
29 | }
30 |
31 | }
32 | */
33 | /*
34 | internal class OpenOpenCL
35 | {
36 | private static Thread clThreadObj ;
37 | public static void Start() {
38 | Stop();
39 | clThreadObj = new Thread(ClThread);
40 | clThreadObj.Start();
41 | }
42 | public static void Stop()
43 | {
44 | if (clThreadObj != null)
45 | {
46 | if (clThreadObj.IsAlive)
47 | {
48 | clThreadObj.Abort();
49 | }
50 | }
51 | }
52 | static void ClThread()
53 | {
54 | Program.mainWindow.LogTime();
55 | Program.mainWindow.CustomLogs("CL注入线程已开启");
56 | Process neteaseProcess = NeteaseClient.GetNeteaseClientProcess();
57 | bool isStarted = false;
58 | while (!neteaseProcess.HasExited)
59 | {
60 | Thread.Sleep(200);
61 | ProcessWindows.ProcessWindow[] windows = ProcessWindows.GetProcessWindows(neteaseProcess);
62 | foreach (ProcessWindows.ProcessWindow win in windows)
63 | {
64 | if (win.ClassName == "LWJGL")
65 | {
66 | isStarted = true;
67 | break;
68 | }
69 | }
70 |
71 | if (isStarted)
72 | {
73 | Program.mainWindow.LogTime();
74 | Program.mainWindow.SuccessLogs("CL已注入");
75 | Libraries.DLLInjector.InjectDLL("OpenOpenCL.dll", Resource1.OpenOpenCL, neteaseProcess);
76 | return;
77 | }
78 | }
79 |
80 | }
81 | }
82 | */
83 | internal class NewCL
84 | {
85 | private static Thread clThreadObj;
86 | public static void Start()
87 | {
88 | Stop();
89 | clThreadObj = new Thread(ClThread);
90 | clThreadObj.Start();
91 | }
92 | public static void Stop()
93 | {
94 | if (clThreadObj != null)
95 | {
96 | if (clThreadObj.IsAlive)
97 | {
98 | clThreadObj.Abort();
99 | }
100 | }
101 | }
102 | static void ClThread()
103 | {
104 | Program.mainWindow.LogTime();
105 | Program.mainWindow.CustomLogs("CL写入线程已开启");
106 | Process neteaseProcess = NeteaseClient.GetNeteaseClientProcess();
107 | bool isStarted = false;
108 | while (!neteaseProcess.HasExited)
109 | {
110 | Thread.Sleep(200);
111 | ProcessWindows.ProcessWindow[] windows = ProcessWindows.GetProcessWindows(neteaseProcess);
112 | foreach (ProcessWindows.ProcessWindow win in windows)
113 | {
114 | if (win.ClassName == "LWJGL")
115 | {
116 | isStarted = true;
117 | break;
118 | }
119 | }
120 |
121 | if (isStarted)
122 | {
123 | Program.mainWindow.LogTime();
124 | Program.mainWindow.SuccessLogs("CL开始写入");
125 | try
126 | {
127 | File.WriteAllBytes(Config.Config_folder + "\\jsmhToolChestCL.exe", Resource1.CLInjector);
128 | File.WriteAllBytes(Config.Config_folder + "\\jsmhCL.dll", Resource1.CL);
129 |
130 | }
131 | catch (Exception e)
132 | {
133 | Program.mainWindow.LogTime();
134 | Program.mainWindow.ErrorLogs("在CL写入时文件写出失败,详细信息:" + e.Message);
135 | }
136 | try
137 | {
138 | new Process()
139 | {
140 | StartInfo = new ProcessStartInfo()
141 | {
142 | FileName = Config.Config_folder + "\\jsmhToolChestCL.exe",
143 | Arguments = neteaseProcess.Id.ToString(),
144 | UseShellExecute = false,
145 | }
146 | }.Start();
147 | }
148 | catch (Exception e)
149 | {
150 | Program.mainWindow.LogTime();
151 | Program.mainWindow.ErrorLogs("在CL写入时进程创建失败,详细信息:" + e.Message);
152 | }
153 | return;
154 | }
155 | }
156 |
157 | }
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/Hook.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.IO;
7 | using System.Net.Sockets;
8 | using System.Threading;
9 | using FastWin32.Diagnostics;
10 | using static System.Net.Mime.MediaTypeNames;
11 | using System.Diagnostics;
12 | using System.Net;
13 |
14 | namespace jsmhToolChest.Netease
15 | {
16 | internal class Hook
17 | {
18 | private static string RandomString;
19 |
20 | public static void WriteHookFile()
21 | {
22 | try
23 | {
24 | Directory.CreateDirectory(Config.Config_folder + "\\Hook");
25 | File.WriteAllBytes(Config.Config_folder + "\\Hook\\Hook.dll", Resource1.Kupelo);
26 | File.WriteAllBytes(Config.Config_folder + "\\Hook\\Socket.dll", Resource1.Socket);
27 |
28 | } catch (Exception e)
29 | {
30 | Program.mainWindow.LogTime();
31 | Program.mainWindow.ErrorLogs("文件写出失败,详细信息:" + e.Message);
32 | }
33 | }
34 |
35 | public static void InjectHook()
36 | {
37 | RandomString = Libraries.String.GetRandomCharacters(16);
38 | uint processId = uint.Parse(WPFLauncher.WPFProcess.Id.ToString());
39 | string assemblyPath = Config.Config_folder + "\\Hook\\Hook.dll";
40 | int num;
41 | LocalPortListener.Start();
42 | Injector.InjectManaged(processId, assemblyPath, "ClassLibrary1.Class1", "init", RandomString, out num);
43 |
44 | }
45 |
46 | private static void HookMessageEvent(string message)
47 | {
48 | if ($"k_{RandomString}".Equals(message))
49 | {
50 | Program.mainWindow.LogTime();
51 | Program.mainWindow.SuccessLogs("Hook成功注入");
52 | }
53 |
54 | if (message.StartsWith("HookInstallError_"))
55 | {
56 | Program.mainWindow.LogTime();
57 | Program.mainWindow.ErrorLogs("Hook注入错误信息: " + message.Substring("HookInstallError_".Length, message.Length - "HookInstallError_".Length));
58 | }
59 | if (message.StartsWith("HookProcessError_"))
60 | {
61 | Program.mainWindow.LogTime();
62 | Program.mainWindow.ErrorLogs("Hook处理错误信息: " + message.Substring("HookProcessError_".Length, message.Length - "HookProcessError_".Length));
63 | }
64 | if ("LoginSuccess".Equals(message))
65 | {
66 | Program.mainWindow.LogTime();
67 | Program.mainWindow.SuccessLogs("网易账号登录成功");
68 | }
69 | }
70 |
71 | public class LocalPortListener
72 | {
73 | private static Thread ListenerThread;
74 | private static TcpListener TCP;
75 |
76 | private static void Loop()
77 | {
78 |
79 | while(true)
80 | {
81 | try
82 | {
83 | Socket s = TCP.AcceptSocket();
84 |
85 | Byte[] data = new Byte[s.ReceiveBufferSize];
86 | s.Receive(data);
87 |
88 | string stringdata = Encoding.Default.GetString(data);
89 | stringdata = stringdata.Replace(Encoding.Default.GetString(new byte[1]), "");
90 | string Decode = Encoding.Default.GetString(Convert.FromBase64String(stringdata));
91 | HookMessageEvent(Decode);
92 | Debug.Print(Decode);
93 | } catch (Exception e)
94 | {
95 |
96 | }
97 |
98 |
99 | }
100 | }
101 |
102 | public static void Start()
103 | {
104 |
105 | TCP = new TcpListener(new IPAddress(new byte[4] {127, 0, 0, 1}),20880);
106 | TCP.Start();
107 | ListenerThread = new Thread(new ThreadStart(Loop));
108 | ListenerThread.Start();
109 | }
110 |
111 | public static void Stop()
112 | {
113 | try
114 | {
115 | TCP.Stop();
116 | ListenerThread.Abort();
117 | }catch (Exception)
118 | {
119 |
120 | }
121 |
122 | }
123 | }
124 |
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/NeteaseClient.cs:
--------------------------------------------------------------------------------
1 | using FastWin32.Diagnostics;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Management;
9 |
10 |
11 | namespace jsmhToolChest.Netease
12 | {
13 | internal class NeteaseClient
14 | {
15 | public static Process GetNeteaseClientProcess()
16 | {
17 | try
18 | {
19 | Process[] ProcessList = Process.GetProcesses();
20 | foreach (Process EachProcess in ProcessList)
21 | {
22 | if (EachProcess.ProcessName.Equals("java") || EachProcess.ProcessName.Equals("javaw"))
23 | {
24 | string query = $"SELECT CommandLine FROM Win32_Process WHERE ProcessId = {EachProcess.Id}";
25 |
26 | using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query))
27 | {
28 | foreach (ManagementObject obj in searcher.Get())
29 | {
30 | if (obj["CommandLine"] != null)
31 | {
32 | string CommandLine = obj["CommandLine"].ToString();
33 | if (CommandLine.Contains("-DlauncherControlPort"))
34 | {
35 | EachProcess.StartInfo.Arguments = CommandLine;
36 | return EachProcess;
37 | }
38 | }
39 | else
40 | {
41 | return null;
42 | }
43 | }
44 | }
45 | }
46 | }
47 | }catch (Exception) { }
48 |
49 | return null;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/RegeditRead.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Win32;
7 |
8 | namespace jsmhToolChest.Netease
9 | {
10 | public class RegeditRead
11 | {
12 | public bool is4399 { get; set; }
13 | //bool is4399;
14 | private RegistryKey reg;
15 | public RegeditRead(bool is4399 = false)
16 | {
17 | this.is4399 = is4399;
18 | //is43991 = is4399;
19 | reg = Registry.CurrentUser.OpenSubKey(is4399 ? "SOFTWARE\\Netease\\PC4399_MCLauncher" : "SOFTWARE\\Netease\\MCLauncher");
20 | }
21 |
22 |
23 | public String GetInstallPatch()
24 | {
25 | string patch = "";
26 | try
27 | {
28 | patch = reg.GetValue("InstallLocation").ToString();
29 | } catch (Exception)
30 | {}
31 | return patch ;
32 | }
33 |
34 | public String GetGamePatch()
35 | {
36 | string patch = "";
37 | try
38 | {
39 | patch = reg.GetValue("DownloadPath").ToString();
40 | }
41 | catch (Exception)
42 | { }
43 | return patch;
44 | }
45 |
46 | public String GetWPFPatch()
47 | {
48 | return GetInstallPatch() + (is4399 ? "\\PC4399_WPFLauncher.exe" : "\\WPFLauncher.exe");
49 | }
50 |
51 | public String GetWPFName()
52 | {
53 | return is4399 ? "PC4399_WPFLauncher" : "WPFLauncher";
54 | }
55 |
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/jsmhToolChest/Netease/WPFLauncher.cs:
--------------------------------------------------------------------------------
1 | using FastWin32.Diagnostics;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Drawing;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Security.Cryptography;
9 | using System.Text;
10 | using System.Text.RegularExpressions;
11 | using System.Threading;
12 | using System.Threading.Tasks;
13 | using System.Windows.Forms;
14 |
15 |
16 | namespace jsmhToolChest.Netease
17 | {
18 | internal class WPFLauncher
19 | {
20 | public static Process WPFProcess = new Process();
21 | public static bool TestedNeteaseClient = false;
22 | private static bool TestedNeteaseFolderCreate = false;
23 | public static Thread NeteaseClientTestThreadObj;
24 | public async static Task Launch()
25 | {
26 | await Task.Run(() =>
27 | {
28 | Kill();
29 | Hook.WriteHookFile();
30 | WPFProcess.StartInfo.FileName = Program.mainWindow.regedit.GetWPFPatch();
31 | WPFProcess.StartInfo.UseShellExecute = false;
32 | WPFProcess.StartInfo.RedirectStandardOutput = true;
33 | WPFProcess.StartInfo.RedirectStandardError = true;
34 | WPFProcess.StartInfo.CreateNoWindow = true;
35 | Program.mainWindow.LogTime();
36 | Program.mainWindow.CustomLogs("准备启动盒子");
37 | WPFProcess.Start();
38 | Program.mainWindow.LogTime();
39 | Program.mainWindow.CustomLogs("盒子已启动 PID:" + WPFProcess.Id.ToString());
40 |
41 | bool loaded = false;
42 | int timeoutCount = 0;
43 | while (!loaded && timeoutCount < 50)
44 | {
45 | Thread.Sleep(200);
46 | try
47 | {
48 | WPFProcess.Refresh();
49 | foreach (ProcessModule module in WPFProcess.Modules)
50 | {
51 |
52 | if (module.ModuleName == "ncrypt.dll")
53 | {
54 | loaded = true;
55 | break;
56 | }
57 | }
58 | } catch
59 | {
60 |
61 | }
62 | if (!loaded)
63 | {
64 | timeoutCount++;
65 | }
66 |
67 | }
68 |
69 | if (loaded)
70 | {
71 | Program.mainWindow.LogTime();
72 | Program.mainWindow.CustomLogs("盒子模块已加载,开始注入Hook");
73 | try
74 | {
75 | Hook.InjectHook();
76 | NeteaseClientTestThreadObj = new Thread(new ThreadStart(NeteaseTestThread));
77 | NeteaseClientTestThreadObj.Start();
78 | } catch (Exception e)
79 | {
80 | Program.mainWindow.LogTime();
81 | Program.mainWindow.ErrorLogs("盒子启动失败 详细信息:" + e.Message);
82 | }
83 |
84 |
85 | }
86 | else
87 | {
88 | Program.mainWindow.LogTime();
89 | Program.mainWindow.ErrorLogs("等待盒子模块加载超时,请重试");
90 | }
91 |
92 | });
93 |
94 |
95 | }
96 | public static void Kill()
97 | {
98 |
99 | Process[] WPF = Process.GetProcessesByName(Program.mainWindow.regedit.GetWPFName());
100 | foreach (Process WPFProce in WPF)
101 | {
102 | Program.mainWindow.LogTime();
103 | Program.mainWindow.CustomLogs($"结束进程{WPFProce.ProcessName} PID:{WPFProce.Id}");
104 | WPFProce.Kill();
105 | }
106 | Process Netease = NeteaseClient.GetNeteaseClientProcess();
107 | if (Netease != null)
108 | {
109 | Program.mainWindow.LogTime();
110 | Program.mainWindow.CustomLogs($"结束进程{Netease.ProcessName} PID:{Netease.Id}");
111 | Netease.Kill();
112 | }
113 | }
114 |
115 | public static void NeteaseTestThread()
116 | {
117 | while(true)
118 | {
119 | Thread.Sleep(100);
120 | Process NeteastClientProcess = NeteaseClient.GetNeteaseClientProcess();
121 | if (NeteastClientProcess != null && !TestedNeteaseClient)
122 | {
123 | TestedNeteaseClient = true;
124 | Program.mainWindow.LogTime();
125 | Program.mainWindow.SuccessLogs($"网易客户端已成功启动 PID:{NeteastClientProcess.Id}");
126 | Program.mainWindow.ChangeStartBoxText("结束白端");
127 |
128 | if(Program.mainWindow.checkBox1.Checked || Program.mainWindow.Radio_Client.Checked)
129 | {
130 | DeleteServerMods();
131 | }
132 | if (Program.mainWindow.Radio_Client.Checked)
133 | {
134 | if (Program.mainWindow.radioButton1.Checked)
135 | {
136 | //CL8.WriteCL8();
137 | }
138 | }
139 | if (Program.mainWindow.Radio_Mods.Checked)
140 | {
141 | ModsInject.ModsInjectMain.WriteMods();
142 | }
143 |
144 | //Antiban.Start();
145 | if (Program.mainWindow.Radio_Client.Checked)
146 | {
147 | if (Program.mainWindow.radioButton1.Checked)
148 | {
149 | //OpenOpenCL.Start();
150 | NewCL.Start();
151 | }
152 | }
153 |
154 |
155 |
156 | }
157 | if (NeteastClientProcess == null && TestedNeteaseClient)
158 | {
159 | TestedNeteaseClient = false;
160 | Program.mainWindow.LogTime();
161 | Program.mainWindow.CustomLogs($"网易客户端已结束");
162 | Program.mainWindow.ChangeStartBoxText("重启盒子");
163 |
164 | //Antiban.Stop();
165 | //OpenOpenCL.Stop();
166 | NewCL.Stop();
167 | }
168 | }
169 | }
170 |
171 | public static void DeleteServerMods()
172 | {
173 | string ModsFolder = Program.mainWindow.regedit.GetGamePatch() + "\\Game\\.minecraft\\mods\\";
174 | foreach (string filepath in Directory.GetFiles(ModsFolder, "*.jar"))
175 | {
176 | try
177 | {
178 | FileInfo file = new FileInfo(filepath);
179 | string filename = file.Name;
180 | if (filename.IndexOf("@3@0") == -1) {
181 | file.Delete();
182 | Program.mainWindow.LogTime();
183 | Program.mainWindow.SuccessLogs($"模组{filename}已删除");
184 | }
185 |
186 |
187 | }
188 | catch (Exception e)
189 | {
190 | Program.mainWindow.LogTime();
191 | Program.mainWindow.ErrorLogs($"在删除单个模组{filepath}时发生错误: {e.Message}");
192 | }
193 | }
194 |
195 | }
196 |
197 | public static string ProcessNeteaseClientArguments(string arguments)
198 | {
199 | string newArguments = arguments;
200 | ProcessNeteaseClientInformation(newArguments);
201 | /*
202 | if (Program.mainWindow.Radio_Client.Checked)
203 | {
204 | newArguments = ReplaceArgument(newArguments, "--server", "forbidden");
205 | newArguments = ReplaceArgument(newArguments, "--port", "0");
206 | }
207 | */
208 | return newArguments;
209 | }
210 |
211 | static string ReplaceArgument(string input, string argument, string replacement)
212 | {
213 | if (input.Contains(argument))
214 | {
215 | string pattern = $"{argument}\\s+([^\\s]+)?";
216 | Regex regex = new Regex(pattern);
217 |
218 | Match match = regex.Match(input);
219 | if (match.Success)
220 | {
221 | input = input.Remove(match.Index, match.Length);
222 | input = input.Insert(match.Index, $"{argument} {replacement}");
223 | }
224 | else
225 | {
226 | input += $" {argument} {replacement}";
227 | }
228 | }
229 |
230 | return input;
231 | }
232 |
233 | static void ProcessNeteaseClientInformation(string arguments)
234 | {
235 | try
236 | {
237 | string PlayerName = Libraries.String.GetMiddleString(arguments, "--username ", " ");
238 | string ServerIP = Libraries.String.GetMiddleString(arguments, "--server ", " ");
239 | string ServerPort = Libraries.String.GetMiddleString(arguments, "--port ", " ");
240 | Program.mainWindow.LogTime();
241 | Program.mainWindow.CustomLogs("已获取到网易客户端信息");
242 | Program.mainWindow.LogTime();
243 | Program.mainWindow.CustomLogs("游戏名: ");
244 | Program.mainWindow.ImportantLogs(PlayerName);
245 | Program.mainWindow.LogTime();
246 | Program.mainWindow.CustomLogs("服务器IP: ");
247 | Program.mainWindow.ImportantLogs($"{ServerIP}:{ServerPort}");
248 |
249 | Action action = () =>
250 | {
251 | Program.mainWindow.textBox_name.Text = PlayerName;
252 | Program.mainWindow.textBox_IP.Text = $"{ServerIP}:{ServerPort}";
253 | };
254 | Program.mainWindow.Invoke(action);
255 |
256 |
257 | }
258 | catch (Exception e)
259 | {
260 | Program.mainWindow.LogTime();
261 | Program.mainWindow.CustomLogs("获取网易客户端信息失败: " + e.Message);
262 | }
263 | }
264 | }
265 | }
266 |
--------------------------------------------------------------------------------
/jsmhToolChest/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace jsmhToolChest
8 | {
9 | internal static class Program
10 | {
11 | public static MainWindow mainWindow;
12 | ///
13 | /// 应用程序的主入口点。
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 |
19 | Application.EnableVisualStyles();
20 | Application.SetCompatibleTextRenderingDefault(false);
21 | mainWindow = new MainWindow();
22 | Application.Run(mainWindow);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/jsmhToolChest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("jsmhToolChest")]
9 | [assembly: AssemblyDescription("jsmhToolChest is a free and open source tool for WPFLauncher")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("jsmhToolChest")]
13 | [assembly: AssemblyCopyright("")]
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("ac0cc16c-48b1-47be-870d-a7690d12f472")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.0.0.0")]
36 | [assembly: AssemblyFileVersion("0.0.0.0")]
37 |
--------------------------------------------------------------------------------
/jsmhToolChest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace jsmhToolChest.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", "17.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("jsmhToolChest.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性,对
51 | /// 使用此强类型资源类的所有资源查找执行重写。
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.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap add_32px {
67 | get {
68 | object obj = ResourceManager.GetObject("add_32px", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
75 | ///
76 | internal static System.Drawing.Bitmap add_64px {
77 | get {
78 | object obj = ResourceManager.GetObject("add_64px", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
85 | ///
86 | internal static System.Drawing.Bitmap copy_32px {
87 | get {
88 | object obj = ResourceManager.GetObject("copy_32px", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
95 | ///
96 | internal static System.Drawing.Bitmap done_32px {
97 | get {
98 | object obj = ResourceManager.GetObject("done_32px", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
105 | ///
106 | internal static System.Drawing.Bitmap done_64px {
107 | get {
108 | object obj = ResourceManager.GetObject("done_64px", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
115 | ///
116 | internal static System.Drawing.Bitmap download_32px {
117 | get {
118 | object obj = ResourceManager.GetObject("download_32px", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
125 | ///
126 | internal static System.Drawing.Bitmap download_64px {
127 | get {
128 | object obj = ResourceManager.GetObject("download_64px", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 |
133 | ///
134 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
135 | ///
136 | internal static System.Drawing.Bitmap folder_32px {
137 | get {
138 | object obj = ResourceManager.GetObject("folder_32px", resourceCulture);
139 | return ((System.Drawing.Bitmap)(obj));
140 | }
141 | }
142 |
143 | ///
144 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
145 | ///
146 | internal static System.Drawing.Bitmap folder_64px {
147 | get {
148 | object obj = ResourceManager.GetObject("folder_64px", resourceCulture);
149 | return ((System.Drawing.Bitmap)(obj));
150 | }
151 | }
152 |
153 | ///
154 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
155 | ///
156 | internal static System.Drawing.Bitmap reboot_32px {
157 | get {
158 | object obj = ResourceManager.GetObject("reboot_32px", resourceCulture);
159 | return ((System.Drawing.Bitmap)(obj));
160 | }
161 | }
162 |
163 | ///
164 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
165 | ///
166 | internal static System.Drawing.Bitmap reboot_64px {
167 | get {
168 | object obj = ResourceManager.GetObject("reboot_64px", resourceCulture);
169 | return ((System.Drawing.Bitmap)(obj));
170 | }
171 | }
172 |
173 | ///
174 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
175 | ///
176 | internal static System.Drawing.Bitmap waste_32px {
177 | get {
178 | object obj = ResourceManager.GetObject("waste_32px", resourceCulture);
179 | return ((System.Drawing.Bitmap)(obj));
180 | }
181 | }
182 |
183 | ///
184 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
185 | ///
186 | internal static System.Drawing.Bitmap waste_64px {
187 | get {
188 | object obj = ResourceManager.GetObject("waste_64px", resourceCulture);
189 | return ((System.Drawing.Bitmap)(obj));
190 | }
191 | }
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/jsmhToolChest/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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\reboot_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\add_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\folder_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Resources\copy_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\Resources\waste_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | ..\Resources\waste_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
140 | ..\Resources\reboot_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
141 |
142 |
143 | ..\Resources\add_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
144 |
145 |
146 | ..\Resources\folder_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
147 |
148 |
149 | ..\Resources\done_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
150 |
151 |
152 | ..\Resources\done_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
153 |
154 |
155 | ..\Resources\download_32px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
156 |
157 |
158 | ..\Resources\download_64px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
159 |
160 |
--------------------------------------------------------------------------------
/jsmhToolChest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace jsmhToolChest.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.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 | }
27 |
--------------------------------------------------------------------------------
/jsmhToolChest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/jsmhToolChest/Resource1.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace jsmhToolChest {
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", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resource1 {
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 Resource1() {
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("jsmhToolChest.Resource1", typeof(Resource1).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性,对
51 | /// 使用此强类型资源类的所有资源查找执行重写。
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[] Antiban {
67 | get {
68 | object obj = ResourceManager.GetObject("Antiban", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找 System.Byte[] 类型的本地化资源。
75 | ///
76 | internal static byte[] Authlib {
77 | get {
78 | object obj = ResourceManager.GetObject("Authlib", resourceCulture);
79 | return ((byte[])(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// 查找 System.Byte[] 类型的本地化资源。
85 | ///
86 | internal static byte[] CL {
87 | get {
88 | object obj = ResourceManager.GetObject("CL", resourceCulture);
89 | return ((byte[])(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// 查找 System.Byte[] 类型的本地化资源。
95 | ///
96 | internal static byte[] CLInjector {
97 | get {
98 | object obj = ResourceManager.GetObject("CLInjector", resourceCulture);
99 | return ((byte[])(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// 查找 System.Byte[] 类型的本地化资源。
105 | ///
106 | internal static byte[] Injector {
107 | get {
108 | object obj = ResourceManager.GetObject("Injector", resourceCulture);
109 | return ((byte[])(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// 查找 System.Byte[] 类型的本地化资源。
115 | ///
116 | internal static byte[] Kupelo {
117 | get {
118 | object obj = ResourceManager.GetObject("Kupelo", resourceCulture);
119 | return ((byte[])(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// 查找类似 https://cloud.js.mcdds.cn/jsmhToolChest/ 的本地化字符串。
125 | ///
126 | internal static string ServerURL {
127 | get {
128 | return ResourceManager.GetString("ServerURL", resourceCulture);
129 | }
130 | }
131 |
132 | ///
133 | /// 查找 System.Byte[] 类型的本地化资源。
134 | ///
135 | internal static byte[] Socket {
136 | get {
137 | object obj = ResourceManager.GetObject("Socket", resourceCulture);
138 | return ((byte[])(obj));
139 | }
140 | }
141 |
142 | ///
143 | /// 查找类似 5.0B28 的本地化字符串。
144 | ///
145 | internal static string Version {
146 | get {
147 | return ResourceManager.GetString("Version", resourceCulture);
148 | }
149 | }
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/jsmhToolChest/Resource1.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | Resources\Antiban.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | Resources\Authlib.jar;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 | Resources\CL.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
129 |
130 |
131 | Resources\CLInjector.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
132 |
133 |
134 | Resources\Injector.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
135 |
136 |
137 | Resources\Kupelo.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
138 |
139 |
140 | https://cloud.js.mcdds.cn/jsmhToolChest/
141 |
142 |
143 | Resources\Socket.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
144 |
145 |
146 | 5.0B28
147 |
148 |
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/Antiban.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/Antiban.dll
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/Authlib.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/Authlib.jar
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/CL.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/CL.dll
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/CLInjector.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/CLInjector.exe
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/Injector.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/Injector.exe
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/Kupelo.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/Kupelo.dll
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/Socket.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/Socket.dll
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/add_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/add_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/add_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/add_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/copy_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/copy_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/done_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/done_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/done_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/done_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/download_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/download_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/download_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/download_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/folder_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/folder_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/folder_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/folder_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/reboot_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/reboot_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/reboot_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/reboot_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/waste_32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/waste_32px.png
--------------------------------------------------------------------------------
/jsmhToolChest/Resources/waste_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsms2/jsmhToolChest/659a923c5fff6b241ea9a728080d4803237c0a06/jsmhToolChest/Resources/waste_64px.png
--------------------------------------------------------------------------------
/jsmhToolChest/UnCompress/UnCompressForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace jsmhToolChest.UnCompress
2 | {
3 | partial class UnCompressForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label2 = new System.Windows.Forms.Label();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.label3 = new System.Windows.Forms.Label();
34 | this.label4 = new System.Windows.Forms.Label();
35 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
36 | this.SuspendLayout();
37 | //
38 | // label2
39 | //
40 | this.label2.AutoSize = true;
41 | this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
42 | this.label2.Location = new System.Drawing.Point(34, 74);
43 | this.label2.Name = "label2";
44 | this.label2.Size = new System.Drawing.Size(0, 41);
45 | this.label2.TabIndex = 4;
46 | //
47 | // label1
48 | //
49 | this.label1.AutoSize = true;
50 | this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
51 | this.label1.Location = new System.Drawing.Point(34, 33);
52 | this.label1.Name = "label1";
53 | this.label1.Size = new System.Drawing.Size(0, 41);
54 | this.label1.TabIndex = 3;
55 | //
56 | // label3
57 | //
58 | this.label3.AutoSize = true;
59 | this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
60 | this.label3.Location = new System.Drawing.Point(34, 133);
61 | this.label3.Name = "label3";
62 | this.label3.Size = new System.Drawing.Size(0, 41);
63 | this.label3.TabIndex = 5;
64 | //
65 | // label4
66 | //
67 | this.label4.AutoSize = true;
68 | this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
69 | this.label4.Location = new System.Drawing.Point(34, 174);
70 | this.label4.Name = "label4";
71 | this.label4.Size = new System.Drawing.Size(0, 41);
72 | this.label4.TabIndex = 6;
73 | //
74 | // progressBar1
75 | //
76 | this.progressBar1.Location = new System.Drawing.Point(41, 234);
77 | this.progressBar1.Name = "progressBar1";
78 | this.progressBar1.Size = new System.Drawing.Size(1077, 45);
79 | this.progressBar1.TabIndex = 7;
80 | //
81 | // UnCompressForm
82 | //
83 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
85 | this.ClientSize = new System.Drawing.Size(1174, 320);
86 | this.Controls.Add(this.progressBar1);
87 | this.Controls.Add(this.label4);
88 | this.Controls.Add(this.label3);
89 | this.Controls.Add(this.label2);
90 | this.Controls.Add(this.label1);
91 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
92 | this.MaximizeBox = false;
93 | this.MinimizeBox = false;
94 | this.Name = "UnCompressForm";
95 | this.ShowIcon = false;
96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
97 | this.Text = "UnCompressForm";
98 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UnCompressForm_FormClosing);
99 | this.ResumeLayout(false);
100 | this.PerformLayout();
101 |
102 | }
103 |
104 | #endregion
105 |
106 | public System.Windows.Forms.Label label2;
107 | public System.Windows.Forms.Label label1;
108 | public System.Windows.Forms.Label label3;
109 | public System.Windows.Forms.Label label4;
110 | public System.Windows.Forms.ProgressBar progressBar1;
111 | }
112 | }
--------------------------------------------------------------------------------
/jsmhToolChest/UnCompress/UnCompressForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace jsmhToolChest.UnCompress
12 | {
13 | public partial class UnCompressForm : Form
14 | {
15 | public UnCompressForm()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void UnCompressForm_FormClosing(object sender, FormClosingEventArgs e)
21 | {
22 | e.Cancel = !UnCompressUtil.done;
23 | }
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/jsmhToolChest/UnCompress/UnCompressForm.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/jsmhToolChest/UnCompress/UnCompressUtil.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Threading.Tasks;
4 | using SharpCompress.Archives;
5 | using SharpCompress.Common;
6 |
7 | namespace jsmhToolChest.UnCompress
8 | {
9 | internal class UnCompressUtil
10 | {
11 | public static bool done = false;
12 | public static async Task StartUnCompressAsync(string file, string folder, string title = "正在解压文件")
13 | {
14 | done = false;
15 | UnCompressForm form = new UnCompressForm();
16 | form.Show();
17 | form.Text = title;
18 | form.label1.Text = "正在解压" + file;
19 | form.label2.Text = "到" + folder;
20 |
21 | long totalSize = 0;
22 | long extractedSize = 0;
23 |
24 | using (var archive = ArchiveFactory.Open(file))
25 | {
26 | foreach (var entry in archive.Entries)
27 | {
28 | if (!entry.IsDirectory)
29 | {
30 | totalSize += entry.Size;
31 | }
32 | }
33 |
34 | archive.EntryExtractionBegin += (sender, e) =>
35 | {
36 | Action action = () =>
37 | {
38 |
39 | form.label3.Text = "正在解压" + e.Item.Key;
40 | };
41 | form.Invoke(action);
42 |
43 | };
44 | archive.EntryExtractionEnd += (sender, e) =>
45 | {
46 | Action action = () =>
47 | {
48 | extractedSize += e.Item.Size;
49 | double progress = (((double)extractedSize / totalSize) * 100);
50 | form.progressBar1.Value = (int)progress;
51 | form.label4.Text = $"已完成{(((double)extractedSize / totalSize) * 100):0.00}%";
52 | };
53 | form.Invoke(action);
54 |
55 | };
56 |
57 | foreach (var entry in archive.Entries)
58 | {
59 | if (!entry.IsDirectory)
60 | {
61 | await Task.Run(() => entry.WriteToDirectory(folder, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true }));
62 | }
63 | }
64 | }
65 | done = true;
66 | form.Close();
67 | }
68 |
69 |
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/jsmhToolChest/VersionCheck.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Net.Http;
7 | using System.Net;
8 |
9 | namespace jsmhToolChest
10 | {
11 | internal class VersionCheck
12 | {
13 | public static bool IsLatestVersion()
14 | {
15 | try
16 | {
17 | WebClient client = new WebClient();
18 | string latestversion = client.DownloadString(Resource1.ServerURL + "Latest_version.txt");
19 | if (latestversion.Equals(""))
20 | {
21 | Program.mainWindow.ShowError("服务器返回空\r\nWebside: https://jsmh.red/\r\nQQGuild: https://pd.qq.com/s/b8z1gt7f9\r\nGithub: https://github.com/jsms2/jsmhToolChest");
22 | }
23 | if (latestversion.Equals(Resource1.Version))
24 | {
25 | return true;
26 | }
27 | } catch (Exception e)
28 | {
29 | Program.mainWindow.ShowError("获取服务器信息失败: "+e.Message + "\r\nWebside: https://jsmh.red/\r\nQQGuild: https://pd.qq.com/s/b8z1gt7f9\r\nGithub: https://github.com/jsms2/jsmhToolChest");
30 | }
31 | return false;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/jsmhToolChest/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
54 |
55 |
56 |
57 | true
58 | true
59 |
60 |
61 |
62 |
63 |
64 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/jsmhToolChest/packages.config:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------