├── .gitignore
├── Assets
├── logo.ico
├── logo.png
└── logo.psd
├── Ceras License.txt
├── Prereqs
└── dotnetfx2.exe
├── WindowsGlitchHarvester.sln
└── WindowsGlitchHarvester
├── App.config
├── Components
├── MultiTrackBar_Comp.Designer.cs
├── MultiTrackBar_Comp.cs
└── MultiTrackBar_Comp.resx
├── DISCLAIMER.TXT
├── FastZipProgram.cs
├── LICENSE
├── LICENSES
├── Ceras License.txt
├── DISCLAIMER.TXT
├── DOLPHINWARNING.TXT
├── LICENSE
├── Netcore+Vanguard+WGH License.txt
├── Newtonsoft Json License.txt
├── SevenZip License.txt
└── SevenZipSharp License.txt
├── ProcessHijack.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
├── Settings.settings
└── app.manifest
├── Resources
└── logortc.png
├── VanguardForWindowsFiles.csproj
├── VanguardForWindowsFiles.csproj.user
├── WGH.pfx
├── WGH_BlastEditorForm.Designer.cs
├── WGH_BlastEditorForm.cs
├── WGH_BlastEditorForm.resx
├── WGH_Core.cs
├── WGH_Enums.cs
├── WGH_Executor.cs
├── WGH_Extensions.cs
├── WGH_HookToProcess.Designer.cs
├── WGH_HookToProcess.cs
├── WGH_HookToProcess.resx
├── WGH_MainForm.Designer.cs
├── WGH_MainForm.cs
├── WGH_MainForm.resx
├── WGH_MemoryBanks.cs
├── WGH_NightmareEngine.cs
├── WGH_Objects.cs
├── WGH_Progress.Designer.cs
├── WGH_Progress.cs
├── WGH_Progress.resx
├── WGH_SelectMultiple.Designer.cs
├── WGH_SelectMultiple.cs
├── WGH_SelectMultiple.resx
├── WGH_VectorEngine.cs
├── WindowsGlitchHarvester.csproj
├── WindowsGlitchHarvester.csproj.user
└── logo.ico
/.gitignore:
--------------------------------------------------------------------------------
1 | !*
2 | WindowsGlitchHarvester/bin/*
3 | WindowsGlitchHarvester/obj/*
4 | .vs/*
5 | packages/*
--------------------------------------------------------------------------------
/Assets/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/Assets/logo.ico
--------------------------------------------------------------------------------
/Assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/Assets/logo.png
--------------------------------------------------------------------------------
/Assets/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/Assets/logo.psd
--------------------------------------------------------------------------------
/Ceras License.txt:
--------------------------------------------------------------------------------
1 | The following license applies to the Ceras serialization library used within Netcore. You can find Ceras here https://github.com/rikimaru0345/Ceras
2 |
3 | Apache License
4 | Version 2.0, January 2004
5 | http://www.apache.org/licenses/
6 |
7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8 |
9 | 1. Definitions.
10 |
11 | "License" shall mean the terms and conditions for use, reproduction,
12 | and distribution as defined by Sections 1 through 9 of this document.
13 |
14 | "Licensor" shall mean the copyright owner or entity authorized by
15 | the copyright owner that is granting the License.
16 |
17 | "Legal Entity" shall mean the union of the acting entity and all
18 | other entities that control, are controlled by, or are under common
19 | control with that entity. For the purposes of this definition,
20 | "control" means (i) the power, direct or indirect, to cause the
21 | direction or management of such entity, whether by contract or
22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
23 | outstanding shares, or (iii) beneficial ownership of such entity.
24 |
25 | "You" (or "Your") shall mean an individual or Legal Entity
26 | exercising permissions granted by this License.
27 |
28 | "Source" form shall mean the preferred form for making modifications,
29 | including but not limited to software source code, documentation
30 | source, and configuration files.
31 |
32 | "Object" form shall mean any form resulting from mechanical
33 | transformation or translation of a Source form, including but
34 | not limited to compiled object code, generated documentation,
35 | and conversions to other media types.
36 |
37 | "Work" shall mean the work of authorship, whether in Source or
38 | Object form, made available under the License, as indicated by a
39 | copyright notice that is included in or attached to the work
40 | (an example is provided in the Appendix below).
41 |
42 | "Derivative Works" shall mean any work, whether in Source or Object
43 | form, that is based on (or derived from) the Work and for which the
44 | editorial revisions, annotations, elaborations, or other modifications
45 | represent, as a whole, an original work of authorship. For the purposes
46 | of this License, Derivative Works shall not include works that remain
47 | separable from, or merely link (or bind by name) to the interfaces of,
48 | the Work and Derivative Works thereof.
49 |
50 | "Contribution" shall mean any work of authorship, including
51 | the original version of the Work and any modifications or additions
52 | to that Work or Derivative Works thereof, that is intentionally
53 | submitted to Licensor for inclusion in the Work by the copyright owner
54 | or by an individual or Legal Entity authorized to submit on behalf of
55 | the copyright owner. For the purposes of this definition, "submitted"
56 | means any form of electronic, verbal, or written communication sent
57 | to the Licensor or its representatives, including but not limited to
58 | communication on electronic mailing lists, source code control systems,
59 | and issue tracking systems that are managed by, or on behalf of, the
60 | Licensor for the purpose of discussing and improving the Work, but
61 | excluding communication that is conspicuously marked or otherwise
62 | designated in writing by the copyright owner as "Not a Contribution."
63 |
64 | "Contributor" shall mean Licensor and any individual or Legal Entity
65 | on behalf of whom a Contribution has been received by Licensor and
66 | subsequently incorporated within the Work.
67 |
68 | 2. Grant of Copyright License. Subject to the terms and conditions of
69 | this License, each Contributor hereby grants to You a perpetual,
70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71 | copyright license to reproduce, prepare Derivative Works of,
72 | publicly display, publicly perform, sublicense, and distribute the
73 | Work and such Derivative Works in Source or Object form.
74 |
75 | 3. Grant of Patent License. Subject to the terms and conditions of
76 | this License, each Contributor hereby grants to You a perpetual,
77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78 | (except as stated in this section) patent license to make, have made,
79 | use, offer to sell, sell, import, and otherwise transfer the Work,
80 | where such license applies only to those patent claims licensable
81 | by such Contributor that are necessarily infringed by their
82 | Contribution(s) alone or by combination of their Contribution(s)
83 | with the Work to which such Contribution(s) was submitted. If You
84 | institute patent litigation against any entity (including a
85 | cross-claim or counterclaim in a lawsuit) alleging that the Work
86 | or a Contribution incorporated within the Work constitutes direct
87 | or contributory patent infringement, then any patent licenses
88 | granted to You under this License for that Work shall terminate
89 | as of the date such litigation is filed.
90 |
91 | 4. Redistribution. You may reproduce and distribute copies of the
92 | Work or Derivative Works thereof in any medium, with or without
93 | modifications, and in Source or Object form, provided that You
94 | meet the following conditions:
95 |
96 | (a) You must give any other recipients of the Work or
97 | Derivative Works a copy of this License; and
98 |
99 | (b) You must cause any modified files to carry prominent notices
100 | stating that You changed the files; and
101 |
102 | (c) You must retain, in the Source form of any Derivative Works
103 | that You distribute, all copyright, patent, trademark, and
104 | attribution notices from the Source form of the Work,
105 | excluding those notices that do not pertain to any part of
106 | the Derivative Works; and
107 |
108 | (d) If the Work includes a "NOTICE" text file as part of its
109 | distribution, then any Derivative Works that You distribute must
110 | include a readable copy of the attribution notices contained
111 | within such NOTICE file, excluding those notices that do not
112 | pertain to any part of the Derivative Works, in at least one
113 | of the following places: within a NOTICE text file distributed
114 | as part of the Derivative Works; within the Source form or
115 | documentation, if provided along with the Derivative Works; or,
116 | within a display generated by the Derivative Works, if and
117 | wherever such third-party notices normally appear. The contents
118 | of the NOTICE file are for informational purposes only and
119 | do not modify the License. You may add Your own attribution
120 | notices within Derivative Works that You distribute, alongside
121 | or as an addendum to the NOTICE text from the Work, provided
122 | that such additional attribution notices cannot be construed
123 | as modifying the License.
124 |
125 | You may add Your own copyright statement to Your modifications and
126 | may provide additional or different license terms and conditions
127 | for use, reproduction, or distribution of Your modifications, or
128 | for any such Derivative Works as a whole, provided Your use,
129 | reproduction, and distribution of the Work otherwise complies with
130 | the conditions stated in this License.
131 |
132 | 5. Submission of Contributions. Unless You explicitly state otherwise,
133 | any Contribution intentionally submitted for inclusion in the Work
134 | by You to the Licensor shall be under the terms and conditions of
135 | this License, without any additional terms or conditions.
136 | Notwithstanding the above, nothing herein shall supersede or modify
137 | the terms of any separate license agreement you may have executed
138 | with Licensor regarding such Contributions.
139 |
140 | 6. Trademarks. This License does not grant permission to use the trade
141 | names, trademarks, service marks, or product names of the Licensor,
142 | except as required for reasonable and customary use in describing the
143 | origin of the Work and reproducing the content of the NOTICE file.
144 |
145 | 7. Disclaimer of Warranty. Unless required by applicable law or
146 | agreed to in writing, Licensor provides the Work (and each
147 | Contributor provides its Contributions) on an "AS IS" BASIS,
148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149 | implied, including, without limitation, any warranties or conditions
150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151 | PARTICULAR PURPOSE. You are solely responsible for determining the
152 | appropriateness of using or redistributing the Work and assume any
153 | risks associated with Your exercise of permissions under this License.
154 |
155 | 8. Limitation of Liability. In no event and under no legal theory,
156 | whether in tort (including negligence), contract, or otherwise,
157 | unless required by applicable law (such as deliberate and grossly
158 | negligent acts) or agreed to in writing, shall any Contributor be
159 | liable to You for damages, including any direct, indirect, special,
160 | incidental, or consequential damages of any character arising as a
161 | result of this License or out of the use or inability to use the
162 | Work (including but not limited to damages for loss of goodwill,
163 | work stoppage, computer failure or malfunction, or any and all
164 | other commercial damages or losses), even if such Contributor
165 | has been advised of the possibility of such damages.
166 |
167 | 9. Accepting Warranty or Additional Liability. While redistributing
168 | the Work or Derivative Works thereof, You may choose to offer,
169 | and charge a fee for, acceptance of support, warranty, indemnity,
170 | or other liability obligations and/or rights consistent with this
171 | License. However, in accepting such obligations, You may act only
172 | on Your own behalf and on Your sole responsibility, not on behalf
173 | of any other Contributor, and only if You agree to indemnify,
174 | defend, and hold each Contributor harmless for any liability
175 | incurred by, or claims asserted against, such Contributor by reason
176 | of your accepting any such warranty or additional liability.
177 |
178 | END OF TERMS AND CONDITIONS
179 |
180 | APPENDIX: How to apply the Apache License to your work.
181 |
182 | To apply the Apache License to your work, attach the following
183 | boilerplate notice, with the fields enclosed by brackets "[]"
184 | replaced with your own identifying information. (Don't include
185 | the brackets!) The text should be enclosed in the appropriate
186 | comment syntax for the file format. We also recommend that a
187 | file or class name and description of purpose be included on the
188 | same "printed page" as the copyright notice for easier
189 | identification within third-party archives.
190 |
191 | Copyright [yyyy] [name of copyright owner]
192 |
193 | Licensed under the Apache License, Version 2.0 (the "License");
194 | you may not use this file except in compliance with the License.
195 | You may obtain a copy of the License at
196 |
197 | http://www.apache.org/licenses/LICENSE-2.0
198 |
199 | Unless required by applicable law or agreed to in writing, software
200 | distributed under the License is distributed on an "AS IS" BASIS,
201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202 | See the License for the specific language governing permissions and
203 | limitations under the License.
--------------------------------------------------------------------------------
/Prereqs/dotnetfx2.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/Prereqs/dotnetfx2.exe
--------------------------------------------------------------------------------
/WindowsGlitchHarvester.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.28902.138
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsGlitchHarvester", "WindowsGlitchHarvester\WindowsGlitchHarvester.csproj", "{3E59FB86-7A25-4310-A62A-97DE5AA32528}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{649E5B0B-063D-4FEE-8237-3AF442740AB9}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {3E59FB86-7A25-4310-A62A-97DE5AA32528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {3E59FB86-7A25-4310-A62A-97DE5AA32528}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {3E59FB86-7A25-4310-A62A-97DE5AA32528}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {3E59FB86-7A25-4310-A62A-97DE5AA32528}.Release|Any CPU.Build.0 = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {8EC88951-5F32-44D5-8F0B-2EC14A1CF867}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Components/MultiTrackBar_Comp.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace WindowsGlitchHarvester.Components
2 | {
3 | partial class MultiTrackBar_Comp
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 Component 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.lbControlName = new System.Windows.Forms.Label();
32 | this.nmControlValue = new System.Windows.Forms.NumericUpDown();
33 | this.tbControlValue = new WindowsGlitchHarvester.Components.NoFocusTrackBar();
34 | this.cbControlName = new System.Windows.Forms.CheckBox();
35 | ((System.ComponentModel.ISupportInitialize)(this.nmControlValue)).BeginInit();
36 | ((System.ComponentModel.ISupportInitialize)(this.tbControlValue)).BeginInit();
37 | this.SuspendLayout();
38 | //
39 | // lbControlName
40 | //
41 | this.lbControlName.AutoSize = true;
42 | this.lbControlName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
43 | this.lbControlName.ForeColor = System.Drawing.Color.White;
44 | this.lbControlName.Location = new System.Drawing.Point(7, 8);
45 | this.lbControlName.Name = "lbControlName";
46 | this.lbControlName.Size = new System.Drawing.Size(35, 13);
47 | this.lbControlName.TabIndex = 0;
48 | this.lbControlName.Text = "Name";
49 | //
50 | // nmControlValue
51 | //
52 | this.nmControlValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
53 | this.nmControlValue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
54 | this.nmControlValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
55 | this.nmControlValue.ForeColor = System.Drawing.Color.White;
56 | this.nmControlValue.Location = new System.Drawing.Point(251, 6);
57 | this.nmControlValue.Maximum = new decimal(new int[] {
58 | -1,
59 | 2147483647,
60 | 0,
61 | 0});
62 | this.nmControlValue.Name = "nmControlValue";
63 | this.nmControlValue.Size = new System.Drawing.Size(75, 20);
64 | this.nmControlValue.TabIndex = 2;
65 | this.nmControlValue.Tag = "color:darker";
66 | this.nmControlValue.ValueChanged += new System.EventHandler(this.nmControlValue_ValueChanged);
67 | this.nmControlValue.KeyUp += new System.Windows.Forms.KeyEventHandler(this.nmControlValue_KeyUp);
68 | //
69 | // tbControlValue
70 | //
71 | this.tbControlValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
72 | | System.Windows.Forms.AnchorStyles.Right)));
73 | this.tbControlValue.Location = new System.Drawing.Point(0, 35);
74 | this.tbControlValue.Maximum = 65536;
75 | this.tbControlValue.Name = "tbControlValue";
76 | this.tbControlValue.Size = new System.Drawing.Size(334, 45);
77 | this.tbControlValue.TabIndex = 3;
78 | this.tbControlValue.TabStop = false;
79 | this.tbControlValue.TickFrequency = 6553;
80 | this.tbControlValue.ValueChanged += new System.EventHandler(this.tbControlValue_ValueChanged);
81 | //
82 | // cbControlName
83 | //
84 | this.cbControlName.AutoSize = true;
85 | this.cbControlName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
86 | this.cbControlName.ForeColor = System.Drawing.Color.White;
87 | this.cbControlName.Location = new System.Drawing.Point(79, 9);
88 | this.cbControlName.Name = "cbControlName";
89 | this.cbControlName.Size = new System.Drawing.Size(54, 17);
90 | this.cbControlName.TabIndex = 4;
91 | this.cbControlName.Text = "Name";
92 | this.cbControlName.UseVisualStyleBackColor = true;
93 | this.cbControlName.Visible = false;
94 | this.cbControlName.CheckedChanged += new System.EventHandler(this.cbControlName_CheckedChanged);
95 | //
96 | // MultiTrackBar_Comp
97 | //
98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
100 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
101 | this.Controls.Add(this.cbControlName);
102 | this.Controls.Add(this.tbControlValue);
103 | this.Controls.Add(this.nmControlValue);
104 | this.Controls.Add(this.lbControlName);
105 | this.Name = "MultiTrackBar_Comp";
106 | this.Size = new System.Drawing.Size(334, 63);
107 | this.Tag = "color:darker";
108 | this.Load += new System.EventHandler(this.MultiTrackBar_Comp_Load);
109 | ((System.ComponentModel.ISupportInitialize)(this.nmControlValue)).EndInit();
110 | ((System.ComponentModel.ISupportInitialize)(this.tbControlValue)).EndInit();
111 | this.ResumeLayout(false);
112 | this.PerformLayout();
113 |
114 | }
115 |
116 | #endregion
117 |
118 | private System.Windows.Forms.Label lbControlName;
119 | private System.Windows.Forms.NumericUpDown nmControlValue;
120 | private NoFocusTrackBar tbControlValue;
121 | private System.Windows.Forms.CheckBox cbControlName;
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Components/MultiTrackBar_Comp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace WindowsGlitchHarvester.Components
10 | {
11 | public partial class MultiTrackBar_Comp : UserControl
12 | {
13 | public event EventHandler ValueChanged;
14 | public virtual void OnValueChanged(ValueUpdateEventArgs e) => ValueChanged?.Invoke(this, e);
15 |
16 | public event EventHandler CheckChanged;
17 | public virtual void OnCheckChanged(object sender, EventArgs e) => CheckChanged?.Invoke(sender, e);
18 |
19 | private bool GeneralUpdateFlag = false; //makes other events ignore firing
20 |
21 | private long _value;
22 |
23 | [Description("Net value of the control (displayed in numeric box)"), Category("Data")]
24 | public long Value
25 | {
26 | get { return _value; }
27 | set
28 | {
29 | if (!initialized)
30 | {
31 | var tbValue = nmValueToTbValueQuadScale(value);
32 | UpdateAllControls(value, tbValue, null);
33 | initialized = true;
34 | }
35 | else
36 | {
37 | _value = value;
38 | }
39 | }
40 | }
41 |
42 | private bool _DisplayCheckbox = false;
43 | [Description("Display a checkbox before the label"), Category("Data")]
44 | public bool DisplayCheckbox {
45 | get {
46 | return _DisplayCheckbox; }
47 | set {
48 | _DisplayCheckbox = value;
49 | if(value)
50 | {
51 | lbControlName.Visible = false;
52 | cbControlName.Visible = true;
53 | }
54 | else
55 | {
56 | lbControlName.Visible = true;
57 | cbControlName.Visible = false;
58 | }
59 | }
60 | }
61 |
62 | private bool FirstLoadDone = false;
63 | private long _Maximum = 500000;
64 | [Description("Maximum value of the control"), Category("Data")]
65 | public long Maximum
66 | {
67 | get
68 | {
69 | return _Maximum;
70 | }
71 | set
72 | {
73 | _Maximum = value;
74 | if (FirstLoadDone)
75 | tbControlValue_ValueChanged(null, null);
76 | }
77 | }
78 |
79 | private string name = "Name";
80 |
81 | [Description("Displayed label of the control"), Category("Data")]
82 | public string Label {
83 | get { return name; }
84 | set
85 | {
86 | name = value;
87 | lbControlName.Text = value;
88 | cbControlName.Text = value;
89 | }
90 | }
91 |
92 | [Description("Let the NumericBox override the maximum value"), Category("Data")]
93 | public bool UncapNumericBox { get; set; } = false;
94 |
95 | private Timer updater;
96 | private int updateThreshold = 250;
97 |
98 | private List slaveComps = new List();
99 | private MultiTrackBar_Comp parentComp = null;
100 |
101 | private decimal A; //A value for quadratic function Y = AX² used to scale components
102 | private bool initialized = false;
103 |
104 | public MultiTrackBar_Comp()
105 | {
106 | InitializeComponent();
107 |
108 | cbControlName.Location = lbControlName.Location;
109 |
110 | updater = new Timer();
111 | updater.Interval = updateThreshold;
112 | updater.Tick += Updater_Tick;
113 |
114 | //Calculate A for quadratic function
115 | decimal max_X = Convert.ToDecimal(65536);
116 | decimal max_X_Squared = max_X * max_X;
117 | A = Maximum / max_X_Squared;
118 | }
119 |
120 |
121 | /*
122 | Y = AX²
123 | 5000000 = A * 4294967296
124 |
125 | A = 4294967296
126 | A = (65536*65536)/Maximum
127 | */
128 |
129 | private long tbValueToNmValueQuadScale(long tbValue)
130 | {
131 | decimal max_X = Convert.ToDecimal(tbControlValue.Maximum);
132 | decimal max_X_Squared = max_X * max_X;
133 | decimal A = Maximum / max_X_Squared;
134 |
135 | decimal X = Convert.ToDecimal(tbValue);
136 | decimal Y = A * (X * X);
137 |
138 | decimal Floored_Y = Math.Floor(Y);
139 | return Convert.ToInt64(Floored_Y);
140 | }
141 |
142 | private int nmValueToTbValueQuadScale(decimal Y)
143 | {
144 | decimal max_X = Convert.ToDecimal(tbControlValue.Maximum);
145 | decimal max_X_Squared = max_X * max_X;
146 | decimal A = Maximum / max_X_Squared;
147 |
148 | decimal X = DecSqrt(Y / A);
149 |
150 | decimal Floored_X = Math.Floor(X);
151 | return Convert.ToInt32(Floored_X);
152 | }
153 |
154 |
155 | public static decimal DecSqrt(decimal x)
156 | {
157 | return (decimal)Math.Sqrt((double)x);
158 | }
159 |
160 | private void Updater_Tick(object sender, EventArgs e)
161 | {
162 | updater.Stop();
163 | OnValueChanged(new ValueUpdateEventArgs(Value));
164 |
165 | }
166 |
167 | public void registerSlave(MultiTrackBar_Comp comp)
168 | {
169 | slaveComps.Add(comp);
170 | comp.parentComp = this;
171 |
172 | }
173 |
174 | private void MultiTrackBar_Comp_Load(object sender, EventArgs e)
175 | {
176 | FirstLoadDone = true;
177 | }
178 |
179 | private void UpdateAllControls(long nmValue, long tbValue, Control setter)
180 | {
181 | GeneralUpdateFlag = true;
182 |
183 | if (setter != this)
184 | {
185 |
186 | if (setter != tbControlValue)
187 | {
188 | if (tbValue > 65536)
189 | tbControlValue.Value = Convert.ToInt32(65536);
190 | else
191 | tbControlValue.Value = Convert.ToInt32(tbValue);
192 | }
193 |
194 | if (setter != nmControlValue)
195 | if (nmValue > Maximum && !UncapNumericBox)
196 | nmControlValue.Value = Convert.ToInt32(Maximum);
197 | else
198 | nmControlValue.Value = nmValue;
199 |
200 | foreach (var slave in slaveComps)
201 | slave.UpdateAllControls(nmValue, tbValue, this);
202 |
203 | if (parentComp != null)
204 | parentComp.UpdateAllControls(nmValue, tbValue, setter);
205 |
206 | }
207 |
208 | GeneralUpdateFlag = false;
209 | }
210 |
211 | private void PropagateValue(long nmValue, long tbValue, Control setter)
212 | {
213 | UpdateAllControls(nmValue, tbValue, setter);
214 |
215 | Value = nmValue;
216 | updater.Stop();
217 | updater.Start();
218 | }
219 |
220 | private void tbControlValue_ValueChanged(object sender, EventArgs e)
221 | {
222 | if (GeneralUpdateFlag)
223 | return;
224 |
225 | int tbValue = tbControlValue.Value;
226 | long nmValue = tbValueToNmValueQuadScale(tbValue);
227 |
228 | PropagateValue(nmValue, tbValue, tbControlValue);
229 | }
230 |
231 | private void nmControlValue_ValueChanged(object sender, EventArgs e)
232 | {
233 | if (GeneralUpdateFlag)
234 | return;
235 |
236 | long nmValue = Convert.ToInt64(nmControlValue.Value);
237 | int tbValue = nmValueToTbValueQuadScale(nmControlValue.Value);
238 |
239 | PropagateValue(nmValue, tbValue, nmControlValue);
240 | }
241 |
242 | private void cbControlName_CheckedChanged(object sender, EventArgs e)
243 | {
244 | OnCheckChanged(sender, e);
245 | }
246 |
247 | private void nmControlValue_KeyUp(object sender, KeyEventArgs e)
248 | {
249 | if (GeneralUpdateFlag)
250 | return;
251 |
252 | long nmValue = Convert.ToInt64(nmControlValue.Value);
253 | int tbValue = nmValueToTbValueQuadScale(nmControlValue.Value);
254 |
255 | PropagateValue(nmValue, tbValue, nmControlValue);
256 | }
257 | }
258 |
259 | internal class NoFocusTrackBar : System.Windows.Forms.TrackBar
260 | {
261 | [System.Runtime.InteropServices.DllImport("user32.dll")]
262 | public extern static int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
263 |
264 | private static int MakeParam(int loWord, int hiWord)
265 | {
266 | return (hiWord << 16) | (loWord & 0xffff);
267 | }
268 |
269 | protected override void OnGotFocus(EventArgs e)
270 | {
271 | base.OnGotFocus(e);
272 | SendMessage(this.Handle, 0x0128, MakeParam(1, 0x1), 0);
273 | }
274 | }
275 |
276 | public class ValueUpdateEventArgs : EventArgs
277 | {
278 | public long value;
279 |
280 | public ValueUpdateEventArgs(long _value)
281 | {
282 | value = _value;
283 | }
284 | }
285 | }
286 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Components/MultiTrackBar_Comp.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/DISCLAIMER.TXT:
--------------------------------------------------------------------------------
1 | Welcome to the Windows Glitch Harvester
2 | THIS PROGRAM IS IN ALPHA
3 | Version [ver]
4 |
5 | Disclaimer:
6 | This program comes with absolutely ZERO warranty.
7 | You may use it at your own risk.
8 |
9 | The Windows Glitch Harvester is distributed under an MIT Licence. Source is available at https://github.com/ircluzar/RTC3
10 |
11 | Known facts(and warnings):
12 | - Can cause irreparable damage to your data if misused (e.g. corrupting core Windows files)
13 | - Can cause windows to BSOD (extremely rarely)
14 | - Can write a significant amount of data to your hard drive depending on usage
15 |
16 | You can download the latest version of Dolphin Narry's Mod at
17 | https://github.com/narryg/dolphin/releases
18 |
19 | This message only appears once.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/FastZipProgram.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using ICSharpCode.SharpZipLib.Zip;
6 | using ICSharpCode.SharpZipLib.Core;
7 | using System.IO;
8 |
9 | namespace WindowsGlitchHarvester
10 | {
11 | // SharpZipLibrary samples
12 | // Copyright (c) 2007, AlphaSierraPapa
13 | // All rights reserved.
14 | //
15 | // Redistribution and use in source and binary forms, with or without modification, are
16 | // permitted provided that the following conditions are met:
17 | //
18 | // - Redistributions of source code must retain the above copyright notice, this list
19 | // of conditions and the following disclaimer.
20 | //
21 | // - Redistributions in binary form must reproduce the above copyright notice, this list
22 | // of conditions and the following disclaimer in the documentation and/or other materials
23 | // provided with the distribution.
24 | //
25 | // - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
26 | // endorse or promote products derived from this software without specific prior written
27 | // permission.
28 | //
29 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
30 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31 | // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
32 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
35 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36 | // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | public class FastZipClass
39 | {
40 | enum Operation
41 | {
42 | Unknown,
43 | Create,
44 | Extract,
45 | List,
46 | Error
47 | };
48 |
49 | public static void ListZipFile(string fileName, string fileFilter, string directoryFilter)
50 | {
51 | using (ZipFile zipFile = new ZipFile(fileName))
52 | {
53 | PathFilter localFileFilter = new PathFilter(fileFilter);
54 | PathFilter localDirFilter = new PathFilter(directoryFilter);
55 |
56 | if (zipFile.Count == 0)
57 | {
58 | Console.WriteLine("No entries to list");
59 | }
60 | else
61 | {
62 | for (int i = 0; i < zipFile.Count; ++i)
63 | {
64 | ZipEntry e = zipFile[i];
65 | if (e.IsFile)
66 | {
67 | string path = Path.GetDirectoryName(e.Name);
68 | if (localDirFilter.IsMatch(path))
69 | {
70 | if (localFileFilter.IsMatch(Path.GetFileName(e.Name)))
71 | {
72 | Console.WriteLine(e.Name);
73 | }
74 | }
75 | }
76 | else if (e.IsDirectory)
77 | {
78 | if (localDirFilter.IsMatch(e.Name))
79 | {
80 | Console.WriteLine(e.Name);
81 | }
82 | }
83 | else
84 | {
85 | Console.WriteLine(e.Name);
86 | }
87 | }
88 | }
89 | }
90 | }
91 |
92 | public void ListFile(object sender, ScanEventArgs e)
93 | {
94 | Console.WriteLine("{0}", e.Name);
95 | }
96 |
97 | public void ListDir(object sender, DirectoryEventArgs e)
98 | {
99 | if (!e.HasMatchingFiles)
100 | {
101 | Console.WriteLine("Dir:{0}", e.Name);
102 | }
103 | }
104 |
105 | public void ListFileSystem(string directory, bool recurse, string fileFilter, string directoryFilter)
106 | {
107 | FileSystemScanner scanner = new FileSystemScanner(fileFilter, directoryFilter);
108 | scanner.ProcessDirectory += new ProcessDirectoryHandler(ListDir);
109 | scanner.ProcessFile += new ProcessFileHandler(ListFile);
110 | scanner.Scan(directory, recurse);
111 | }
112 |
113 | public void ShowProgress(object sender, ProgressEventArgs e)
114 | {
115 | // Very ugly but this is a sample!
116 | Console.WriteLine("{0}%", e.PercentComplete);
117 | }
118 |
119 | public void ProcessFile(object sender, ScanEventArgs e)
120 | {
121 | Console.WriteLine(e.Name);
122 | }
123 |
124 | public void ProcessDirectory(object sender, DirectoryEventArgs e)
125 | {
126 | if (!e.HasMatchingFiles)
127 | {
128 | Console.WriteLine(e.Name);
129 | }
130 | }
131 |
132 | public bool ConfirmOverwrite(string file)
133 | {
134 | Console.WriteLine("Overwrite file {0} Y/N", file);
135 | string yesNo = Console.ReadLine();
136 | return (yesNo != null) && string.Compare(yesNo.Trim(), "y", true) == 0;
137 | }
138 |
139 | public void Run(string[] args)
140 | {
141 | bool recurse = false;
142 | string arg1 = null;
143 | string arg2 = null;
144 | string fileFilter = null;
145 | string dirFilter = null;
146 | bool verbose = false;
147 | bool restoreDates = false;
148 | bool restoreAttributes = false;
149 | bool progress = false;
150 | TimeSpan interval = TimeSpan.FromSeconds(1);
151 |
152 | bool createEmptyDirs = false;
153 | FastZip.Overwrite overwrite = FastZip.Overwrite.Always;
154 | FastZip.ConfirmOverwriteDelegate confirmOverwrite = null;
155 |
156 | Operation op = Operation.Unknown;
157 | int argCount = 0;
158 |
159 | for (int i = 0; i < args.Length; ++i)
160 | {
161 | if (args[i][0] == '-')
162 | {
163 | string option = args[i].Substring(1).ToLower();
164 | string optArg = "";
165 |
166 | int parameterIndex = option.IndexOf('=');
167 |
168 | if (parameterIndex >= 0)
169 | {
170 | if (parameterIndex < option.Length - 1)
171 | {
172 | optArg = option.Substring(parameterIndex + 1);
173 | }
174 | option = option.Substring(0, parameterIndex);
175 | }
176 |
177 | switch (option)
178 | {
179 | case "e":
180 | case "empty":
181 | createEmptyDirs = true;
182 | break;
183 |
184 | case "x":
185 | case "extract":
186 | if (op == Operation.Unknown)
187 | {
188 | op = Operation.Extract;
189 | }
190 | else
191 | {
192 | Console.WriteLine("Only one operation at a time is permitted");
193 | op = Operation.Error;
194 | }
195 | break;
196 |
197 | case "c":
198 | case "create":
199 | if (op == Operation.Unknown)
200 | {
201 | op = Operation.Create;
202 | }
203 | else
204 | {
205 | Console.WriteLine("Only one operation at a time is permitted");
206 | op = Operation.Error;
207 | }
208 | break;
209 |
210 | case "l":
211 | case "list":
212 | if (op == Operation.Unknown)
213 | {
214 | op = Operation.List;
215 | }
216 | else
217 | {
218 | Console.WriteLine("Only one operation at a time is permitted");
219 | op = Operation.Error;
220 | }
221 | break;
222 |
223 |
224 | case "p":
225 | case "progress":
226 | progress = true;
227 | verbose = true;
228 | break;
229 |
230 | case "r":
231 | case "recurse":
232 | recurse = true;
233 | break;
234 |
235 | case "v":
236 | case "verbose":
237 | verbose = true;
238 | break;
239 |
240 | case "i":
241 | if (optArg.Length > 0)
242 | {
243 | interval = TimeSpan.FromSeconds(int.Parse(optArg));
244 | }
245 | break;
246 |
247 | case "file":
248 | if (NameFilter.IsValidFilterExpression(optArg))
249 | {
250 | fileFilter = optArg;
251 | }
252 | else
253 | {
254 | Console.WriteLine("File filter expression contains an invalid regular expression");
255 | op = Operation.Error;
256 | }
257 | break;
258 |
259 | case "dir":
260 | if (NameFilter.IsValidFilterExpression(optArg))
261 | {
262 | dirFilter = optArg;
263 | }
264 | else
265 | {
266 | Console.WriteLine("Path filter expression contains an invalid regular expression");
267 | op = Operation.Error;
268 | }
269 | break;
270 |
271 | case "o":
272 | case "overwrite":
273 | switch (optArg)
274 | {
275 | case "always":
276 | overwrite = FastZip.Overwrite.Always;
277 | confirmOverwrite = null;
278 | break;
279 |
280 | case "never":
281 | overwrite = FastZip.Overwrite.Never;
282 | confirmOverwrite = null;
283 | break;
284 |
285 | case "prompt":
286 | overwrite = FastZip.Overwrite.Prompt;
287 | confirmOverwrite = new FastZip.ConfirmOverwriteDelegate(ConfirmOverwrite);
288 | break;
289 |
290 | default:
291 | Console.WriteLine("Invalid overwrite option");
292 | op = Operation.Error;
293 | break;
294 | }
295 | break;
296 |
297 | case "oa":
298 | restoreAttributes = true;
299 | break;
300 |
301 | case "od":
302 | restoreDates = true;
303 | break;
304 |
305 | default:
306 | Console.WriteLine("Unknown option {0}", args[i]);
307 | op = Operation.Error;
308 | break;
309 | }
310 | }
311 | else if (arg1 == null)
312 | {
313 | arg1 = args[i];
314 | ++argCount;
315 | }
316 | else if (arg2 == null)
317 | {
318 | arg2 = args[i];
319 | ++argCount;
320 | }
321 | }
322 |
323 | FastZipEvents events = null;
324 |
325 | if (verbose)
326 | {
327 | events = new FastZipEvents();
328 | events.ProcessDirectory = new ProcessDirectoryHandler(ProcessDirectory);
329 | events.ProcessFile = new ProcessFileHandler(ProcessFile);
330 |
331 | if (progress)
332 | {
333 | events.Progress = new ProgressHandler(ShowProgress);
334 | events.ProgressInterval = interval;
335 | }
336 | }
337 |
338 | FastZip fastZip = new FastZip(events);
339 | fastZip.CreateEmptyDirectories = createEmptyDirs;
340 | fastZip.RestoreAttributesOnExtract = restoreAttributes;
341 | fastZip.RestoreDateTimeOnExtract = restoreDates;
342 |
343 | switch (op)
344 | {
345 | case Operation.Create:
346 | if (argCount == 2)
347 | {
348 | Console.WriteLine("Creating Zip");
349 |
350 | fastZip.CreateZip(arg1, arg2, recurse, fileFilter, dirFilter);
351 | }
352 | else
353 | Console.WriteLine("Invalid arguments");
354 | break;
355 |
356 | case Operation.Extract:
357 | if (argCount == 2)
358 | {
359 | Console.WriteLine("Extracting Zip");
360 | fastZip.ExtractZip(arg1, arg2, overwrite, confirmOverwrite, fileFilter, dirFilter, restoreDates);
361 | }
362 | else
363 | Console.WriteLine("zipfile and target directory not specified");
364 | break;
365 |
366 | case Operation.List:
367 | if (File.Exists(arg1))
368 | {
369 | ListZipFile(arg1, fileFilter, dirFilter);
370 | }
371 | else if (Directory.Exists(arg1))
372 | {
373 | ListFileSystem(arg1, recurse, fileFilter, dirFilter);
374 | }
375 | else
376 | {
377 | Console.WriteLine("No valid list file or directory");
378 | }
379 | break;
380 |
381 | case Operation.Unknown:
382 | Console.WriteLine(
383 | "FastZip v0.5\n"
384 | + " Usage: FastZip {options} operation args\n"
385 | + "Operation Options: (only one permitted)\n"
386 | + " -x zipfile targetdir : Extract files from Zip\n"
387 | + " -c zipfile sourcedir : Create zip file\n"
388 | + " -l zipfile|dir : List elements\n"
389 | + "\n"
390 | + "Behavioural options:\n"
391 | + " -dir={dirFilter}\n"
392 | + " -file={fileFilter}\n"
393 | + " -e Process empty directories\n"
394 | + " -i Progress interval in seconds\n"
395 | + " -p Show file progress\n"
396 | + " -r Recurse directories\n"
397 | + " -v Verbose output\n"
398 | + " -oa Restore file attributes on extract\n"
399 | + " -ot Restore file date time on extract\n"
400 | + " -overwrite=prompt|always|never : Overwrite on extract handling\n"
401 | );
402 | break;
403 |
404 | case Operation.Error:
405 | // Do nothing for now...
406 | break;
407 | }
408 | }
409 | }
410 | public static class FastZipProgram
411 | {
412 |
413 | ///
414 | /// Main entry point for FastZip sample.
415 | ///
416 | /// The arguments provided to this process.
417 | public static void Exec(string[] args)
418 | {
419 | FastZipClass main = new FastZipClass();
420 | main.Run(args);
421 | }
422 | }
423 | }
424 |
425 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSE:
--------------------------------------------------------------------------------
1 | The Windows Glitch Harvester and Netcore2 are licensed under the MIT License
2 |
3 | Copyright 2018 Redscientist Media
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/Ceras License.txt:
--------------------------------------------------------------------------------
1 | The following license applies to the Ceras serialization library used within Netcore. You can find Ceras here https://github.com/rikimaru0345/Ceras
2 |
3 | The MIT License (MIT)
4 |
5 | Copyright (c) 2019 rikimaru0345
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/DISCLAIMER.TXT:
--------------------------------------------------------------------------------
1 | Welcome to the Windows Glitch Harvester
2 | THIS PROGRAM IS IN ALPHA
3 | Version [ver]
4 |
5 | Disclaimer:
6 | This program comes with absolutely ZERO warranty.
7 | You may use it at your own risk.
8 |
9 | The Windows Glitch Harvester is distributed under an MIT Licence. Source is available at https://github.com/ircluzar/RTC3
10 |
11 | Known facts(and warnings):
12 | - Can cause irreparable damage to your data if misused (e.g. corrupting core Windows files)
13 | - Can cause windows to BSOD (extremely rarely)
14 | - Can write a significant amount of data to your hard drive depending on usage
15 |
16 | You can download the latest version of Dolphin Narry's Mod at
17 | https://github.com/narryg/dolphin/releases
18 |
19 | This message only appears once.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/DOLPHINWARNING.TXT:
--------------------------------------------------------------------------------
1 | To utilize Target Dolphin, you need a special build of Dolphin.
2 |
3 | You can download the latest version of Dolphin Narry's Mod from the RTC Launcher.
4 |
5 | This message only appears once.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/LICENSE:
--------------------------------------------------------------------------------
1 | The Windows Glitch Harvester and Netcore2 are licensed under the MIT License
2 |
3 | Copyright 2018 Redscientist Media
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/Netcore+Vanguard+WGH License.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Dan Barreiro & Phil Girard
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/Newtonsoft Json License.txt:
--------------------------------------------------------------------------------
1 | The following license applies to the Ceras serialization library used within Netcore. You can find Ceras here https://github.com/rikimaru0345/Ceras
2 |
3 | The MIT License (MIT)
4 |
5 | Copyright (c) 2019 rikimaru0345
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/LICENSES/SevenZip License.txt:
--------------------------------------------------------------------------------
1 | 7-Zip source code
2 | ~~~~~~~~~~~~~~~~~
3 | License for use and distribution
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | 7-Zip Copyright (C) 1999-2018 Igor Pavlov.
7 |
8 | The licenses for files are:
9 |
10 | 1) CPP/7zip/Compress/Rar* files: the "GNU LGPL" with "unRAR license restriction"
11 | 2) CPP/7zip/Compress/LzfseDecoder.cpp: the "BSD 3-clause License"
12 | 3) Some files are "public domain" files, if "public domain" status is stated in source file.
13 | 4) the "GNU LGPL" for all other files. If there is no license information in
14 | some source file, that file is under the "GNU LGPL".
15 |
16 | The "GNU LGPL" with "unRAR license restriction" means that you must follow both
17 | "GNU LGPL" rules and "unRAR license restriction" rules.
18 |
19 |
20 |
21 |
22 | GNU LGPL information
23 | --------------------
24 |
25 | This library is free software; you can redistribute it and/or
26 | modify it under the terms of the GNU Lesser General Public
27 | License as published by the Free Software Foundation; either
28 | version 2.1 of the License, or (at your option) any later version.
29 |
30 | This library is distributed in the hope that it will be useful,
31 | but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33 | Lesser General Public License for more details.
34 |
35 | You should have received a copy of the GNU Lesser General Public
36 | License along with this library; if not, write to the Free Software
37 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 |
39 |
40 |
41 |
42 | BSD 3-clause License
43 | --------------------
44 |
45 | The "BSD 3-clause License" is used for the code in LzfseDecoder.cpp that implements LZFSE data decompression.
46 | That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
47 | that also uses the "BSD 3-clause License":
48 |
49 | ----
50 | Copyright (c) 2015-2016, Apple Inc. All rights reserved.
51 |
52 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
53 |
54 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
55 |
56 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
57 | in the documentation and/or other materials provided with the distribution.
58 |
59 | 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
60 | from this software without specific prior written permission.
61 |
62 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
64 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
65 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
67 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68 | ----
69 |
70 |
71 |
72 |
73 | unRAR license restriction
74 | -------------------------
75 |
76 | The decompression engine for RAR archives was developed using source
77 | code of unRAR program.
78 | All copyrights to original unRAR code are owned by Alexander Roshal.
79 |
80 | The license for original unRAR code has the following restriction:
81 |
82 | The unRAR sources cannot be used to re-create the RAR compression algorithm,
83 | which is proprietary. Distribution of modified unRAR sources in separate form
84 | or as a part of other software is permitted, provided that it is clearly
85 | stated in the documentation and source comments that the code may
86 | not be used to develop a RAR (WinRAR) compatible archiver.
87 |
88 |
89 | --
90 | Igor Pavlov
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace WindowsGlitchHarvester
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// The main entry point for the application.
11 | ///
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Application.Run(new WGH_MainForm());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WGH Legacy edition")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WGH Legacy edition")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3e59fb86-7a25-4310-a62a-97de5aa32528")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WindowsGlitchHarvester.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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 | /// Returns the cached ResourceManager instance used by this class.
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("WindowsGlitchHarvester.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
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 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap logortc {
67 | get {
68 | object obj = ResourceManager.GetObject("logortc", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/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\logortc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WindowsGlitchHarvester.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.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 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
48 |
55 |
56 |
70 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/Resources/logortc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/WindowsGlitchHarvester/Resources/logortc.png
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/VanguardForWindowsFiles.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {3E59FB86-7A25-4310-A62A-97DE5AA32528}
8 | WinExe
9 | Properties
10 | WindowsGlitchHarvester
11 | WindowsGlitchHarvester
12 | v4.7.1
13 | 512
14 | false
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | true
29 |
30 |
31 |
32 | AnyCPU
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 | true
41 | false
42 | true
43 |
44 |
45 | AnyCPU
46 | pdbonly
47 | true
48 | bin\Release\
49 | TRACE
50 | prompt
51 | 4
52 | true
53 | false
54 |
55 |
56 | logo.ico
57 |
58 |
59 | false
60 |
61 |
62 | WGH.pfx
63 |
64 |
65 | LocalIntranet
66 |
67 |
68 | false
69 |
70 |
71 | Properties\app.manifest
72 |
73 |
74 | false
75 |
76 |
77 | 90334B4EC89844575D6ECBC3DC830C20ADEC429C
78 |
79 |
80 | WindowsGlitchHarvester_TemporaryKey.pfx
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | ..\..\RTCV\Build\UI.dll
93 |
94 |
95 |
96 |
97 | Form
98 |
99 |
100 | WGH_TestForm.cs
101 |
102 |
103 |
104 | Form
105 |
106 |
107 | WGH_Progress.cs
108 |
109 |
110 |
111 | True
112 | True
113 | Resources.resx
114 |
115 |
116 | Form
117 |
118 |
119 | WGH_AutoCorruptForm.cs
120 |
121 |
122 | Form
123 |
124 |
125 | WGH_BlastEditorForm.cs
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | Form
134 |
135 |
136 | WGH_MainForm.cs
137 |
138 |
139 |
140 |
141 | Component
142 |
143 |
144 |
145 | WGH_HookToProcess.cs
146 |
147 |
148 | Form
149 |
150 |
151 | WGH_SelectMultiple.cs
152 |
153 |
154 |
155 | WGH_AutoCorruptForm.cs
156 | Designer
157 |
158 |
159 | WGH_BlastEditorForm.cs
160 |
161 |
162 | WGH_MainForm.cs
163 |
164 |
165 | ResXFileCodeGenerator
166 | Designer
167 | Resources.Designer.cs
168 |
169 |
170 | WGH_HookToProcess.cs
171 |
172 |
173 | WGH_Progress.cs
174 |
175 |
176 | WGH_SelectMultiple.cs
177 |
178 |
179 | WGH_TestForm.cs
180 |
181 |
182 |
183 | SettingsSingleFileGenerator
184 | Settings.Designer.cs
185 |
186 |
187 | True
188 | Settings.settings
189 | True
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 | False
203 | Microsoft .NET Framework 4.5 %28x86 and x64%29
204 | true
205 |
206 |
207 | False
208 | .NET Framework 3.5 SP1
209 | false
210 |
211 |
212 |
213 |
214 | 4.0.37
215 |
216 |
217 | 12.0.1
218 |
219 |
220 |
221 |
228 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/VanguardForWindowsFiles.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/redscientistlabs/WGH/3e6ab19fab674e00bf4b413127a450d8b343107f/WindowsGlitchHarvester/WGH.pfx
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_BlastEditorForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Globalization;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace WindowsGlitchHarvester
11 | {
12 | public partial class WGH_BlastEditorForm : Form
13 | {
14 | StashKey sk = null;
15 |
16 | public WGH_BlastEditorForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | public void LoadStashkey(StashKey _sk)
22 | {
23 | if (_sk == null)
24 | return;
25 |
26 | //lbBlastLayer.Items.Clear();
27 | sk = (StashKey)_sk.Clone();
28 |
29 | lbBlastLayer.DataSource = sk.BlastLayer.Layer;
30 |
31 | //foreach (var item in sk.blastlayer.Layer)
32 | // lbBlastLayer.Items.Add(item);
33 | RefreshBlastLayer();
34 | this.Show();
35 | }
36 |
37 | public void RefreshBlastLayer()
38 | {
39 | lbBlastLayer.DataSource = null;
40 | lbBlastLayer.DataSource = sk.BlastLayer.Layer;
41 | lbBlastLayerSize.Text = "BlastLayer size: " + sk.BlastLayer.Layer.Count.ToString();
42 | }
43 |
44 | private void btnDisable50_Click(object sender, EventArgs e)
45 | {
46 | foreach (BlastUnit bu in sk.BlastLayer.Layer)
47 | bu.IsEnabled = true;
48 |
49 | List unsortedList = new List(sk.BlastLayer.Layer.ToArray());
50 | List randomizedList = new List();
51 |
52 | while (unsortedList.Count>0)
53 | {
54 | int randomPick = WGH_Core.RND.Next(unsortedList.Count);
55 | BlastUnit bu = unsortedList[randomPick];
56 | unsortedList.RemoveAt(randomPick);
57 | randomizedList.Add(bu);
58 | }
59 |
60 | List halfList = randomizedList.GetRange(0, (randomizedList.Count / 2));
61 |
62 | foreach (BlastUnit bu in halfList)
63 | bu.IsEnabled = false;
64 |
65 | RefreshBlastLayer();
66 | }
67 |
68 | private void btnRemoveDisabled_Click(object sender, EventArgs e)
69 | {
70 | List newLayer = new List();
71 |
72 | foreach (BlastUnit bu in sk.BlastLayer.Layer)
73 | if (bu.IsEnabled)
74 | newLayer.Add(bu);
75 |
76 | sk.BlastLayer.Layer = newLayer;
77 |
78 | RefreshBlastLayer();
79 | }
80 |
81 | private void btnLoadCorrupt_Click(object sender, EventArgs e)
82 | {
83 | BlastLayer bl = new BlastLayer();
84 |
85 | foreach (var item in lbBlastLayer.Items)
86 | {
87 | BlastUnit bu = (item as BlastUnit);
88 | if (bu.IsEnabled)
89 | bl.Layer.Add(bu);
90 | }
91 |
92 | StashKey newSk = (StashKey)sk.Clone();
93 |
94 | newSk.BlastLayer = bl;
95 | WGH_Core.RestoreTarget();
96 | newSk.Run();
97 | WGH_Executor.Execute();
98 | }
99 | /*
100 | private void btnCorrupt_Click(object sender, EventArgs e)
101 | {
102 | BlastLayer bl = new BlastLayer();
103 |
104 | foreach (var item in lbBlastLayer.Items)
105 | {
106 | BlastUnit bu = (item as BlastUnit);
107 | if (bu.IsEnabled)
108 | bl.Layer.Add(bu);
109 | }
110 |
111 | WGH_Core.RestoreTarget();
112 | bl.Apply();
113 | }*/
114 |
115 | private void btnSendToStash_Click(object sender, EventArgs e)
116 | {
117 | StashKey newSk = (StashKey)sk.Clone();
118 | newSk.Key = WGH_Core.GetRandomKey();
119 | newSk.Alias = null;
120 |
121 | WGH_Core.ghForm.DontLoadSelectedStash = true;
122 | WGH_Core.ghForm.lbStashHistory.Items.Add(newSk);
123 | WGH_Core.ghForm.RefreshStashHistory();
124 | // WGH_Core.ghForm.lbStashHistory.Items.Add(WGH_Core.currentStashkey);
125 | WGH_Core.ghForm.lbStockpile.ClearSelected();
126 | WGH_Core.ghForm.lbStashHistory.ClearSelected();
127 | WGH_Core.ghForm.lbStashHistory.SelectedIndex = WGH_Core.ghForm.lbStashHistory.Items.Count - 1;
128 |
129 | GC.Collect();
130 | GC.WaitForPendingFinalizers();
131 | }
132 |
133 | private void lbBlastLayer_MouseDoubleClick(object sender, MouseEventArgs e)
134 | {
135 | if (lbBlastLayer.SelectedIndex == -1)
136 | return;
137 |
138 | (lbBlastLayer.SelectedItem as BlastUnit).IsEnabled = !(lbBlastLayer.SelectedItem as BlastUnit).IsEnabled;
139 |
140 | RefreshBlastLayer();
141 | }
142 |
143 | private void btnInvertDisabled_Click(object sender, EventArgs e)
144 | {
145 | for (int i = 0; i < sk.BlastLayer.Layer.Count; i++)
146 | sk.BlastLayer.Layer[i].IsEnabled = !sk.BlastLayer.Layer[i].IsEnabled;
147 |
148 | RefreshBlastLayer();
149 | }
150 |
151 | private void lbBlastLayer_SelectedIndexChanged(object sender, EventArgs e)
152 | {
153 | gbAddressEdit.Visible = false;
154 | gbValueEdit.Visible = false;
155 |
156 | lbAddressEdit.Text = "Address Edit:";
157 | lbValueEdit.Text = "Value Edit:";
158 |
159 | if (lbBlastLayer.SelectedIndex == -1)
160 | return;
161 |
162 | if (lbBlastLayer.SelectedItem is BlastByte)
163 | {
164 | gbAddressEdit.Visible = true;
165 | gbValueEdit.Visible = true;
166 | nmAddressEdit.Value = (lbBlastLayer.SelectedItem as BlastByte).Address;
167 | nmValueEdit.Value = (lbBlastLayer.SelectedItem as BlastByte).Value;
168 | }
169 | /*
170 | else if (lbBlastLayer.SelectedItem is BlastCheat)
171 | {
172 | gbAddressEdit.Visible = true;
173 | nmAddressEdit.Value = (lbBlastLayer.SelectedItem as BlastCheat).Address;
174 | if (!(lbBlastLayer.SelectedItem as BlastCheat).IsFreeze)
175 | {
176 | gbValueEdit.Visible = true;
177 | nmValueEdit.Value = (lbBlastLayer.SelectedItem as BlastCheat).Value;
178 | }
179 | }
180 | else if (lbBlastLayer.SelectedItem is BlastPipe)
181 | {
182 | lbAddressEdit.Text = "Address Edit:";
183 | lbValueEdit.Text = "PipeAddress Edit:";
184 |
185 | gbAddressEdit.Visible = true;
186 | gbValueEdit.Visible = true;
187 | nmAddressEdit.Value = (lbBlastLayer.SelectedItem as BlastPipe).Address;
188 | nmValueEdit.Value = (lbBlastLayer.SelectedItem as BlastPipe).PipeAddress;
189 | }
190 | */
191 | }
192 |
193 | private void btnAdressUpdate_Click(object sender, EventArgs e)
194 | {
195 | if (lbBlastLayer.SelectedItem is BlastByte)
196 | (lbBlastLayer.SelectedItem as BlastByte).Address = Convert.ToInt64(nmAddressEdit.Value);
197 | /*
198 | else if (lbBlastLayer.SelectedItem is BlastCheat)
199 | (lbBlastLayer.SelectedItem as BlastCheat).Address = Convert.ToInt64(nmAddressEdit.Value);
200 | else if (lbBlastLayer.SelectedItem is BlastPipe)
201 | (lbBlastLayer.SelectedItem as BlastPipe).Address = Convert.ToInt64(nmAddressEdit.Value);
202 | */
203 |
204 | RefreshBlastLayer();
205 | }
206 |
207 | private void btnValueUpdate_Click(object sender, EventArgs e)
208 | {
209 | if (lbBlastLayer.SelectedItem is BlastByte)
210 | (lbBlastLayer.SelectedItem as BlastByte).Value = Convert.ToInt32(nmValueEdit.Value);
211 | /*
212 | else if (lbBlastLayer.SelectedItem is BlastCheat)
213 | (lbBlastLayer.SelectedItem as BlastCheat).Value = Convert.ToInt32(nmValueEdit.Value);
214 | else if (lbBlastLayer.SelectedItem is BlastPipe)
215 | (lbBlastLayer.SelectedItem as BlastPipe).PipeAddress = Convert.ToInt64(nmValueEdit.Value);
216 | */
217 |
218 | RefreshBlastLayer();
219 | }
220 |
221 | private void btnDisableEverything_Click(object sender, EventArgs e)
222 | {
223 | foreach (BlastUnit bu in sk.BlastLayer.Layer)
224 | bu.IsEnabled = false;
225 |
226 | RefreshBlastLayer();
227 | }
228 |
229 | private void btnEnableEverything_Click(object sender, EventArgs e)
230 | {
231 | foreach (BlastUnit bu in sk.BlastLayer.Layer)
232 | bu.IsEnabled = true;
233 |
234 | RefreshBlastLayer();
235 | }
236 |
237 | public DialogResult getInputBox(string title, string promptText, ref string value)
238 | {
239 | Form form = new Form();
240 | Label label = new Label();
241 | TextBox textBox = new TextBox();
242 | Button buttonOk = new Button();
243 | Button buttonCancel = new Button();
244 |
245 | form.Text = title;
246 | label.Text = promptText;
247 | textBox.Text = value;
248 |
249 | buttonOk.Text = "OK";
250 | buttonCancel.Text = "Cancel";
251 | buttonOk.DialogResult = DialogResult.OK;
252 | buttonCancel.DialogResult = DialogResult.Cancel;
253 |
254 | label.SetBounds(9, 20, 372, 13);
255 | textBox.SetBounds(12, 36, 372, 20);
256 | buttonOk.SetBounds(228, 72, 75, 23);
257 | buttonCancel.SetBounds(309, 72, 75, 23);
258 |
259 | label.AutoSize = true;
260 | textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
261 | buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
262 | buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
263 |
264 | form.ClientSize = new Size(396, 107);
265 | form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
266 | form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
267 | form.FormBorderStyle = FormBorderStyle.FixedDialog;
268 | form.StartPosition = FormStartPosition.CenterScreen;
269 | form.MinimizeBox = false;
270 | form.MaximizeBox = false;
271 | form.AcceptButton = buttonOk;
272 | form.CancelButton = buttonCancel;
273 |
274 | DialogResult dialogResult = form.ShowDialog();
275 | value = textBox.Text;
276 | return dialogResult;
277 | }
278 |
279 |
280 | private void nmAddressEdit_MouseDown(object sender, MouseEventArgs e)
281 | {
282 | if (e.Button == MouseButtons.Right)
283 | {
284 | Point locate = new Point((sender as Control).Location.X + e.Location.X + gbAddressEdit.Location.X, (sender as Control).Location.Y + e.Location.Y + gbAddressEdit.Location.Y);
285 |
286 | ContextMenuStrip columnsMenu = new ContextMenuStrip();
287 | columnsMenu.Items.Add("Import from Hex", null, new EventHandler((ob, ev) =>
288 | {
289 | string value = "";
290 | if (this.getInputBox("Import from Hex", "Enter Hexadecimal number:", ref value) == DialogResult.OK)
291 | {
292 | int newValue = int.Parse(value, NumberStyles.HexNumber);
293 | nmAddressEdit.Value = Convert.ToDecimal(newValue);
294 | }
295 | }));
296 | columnsMenu.Show(this, locate);
297 | }
298 | }
299 |
300 | private void nmValueEdit_MouseDown(object sender, MouseEventArgs e)
301 | {
302 | if (e.Button == MouseButtons.Right)
303 | {
304 | Point locate = new Point((sender as Control).Location.X + e.Location.X + gbValueEdit.Location.X, (sender as Control).Location.Y + e.Location.Y + gbValueEdit.Location.Y);
305 |
306 | ContextMenuStrip columnsMenu = new ContextMenuStrip();
307 | columnsMenu.Items.Add("Import from Hex", null, new EventHandler((ob, ev) =>
308 | {
309 | string value = "";
310 | if (this.getInputBox("Import from Hex", "Enter Hexadecimal number:", ref value) == DialogResult.OK)
311 | {
312 | int newValue = int.Parse(value, NumberStyles.HexNumber);
313 | nmValueEdit.Value = Convert.ToDecimal(newValue);
314 | }
315 | }));
316 | columnsMenu.Show(this, locate);
317 | }
318 | }
319 |
320 | private void RTC_BlastEditorForm_Load(object sender, EventArgs e)
321 | {
322 | ContextMenu contextMenu = new ContextMenu();
323 | this.nmAddressEdit.ContextMenu = contextMenu;
324 | this.nmValueEdit.ContextMenu = contextMenu;
325 | }
326 |
327 | private void btnDuplicateSelected_Click(object sender, EventArgs e)
328 | {
329 | if (lbBlastLayer.SelectedIndex == -1)
330 | {
331 | MessageBox.Show("No unit was selected. Cannot duplicate.");
332 | return;
333 | }
334 |
335 | int pos = lbBlastLayer.SelectedIndex;
336 |
337 | BlastUnit bu = sk.BlastLayer.Layer[pos];
338 | BlastUnit bu2 = ObjectCopier.Clone(bu);
339 | sk.BlastLayer.Layer.Insert(pos, bu2);
340 |
341 |
342 | RefreshBlastLayer();
343 | }
344 |
345 | private void btnSanitizeDuplicates_Click(object sender, EventArgs e)
346 | {
347 | var arr = sk.BlastLayer.Layer.ToArray();
348 | Array.Reverse(arr);
349 | List bul = new List(arr);
350 | List usedAddresses = new List();
351 | //This is bad but I'm not refactoring blastunit right now to do it cleaner -Narry
352 | foreach (BlastUnit bu in bul)
353 | {
354 | var bb = (bu as BlastByte);
355 | var bv = (bu as BlastVector);
356 |
357 | if(bb != null)
358 | {
359 | if (!usedAddresses.Contains(bb.Address))
360 | usedAddresses.Add(bb.Address);
361 | else
362 | sk.BlastLayer.Layer.Remove(bu);
363 | }
364 | else if (bv != null)
365 | {
366 | if (!usedAddresses.Contains(bv.Address))
367 | usedAddresses.Add(bv.Address);
368 | else
369 | sk.BlastLayer.Layer.Remove(bv);
370 | }
371 | }
372 | RefreshBlastLayer();
373 |
374 | }
375 |
376 | private void button1_Click(object sender, EventArgs e)
377 | {
378 |
379 | }
380 | }
381 | }
382 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_BlastEditorForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_Enums.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WindowsGlitchHarvester
6 | {
7 | public enum BlastRadius
8 | {
9 | SPREAD,
10 | CHUNK,
11 | BURST,
12 | NONE
13 | }
14 |
15 | public enum BlastByteType
16 | {
17 | SET,
18 | ADD,
19 | SUBSTRACT,
20 | NONE
21 | }
22 |
23 | public enum BlastByteAlgo
24 | {
25 | RANDOM,
26 | RANDOMTILT,
27 | TILT,
28 | NONE
29 | }
30 |
31 | public enum CorruptionEngine
32 | {
33 | NIGHTMARE,
34 | VECTOR,
35 | NONE
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_Executor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Text;
6 | using System.Windows.Forms;
7 |
8 | namespace WindowsGlitchHarvester
9 | {
10 | static class WGH_Executor
11 | {
12 | public static string otherProgram = null;
13 | public static string script = null;
14 |
15 | public static void EditExec()
16 | {
17 | var gh = WGH_Core.ghForm;
18 |
19 | if (gh.rbExecuteOtherProgram.Checked || gh.rbExecuteWith.Checked)
20 | {
21 | OpenFileDialog OpenFileDialog1;
22 | OpenFileDialog1 = new OpenFileDialog();
23 |
24 | OpenFileDialog1.Title = "Open File";
25 | OpenFileDialog1.Filter = "files|*.*";
26 | OpenFileDialog1.RestoreDirectory = true;
27 | if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
28 | {
29 | if (OpenFileDialog1.FileName.ToString().Contains("^"))
30 | {
31 | MessageBox.Show("You can't use a file that contains the character ^ ");
32 | return;
33 | }
34 |
35 | otherProgram = OpenFileDialog1.FileName.ToString();
36 | }
37 | else
38 | return;
39 | }
40 |
41 |
42 | RefreshLabel();
43 |
44 | }
45 |
46 | public static void Execute()
47 | {
48 | var gh = WGH_Core.ghForm;
49 |
50 | //Hijack no execution for the Netcore executor
51 | if (gh.rbNoExecution.Checked)
52 | {
53 |
54 | }
55 | else if (gh.rbExecuteCorruptedFile.Checked)
56 | {
57 | if (WGH_Core.currentTargetType == "File")
58 | {
59 | var fi = (FileInterface)WGH_Core.currentMemoryInterface;
60 | //Process.Start(fi.filename);
61 |
62 | string fullPath = fi.Filename;
63 | ProcessStartInfo psi = new ProcessStartInfo();
64 | psi.FileName = Path.GetFileName(fullPath);
65 | psi.WorkingDirectory = Path.GetDirectoryName(fullPath);
66 | //psi.Arguments = "p1=hardCodedv1 p2=" + MakeParameter();
67 | Process.Start(psi);
68 | }
69 | else
70 | return;
71 |
72 | }
73 | else if (gh.rbExecuteWith.Checked)
74 | {
75 | if (otherProgram != null)
76 | {
77 | var fi = (FileInterface)WGH_Core.currentMemoryInterface;
78 | //Process.Start(otherProgram, "\"" + fi.filename + "\"");
79 |
80 | string fullPath = otherProgram;
81 | ProcessStartInfo psi = new ProcessStartInfo();
82 | psi.FileName = Path.GetFileName(fullPath);
83 | psi.WorkingDirectory = Path.GetDirectoryName(fullPath);
84 | psi.Arguments = "\"" + fi.Filename + "\"";
85 | Process.Start(psi);
86 |
87 | }
88 | else
89 | return;
90 | }
91 | else if (gh.rbExecuteOtherProgram.Checked)
92 | {
93 | if (otherProgram != null)
94 | {
95 |
96 | string fullPath = otherProgram;
97 | ProcessStartInfo psi = new ProcessStartInfo();
98 | psi.FileName = Path.GetFileName(fullPath);
99 | psi.WorkingDirectory = Path.GetDirectoryName(fullPath);
100 |
101 | if (!string.IsNullOrEmpty(WGH_Core.ghForm.tbArgs.Text?.Trim()))
102 | psi.Arguments = WGH_Core.ghForm.tbArgs.Text.Trim(); ;
103 |
104 | Process.Start(psi);
105 |
106 | }
107 | else
108 | return;
109 | }
110 | }
111 |
112 | public static void RefreshLabel()
113 | {
114 | var gh = WGH_Core.ghForm;
115 |
116 | gh.lbArgs.Visible = false;
117 | gh.tbArgs.Visible = false;
118 |
119 | if (gh.rbNoExecution.Checked)
120 | gh.lbExecution.Text = "No execution set";
121 | else if (gh.rbExecuteCorruptedFile.Checked)
122 | gh.lbExecution.Text = "The target file will be executed after corruption";
123 | else if (gh.rbExecuteWith.Checked)
124 | {
125 | if (otherProgram == null)
126 | {
127 | gh.lbExecution.Text = "No program selected for execution";
128 | }
129 | else
130 | {
131 | gh.lbExecution.Text = "Target will be executed using " + otherProgram.Substring(otherProgram.LastIndexOf('\\') + 1);
132 | }
133 | }
134 | else if (gh.rbExecuteOtherProgram.Checked)
135 | {
136 | gh.lbArgs.Visible = true;
137 | gh.tbArgs.Visible = true;
138 |
139 | if (otherProgram == null)
140 | {
141 | gh.lbExecution.Text = "No program selected for execution";
142 | }
143 | else
144 | {
145 | gh.lbExecution.Text = otherProgram.Substring(otherProgram.LastIndexOf('\\') + 1) + " will be executed after corruption";
146 | }
147 | }
148 |
149 |
150 |
151 | }
152 |
153 | }
154 |
155 |
156 | }
157 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_Extensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Runtime.Serialization;
5 | using System.Runtime.Serialization.Formatters.Binary;
6 | using System.Text;
7 |
8 | namespace System.Runtime.CompilerServices
9 | {
10 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
11 | | AttributeTargets.Method)]
12 | public sealed class ExtensionAttribute : Attribute { }
13 | }
14 |
15 | namespace WindowsGlitchHarvester
16 | {
17 | public static class WGH_Extensions
18 | {
19 | public static T[] SubArray(this T[] data, long index, long length)
20 | {
21 | T[] result = new T[length];
22 |
23 | if (data == null)
24 | return null;
25 |
26 |
27 | Array.Copy(data, index, result, 0, length);
28 | return result;
29 | }
30 |
31 | public static string ToBase64(this string str)
32 | {
33 | var bytes = Encoding.UTF8.GetBytes(str);
34 | return Convert.ToBase64String(bytes);
35 | }
36 |
37 | public static string FromBase64(this string base64)
38 | {
39 | var data = Convert.FromBase64String(base64);
40 | return Encoding.UTF8.GetString(data);
41 | }
42 |
43 | public static byte[] GetBytes(this string str)
44 | {
45 | byte[] bytes = new byte[str.Length * sizeof(char)];
46 | System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
47 | return bytes;
48 | }
49 | }
50 |
51 | ///
52 | /// Reference Article http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx
53 | /// Provides a method for performing a deep copy of an object.
54 | /// Binary Serialization is used to perform the copy.
55 | ///
56 | public static class ObjectCopier
57 | {
58 | ///
59 | /// Perform a deep Copy of the object.
60 | ///
61 | /// The type of object being copied.
62 | /// The object instance to copy.
63 | /// The copied object.
64 | public static T Clone(T source)
65 | {
66 | if (!typeof(T).IsSerializable)
67 | {
68 | throw new ArgumentException("The type must be serializable.", "source");
69 | }
70 |
71 | // Don't serialize a null object, simply return the default for that object
72 | if (Object.ReferenceEquals(source, null))
73 | {
74 | return default(T);
75 | }
76 |
77 | IFormatter formatter = new BinaryFormatter();
78 | Stream stream = new MemoryStream();
79 | using (stream)
80 | {
81 | formatter.Serialize(stream, source);
82 | stream.Seek(0, SeekOrigin.Begin);
83 | return (T)formatter.Deserialize(stream);
84 | }
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_HookToProcess.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | namespace WindowsGlitchHarvester
3 | {
4 |
5 | partial class WGH_HookProcessForm
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Windows Form Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WGH_HookProcessForm));
34 | this.lbProcesses = new System.Windows.Forms.ListBox();
35 | this.btnSendList = new System.Windows.Forms.Button();
36 | this.btnCancel = new System.Windows.Forms.Button();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.SuspendLayout();
39 | //
40 | // lbProcesses
41 | //
42 | this.lbProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
43 | | System.Windows.Forms.AnchorStyles.Left)
44 | | System.Windows.Forms.AnchorStyles.Right)));
45 | this.lbProcesses.BackColor = System.Drawing.Color.Black;
46 | this.lbProcesses.BorderStyle = System.Windows.Forms.BorderStyle.None;
47 | this.lbProcesses.Font = new System.Drawing.Font("Segoe UI", 8F);
48 | this.lbProcesses.ForeColor = System.Drawing.Color.White;
49 | this.lbProcesses.FormattingEnabled = true;
50 | this.lbProcesses.Location = new System.Drawing.Point(0, 0);
51 | this.lbProcesses.Name = "lbProcesses";
52 | this.lbProcesses.ScrollAlwaysVisible = true;
53 | this.lbProcesses.Size = new System.Drawing.Size(320, 429);
54 | this.lbProcesses.TabIndex = 0;
55 | //
56 | // btnSendList
57 | //
58 | this.btnSendList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
59 | this.btnSendList.BackColor = System.Drawing.Color.Black;
60 | this.btnSendList.FlatAppearance.BorderSize = 0;
61 | this.btnSendList.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
62 | this.btnSendList.Font = new System.Drawing.Font("Segoe UI", 8F);
63 | this.btnSendList.ForeColor = System.Drawing.Color.OrangeRed;
64 | this.btnSendList.Location = new System.Drawing.Point(106, 491);
65 | this.btnSendList.Name = "btnSendList";
66 | this.btnSendList.Size = new System.Drawing.Size(196, 23);
67 | this.btnSendList.TabIndex = 1;
68 | this.btnSendList.Text = "Hook Process to Glitch Harvester";
69 | this.btnSendList.UseVisualStyleBackColor = false;
70 | this.btnSendList.Click += new System.EventHandler(this.btnSendList_Click);
71 | //
72 | // btnCancel
73 | //
74 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
75 | this.btnCancel.BackColor = System.Drawing.Color.Black;
76 | this.btnCancel.FlatAppearance.BorderSize = 0;
77 | this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
78 | this.btnCancel.Font = new System.Drawing.Font("Segoe UI", 8F);
79 | this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
80 | this.btnCancel.Location = new System.Drawing.Point(12, 491);
81 | this.btnCancel.Name = "btnCancel";
82 | this.btnCancel.Size = new System.Drawing.Size(63, 23);
83 | this.btnCancel.TabIndex = 2;
84 | this.btnCancel.Text = "Cancel";
85 | this.btnCancel.UseVisualStyleBackColor = false;
86 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
87 | //
88 | // label1
89 | //
90 | this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
91 | this.label1.AutoSize = true;
92 | this.label1.Font = new System.Drawing.Font("Segoe UI", 8F);
93 | this.label1.ForeColor = System.Drawing.Color.White;
94 | this.label1.Location = new System.Drawing.Point(10, 440);
95 | this.label1.Name = "label1";
96 | this.label1.Size = new System.Drawing.Size(293, 39);
97 | this.label1.TabIndex = 3;
98 | this.label1.Text = "WARNING: Corrupting a game process with online \r\nfeatures can result in a ban. Bl" +
99 | "ock network access via \r\nthe Windows Firewall in the Control Panel (If necessary" +
100 | ")";
101 | //
102 | // WGH_HookProcessForm
103 | //
104 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
105 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
106 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
107 | this.ClientSize = new System.Drawing.Size(319, 521);
108 | this.Controls.Add(this.label1);
109 | this.Controls.Add(this.btnCancel);
110 | this.Controls.Add(this.btnSendList);
111 | this.Controls.Add(this.lbProcesses);
112 | this.Font = new System.Drawing.Font("Segoe UI", 8F);
113 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
114 | this.Name = "WGH_HookProcessForm";
115 | this.Text = "Select Process";
116 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WGH_SelectMultiple_FormClosing);
117 | this.Load += new System.EventHandler(this.WGH_HookToProcess_Load);
118 | this.ResumeLayout(false);
119 | this.PerformLayout();
120 |
121 | }
122 |
123 | #endregion
124 |
125 | private System.Windows.Forms.ListBox lbProcesses;
126 | private System.Windows.Forms.Button btnSendList;
127 | private System.Windows.Forms.Button btnCancel;
128 | private System.Windows.Forms.Label label1;
129 | }
130 | }
131 | */
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_HookToProcess.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Security;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.IO;
10 | using System.Diagnostics;
11 |
12 | /*
13 |
14 | namespace WindowsGlitchHarvester
15 | {
16 | public partial class WGH_HookProcessForm : Form
17 | {
18 | OpenFileDialog openFileDialog1 = new OpenFileDialog();
19 |
20 | public WGH_HookProcessForm()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void btnAddFiles_Click(object sender, EventArgs e)
26 | {
27 | DialogResult dr = this.openFileDialog1.ShowDialog();
28 | if (dr == System.Windows.Forms.DialogResult.OK)
29 | {
30 | // Read the files
31 | foreach (String file in openFileDialog1.FileNames)
32 | {
33 | lbProcesses.Items.Add(file);
34 | }
35 | }
36 | }
37 |
38 | private void btnAddFolder_Click(object sender, EventArgs e)
39 | {
40 | //thx http://stackoverflow.com/questions/11624298/how-to-use-openfiledialog-to-select-a-folder-how-to-reuse-rc-file-from-mfc-in
41 |
42 | FolderBrowserDialog fbd = new FolderBrowserDialog();
43 | DialogResult result = fbd.ShowDialog();
44 |
45 | List files = DirSearch(fbd.SelectedPath);
46 |
47 | lbProcesses.Items.AddRange(files.ToArray());
48 |
49 | }
50 |
51 | private List DirSearch(string sDir)
52 | {
53 | List files = new List();
54 | try
55 | {
56 | foreach (string f in Directory.GetFiles(sDir))
57 | {
58 | files.Add(f);
59 | }
60 | foreach (string d in Directory.GetDirectories(sDir))
61 | {
62 | files.AddRange(DirSearch(d));
63 | }
64 | }
65 | catch (System.Exception excpt)
66 | {
67 | MessageBox.Show(excpt.Message);
68 | }
69 |
70 | return files;
71 | }
72 |
73 | private void WGH_HookToProcess_Load(object sender, EventArgs e)
74 | {
75 | lbProcesses.Items.AddRange(Process.GetProcesses().Select(it => $"{it.ProcessName}:{it.Id}").OrderBy(x => x).ToArray());
76 |
77 | }
78 |
79 | private void InitializeOpenFileDialog()
80 | {
81 | //thanks: http://stackoverflow.com/questions/1311578/opening-multiple-files-openfiledialog-c
82 |
83 |
84 | // Set the file dialog to filter for graphics files.
85 | this.openFileDialog1.Filter =
86 | "All files (*.*)|*.*";
87 |
88 | // Allow the user to select multiple images.
89 | this.openFileDialog1.Multiselect = true;
90 | // ^ ^ ^ ^ ^ ^ ^
91 |
92 | this.openFileDialog1.Title = "Add File(s)";
93 | }
94 |
95 | private void btnRemoveSelected_Click(object sender, EventArgs e)
96 | {
97 | if (lbProcesses.SelectedIndex != -1)
98 | lbProcesses.Items.RemoveAt(lbProcesses.SelectedIndex);
99 | }
100 |
101 | private void btnClearList_Click(object sender, EventArgs e)
102 | {
103 | lbProcesses.Items.Clear();
104 | }
105 |
106 | private void btnCancel_Click(object sender, EventArgs e)
107 | {
108 | lbProcesses.Items.Clear();
109 | this.Close();
110 | }
111 |
112 | private void btnSendList_Click(object sender, EventArgs e)
113 | {
114 |
115 | if (lbProcesses.SelectedIndex == -1)
116 | {
117 | MessageBox.Show("There's no process selected");
118 | return;
119 | }
120 |
121 | var pi = new ProcessInterface(lbProcesses.SelectedItem.ToString());
122 |
123 | if (pi.Hooked)
124 | {
125 | WGH_Core.currentMemoryInterface = pi;
126 | this.DialogResult = DialogResult.OK;
127 | this.Close();
128 | }
129 | else
130 | {
131 | this.Close();
132 | }
133 |
134 |
135 | }
136 |
137 | private void WGH_SelectMultiple_FormClosing(object sender, FormClosingEventArgs e)
138 | {
139 | lbProcesses.Items.Clear();
140 | }
141 |
142 | private void btnLoadFile_Click(object sender, EventArgs e)
143 | {
144 | OpenFileDialog OpenFileDialog1;
145 | OpenFileDialog1 = new OpenFileDialog();
146 |
147 | OpenFileDialog1.DefaultExt = "txt";
148 | OpenFileDialog1.Title = "Open File list";
149 | OpenFileDialog1.Filter = "TXT files|*.txt";
150 | OpenFileDialog1.RestoreDirectory = true;
151 | if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
152 | {
153 | try
154 | {
155 | string[] files = File.ReadAllLines(OpenFileDialog1.FileName);
156 | lbProcesses.Items.Clear();
157 | lbProcesses.Items.AddRange(files);
158 | }
159 | catch(Exception ex)
160 | {
161 | MessageBox.Show("Something went wrong while loading file list \n\n" + ex.ToString());
162 | }
163 | }
164 | }
165 |
166 | private void btnSaveFile_Click(object sender, EventArgs e)
167 | {
168 | SaveFileDialog saveFileDialog1 = new SaveFileDialog();
169 | saveFileDialog1.DefaultExt = "txt";
170 | saveFileDialog1.Title = "Save File list";
171 | saveFileDialog1.Filter = "TXT files|*.txt";
172 | saveFileDialog1.RestoreDirectory = true;
173 |
174 | if (saveFileDialog1.ShowDialog() == DialogResult.OK)
175 | {
176 | try
177 | {
178 | List allLines = new List();
179 |
180 | foreach (var item in lbProcesses.Items)
181 | allLines.Add(item.ToString());
182 |
183 | File.WriteAllLines(saveFileDialog1.FileName, allLines.ToArray());
184 | }
185 | catch (Exception ex)
186 | {
187 | MessageBox.Show("Something went wrong while saving file list \n\n" + ex.ToString());
188 | }
189 | }
190 | }
191 |
192 |
193 | }
194 | }
195 |
196 | */
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_MemoryBanks.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Text;
5 |
6 | namespace WindowsGlitchHarvester
7 | {
8 | static class WGH_MemoryBanks
9 | {
10 | public static int maxBankSize = 1073741824;
11 | public static long totalFileSize = 0;
12 |
13 | public static byte[][] ReadFile (string path)
14 | {
15 | try
16 | {
17 |
18 | long fileLength = new System.IO.FileInfo(path).Length;
19 | totalFileSize = fileLength;
20 | int tailBankSize = Convert.ToInt32(fileLength % maxBankSize);
21 | bool multipleBanks = fileLength > maxBankSize;
22 | int banksCount = 1;
23 |
24 | if (multipleBanks)
25 | {
26 | banksCount = Convert.ToInt32((fileLength - tailBankSize) / maxBankSize);
27 |
28 | if (tailBankSize != 0) //an addition bank exists if the filesize's length isn't a multiplier of int32 maxvalue
29 | banksCount++;
30 | }
31 |
32 | byte[][] Banks = new byte[banksCount][];
33 |
34 | using (Stream stream = File.Open(path, FileMode.Open))
35 | {
36 | for(long i = 0; i
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.pbProgress = new System.Windows.Forms.ProgressBar();
32 | this.lbProgress = new System.Windows.Forms.Label();
33 | this.SuspendLayout();
34 | //
35 | // pbProgress
36 | //
37 | this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
38 | | System.Windows.Forms.AnchorStyles.Right)));
39 | this.pbProgress.Location = new System.Drawing.Point(51, 42);
40 | this.pbProgress.Name = "pbProgress";
41 | this.pbProgress.Size = new System.Drawing.Size(304, 16);
42 | this.pbProgress.TabIndex = 0;
43 | //
44 | // lbProgress
45 | //
46 | this.lbProgress.AutoSize = true;
47 | this.lbProgress.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
48 | this.lbProgress.ForeColor = System.Drawing.Color.White;
49 | this.lbProgress.Location = new System.Drawing.Point(48, 60);
50 | this.lbProgress.Name = "lbProgress";
51 | this.lbProgress.Size = new System.Drawing.Size(16, 13);
52 | this.lbProgress.TabIndex = 1;
53 | this.lbProgress.Text = "...";
54 | //
55 | // WGH_Progress
56 | //
57 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
58 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
59 | this.BackColor = System.Drawing.Color.Black;
60 | this.ClientSize = new System.Drawing.Size(426, 207);
61 | this.Controls.Add(this.lbProgress);
62 | this.Controls.Add(this.pbProgress);
63 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
64 | this.Name = "WGH_Progress";
65 | this.Text = "WGH_Progress";
66 | this.ResumeLayout(false);
67 | this.PerformLayout();
68 |
69 | }
70 |
71 | #endregion
72 |
73 | public System.Windows.Forms.ProgressBar pbProgress;
74 | private System.Windows.Forms.Label lbProgress;
75 | }
76 | }
--------------------------------------------------------------------------------
/WindowsGlitchHarvester/WGH_Progress.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace WindowsGlitchHarvester
10 | {
11 | public partial class WGH_Progress : Form
12 | {
13 | public BackgroundWorker bw = new BackgroundWorker();
14 | string defaultLabel;
15 |
16 | public static Action