├── AOBSignatureGenerator
├── 1REC.png
├── 2REC.png
├── AOBSignatureGenerator.csproj
├── Forms
│ ├── Calculator.Designer.cs
│ ├── Calculator.cs
│ ├── Calculator.resx
│ ├── HideShowMainForm.Designer.cs
│ ├── HideShowMainForm.cs
│ ├── HideShowMainForm.resx
│ ├── SignatureGeneratorForm.Designer.cs
│ ├── SignatureGeneratorForm.cs
│ └── SignatureGeneratorForm.resx
├── Properties
│ └── AssemblyInfo.cs
├── SDK
│ ├── CEObjectWrapper.cs
│ ├── CESDK.cs
│ ├── CESDKLua.cs
│ ├── FoundList.cs
│ └── MemScan.cs
├── SignatureGenerator.cs
├── SignatureGenerator.cs.old
├── SignatureGeneratorForm.Designer.cs
├── SignatureGeneratorForm.cs
├── SignatureGeneratorForm.resx
├── bin
│ └── Debug
│ │ ├── AOBSignatureGenerator.dll
│ │ └── AOBSignatureGenerator.pdb
├── calc.png
├── obj
│ └── Debug
│ │ ├── AOBSignatureGenerator.Forms.HideShowMainForm.resources
│ │ ├── AOBSignatureGenerator.SignatureGeneratorForm.resources
│ │ ├── AOBSignatureGenerator.csproj.AssemblyReference.cache
│ │ ├── AOBSignatureGenerator.csproj.CoreCompileInputs.cache
│ │ ├── AOBSignatureGenerator.csproj.FileListAbsolute.txt
│ │ ├── AOBSignatureGenerator.csproj.GenerateResource.cache
│ │ ├── AOBSignatureGenerator.dll
│ │ ├── AOBSignatureGenerator.pdb
│ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ └── DesignTimeResolveAssemblyReferencesInput.cache
├── ss1.jpg
├── ss2.jpg
└── ss3.png
├── LICENSE.md
└── README.md
/AOBSignatureGenerator/1REC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/1REC.png
--------------------------------------------------------------------------------
/AOBSignatureGenerator/2REC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/2REC.png
--------------------------------------------------------------------------------
/AOBSignatureGenerator/AOBSignatureGenerator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {08FFC0E1-EE22-4F56-8F09-FD668BDC8DA2}
8 | Library
9 | Properties
10 | AOBSignatureGenerator
11 | AOBSignatureGenerator
12 | v4.6
13 | 512
14 | true
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | Calculator.cs
52 |
53 |
54 | Form
55 |
56 |
57 | HideShowMainForm.cs
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | Form
68 |
69 |
70 | SignatureGeneratorForm.cs
71 |
72 |
73 |
74 |
75 | Calculator.cs
76 |
77 |
78 | HideShowMainForm.cs
79 |
80 |
81 | SignatureGeneratorForm.cs
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/Calculator.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AOBSignatureGenerator.Forms
2 | {
3 | partial class Calculator
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBoxInput = new System.Windows.Forms.TextBox();
32 | this.buttonHex = new System.Windows.Forms.Button();
33 | this.buttonDec = new System.Windows.Forms.Button();
34 | this.SuspendLayout();
35 | //
36 | // textBoxInput
37 | //
38 | this.textBoxInput.Location = new System.Drawing.Point(13, 13);
39 | this.textBoxInput.Name = "textBoxInput";
40 | this.textBoxInput.Size = new System.Drawing.Size(262, 22);
41 | this.textBoxInput.TabIndex = 0;
42 | //
43 | // buttonHex
44 | //
45 | this.buttonHex.Location = new System.Drawing.Point(13, 55);
46 | this.buttonHex.Name = "buttonHex";
47 | this.buttonHex.Size = new System.Drawing.Size(75, 23);
48 | this.buttonHex.TabIndex = 1;
49 | this.buttonHex.Text = "To Hex";
50 | this.buttonHex.UseVisualStyleBackColor = true;
51 | this.buttonHex.Click += new System.EventHandler(this.buttonHex_Click);
52 | //
53 | // buttonDec
54 | //
55 | this.buttonDec.Location = new System.Drawing.Point(94, 55);
56 | this.buttonDec.Name = "buttonDec";
57 | this.buttonDec.Size = new System.Drawing.Size(75, 23);
58 | this.buttonDec.TabIndex = 2;
59 | this.buttonDec.Text = "To Dec";
60 | this.buttonDec.UseVisualStyleBackColor = true;
61 | this.buttonDec.Click += new System.EventHandler(this.buttonDec_Click);
62 | //
63 | // Calculator
64 | //
65 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
66 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
67 | this.ClientSize = new System.Drawing.Size(286, 90);
68 | this.Controls.Add(this.buttonDec);
69 | this.Controls.Add(this.buttonHex);
70 | this.Controls.Add(this.textBoxInput);
71 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
72 | this.MaximizeBox = false;
73 | this.MinimizeBox = false;
74 | this.Name = "Calculator";
75 | this.ShowIcon = false;
76 | this.Text = "Hex/Decimal Calculator";
77 | this.ResumeLayout(false);
78 | this.PerformLayout();
79 |
80 | }
81 |
82 | #endregion
83 |
84 | private System.Windows.Forms.TextBox textBoxInput;
85 | private System.Windows.Forms.Button buttonHex;
86 | private System.Windows.Forms.Button buttonDec;
87 | }
88 | }
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/Calculator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace AOBSignatureGenerator.Forms
12 | {
13 | ///
14 | /// Calculator Main Form
15 | ///
16 | public partial class Calculator : Form
17 | {
18 | ///
19 | /// Load Form
20 | ///
21 | public Calculator()
22 | {
23 | InitializeComponent();
24 | }
25 |
26 | ///
27 | /// ToHex Button on click Function
28 | ///
29 | ///
30 | ///
31 | private void buttonHex_Click(object sender, EventArgs e)
32 | {
33 | string toHex = textBoxInput.Text;
34 | toHex = toHex.Trim().Replace(" ", "");
35 | // Check if data is valid decimal
36 | if (IsValidDec(toHex))
37 | {
38 | textBoxInput.Text = Int64.Parse(toHex).ToString("X");
39 | }
40 | }
41 | ///
42 | /// To Decimal Button on click Function
43 | ///
44 | ///
45 | ///
46 | private void buttonDec_Click(object sender, EventArgs e)
47 | {
48 | string toDec = textBoxInput.Text;
49 | toDec = toDec.Trim().Replace(" ", "");
50 | // Check if data is valid hex
51 | if (IsValidHex(toDec))
52 | {
53 | textBoxInput.Text = Convert.ToInt64(toDec, 16).ToString();
54 | }
55 | }
56 |
57 | ///
58 | /// Checks if buttonHex_Click is valid decimal data
59 | /// If valid decimal data, convert to hex
60 | ///
61 | ///
62 | /// True if valid decimal values else return false
63 | private bool IsValidDec(string data)
64 | {
65 |
66 | Int64 number;
67 | bool isValid = Int64.TryParse(data, out number);
68 | // If isValid is true, return true
69 | if (isValid && number <= 9223372036854775807)
70 | {
71 | return true;
72 | }
73 | else
74 | {
75 | MessageBox.Show("Not a vaild decimal number or number is too long", "Not Decimal");
76 | return false;
77 | }
78 | }
79 |
80 | ///
81 | /// Checks if buttonDec_Click is using valid hex data
82 | /// If converted hex data is numeric, convert back to decimal
83 | ///
84 | ///
85 | /// True if hex data contains only numeric values, else False
86 | private bool IsValidHex(string data)
87 | {
88 | try
89 | {
90 | string toHex = Convert.ToInt64(data, 16).ToString();
91 | Int64 number;
92 | // Check if above hex data is numeric
93 | bool isValid = Int64.TryParse(toHex, out number);
94 | if (number <= 9223372036854775807 && number > 0)
95 | {
96 | // If only numeric values, return true
97 | if (isValid)
98 | {
99 | return true;
100 | }
101 | else
102 | {
103 | MessageBox.Show("Not a vaild hex number or hex value too long", "Not Hex Number");
104 | return false;
105 | }
106 | }
107 | else
108 | {
109 | MessageBox.Show("Number is too long. Max:\nDec: 9223372036854775807\nHex: 7FFFFFFFFFFFFFFF", "Number to long");
110 | return false;
111 | }
112 | }
113 | catch (Exception e)
114 | {
115 | MessageBox.Show("This is not valid hex data", "Not Hex");
116 | return false;
117 | }
118 |
119 | }
120 |
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/Calculator.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 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/HideShowMainForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace AOBSignatureGenerator.Forms
3 | {
4 | partial class HideShowMainForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.checkBoxShowHide = new System.Windows.Forms.CheckBox();
33 | this.checkBoxOnTop = new System.Windows.Forms.CheckBox();
34 | this.labelWindowStatus = new System.Windows.Forms.Label();
35 | this.checkBoxHideAll = new System.Windows.Forms.CheckBox();
36 | this.trackBarOpaque = new System.Windows.Forms.TrackBar();
37 | this.labelOpaque = new System.Windows.Forms.Label();
38 | this.divider1 = new System.Windows.Forms.Label();
39 | this.divider2 = new System.Windows.Forms.Label();
40 | this.labelUpdateTitle = new System.Windows.Forms.Label();
41 | this.textBoxUpdateTitle = new System.Windows.Forms.TextBox();
42 | this.buttonUpdateTitle = new System.Windows.Forms.Button();
43 | this.divider3 = new System.Windows.Forms.Label();
44 | ((System.ComponentModel.ISupportInitialize)(this.trackBarOpaque)).BeginInit();
45 | this.SuspendLayout();
46 | //
47 | // checkBoxShowHide
48 | //
49 | this.checkBoxShowHide.AutoSize = true;
50 | this.checkBoxShowHide.Location = new System.Drawing.Point(12, 39);
51 | this.checkBoxShowHide.Name = "checkBoxShowHide";
52 | this.checkBoxShowHide.Size = new System.Drawing.Size(173, 20);
53 | this.checkBoxShowHide.TabIndex = 2;
54 | this.checkBoxShowHide.Text = "Hide/Show Main Screen";
55 | this.checkBoxShowHide.UseVisualStyleBackColor = true;
56 | this.checkBoxShowHide.CheckedChanged += new System.EventHandler(this.checkBoxShowHide_CheckedChanged);
57 | //
58 | // checkBoxOnTop
59 | //
60 | this.checkBoxOnTop.AutoSize = true;
61 | this.checkBoxOnTop.Location = new System.Drawing.Point(12, 12);
62 | this.checkBoxOnTop.Name = "checkBoxOnTop";
63 | this.checkBoxOnTop.Size = new System.Drawing.Size(197, 20);
64 | this.checkBoxOnTop.TabIndex = 3;
65 | this.checkBoxOnTop.Text = "MainWindow Always OnTop";
66 | this.checkBoxOnTop.UseVisualStyleBackColor = true;
67 | this.checkBoxOnTop.CheckedChanged += new System.EventHandler(this.checkBoxOnTop_CheckedChanged);
68 | //
69 | // labelWindowStatus
70 | //
71 | this.labelWindowStatus.AutoSize = true;
72 | this.labelWindowStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
73 | this.labelWindowStatus.Location = new System.Drawing.Point(9, 282);
74 | this.labelWindowStatus.Name = "labelWindowStatus";
75 | this.labelWindowStatus.Size = new System.Drawing.Size(54, 16);
76 | this.labelWindowStatus.TabIndex = 4;
77 | this.labelWindowStatus.Text = "Status:";
78 | //
79 | // checkBoxHideAll
80 | //
81 | this.checkBoxHideAll.AutoSize = true;
82 | this.checkBoxHideAll.Location = new System.Drawing.Point(12, 65);
83 | this.checkBoxHideAll.Name = "checkBoxHideAll";
84 | this.checkBoxHideAll.Size = new System.Drawing.Size(150, 20);
85 | this.checkBoxHideAll.TabIndex = 5;
86 | this.checkBoxHideAll.Text = "Hide All CE Screens";
87 | this.checkBoxHideAll.UseVisualStyleBackColor = true;
88 | this.checkBoxHideAll.CheckedChanged += new System.EventHandler(this.checkBoxHideAll_CheckedChanged);
89 | //
90 | // trackBarOpaque
91 | //
92 | this.trackBarOpaque.AutoSize = false;
93 | this.trackBarOpaque.Location = new System.Drawing.Point(3, 130);
94 | this.trackBarOpaque.Maximum = 225;
95 | this.trackBarOpaque.Name = "trackBarOpaque";
96 | this.trackBarOpaque.Size = new System.Drawing.Size(288, 35);
97 | this.trackBarOpaque.TabIndex = 6;
98 | this.trackBarOpaque.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
99 | this.trackBarOpaque.ValueChanged += new System.EventHandler(this.slider_valueChanged);
100 | //
101 | // labelOpaque
102 | //
103 | this.labelOpaque.AutoSize = true;
104 | this.labelOpaque.Location = new System.Drawing.Point(15, 111);
105 | this.labelOpaque.Name = "labelOpaque";
106 | this.labelOpaque.Size = new System.Drawing.Size(135, 16);
107 | this.labelOpaque.TabIndex = 7;
108 | this.labelOpaque.Text = "Ajust Opacity of forms";
109 | //
110 | // divider1
111 | //
112 | this.divider1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
113 | this.divider1.Location = new System.Drawing.Point(3, 97);
114 | this.divider1.Name = "divider1";
115 | this.divider1.Size = new System.Drawing.Size(300, 2);
116 | this.divider1.TabIndex = 8;
117 | //
118 | // divider2
119 | //
120 | this.divider2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
121 | this.divider2.Location = new System.Drawing.Point(3, 178);
122 | this.divider2.Name = "divider2";
123 | this.divider2.Size = new System.Drawing.Size(300, 2);
124 | this.divider2.TabIndex = 9;
125 | //
126 | // labelUpdateTitle
127 | //
128 | this.labelUpdateTitle.AutoSize = true;
129 | this.labelUpdateTitle.Location = new System.Drawing.Point(12, 191);
130 | this.labelUpdateTitle.Name = "labelUpdateTitle";
131 | this.labelUpdateTitle.Size = new System.Drawing.Size(164, 16);
132 | this.labelUpdateTitle.TabIndex = 10;
133 | this.labelUpdateTitle.Text = "Update Cheat Engine Title";
134 | //
135 | // textBoxUpdateTitle
136 | //
137 | this.textBoxUpdateTitle.Location = new System.Drawing.Point(15, 211);
138 | this.textBoxUpdateTitle.Name = "textBoxUpdateTitle";
139 | this.textBoxUpdateTitle.Size = new System.Drawing.Size(276, 22);
140 | this.textBoxUpdateTitle.TabIndex = 11;
141 | //
142 | // buttonUpdateTitle
143 | //
144 | this.buttonUpdateTitle.Location = new System.Drawing.Point(15, 239);
145 | this.buttonUpdateTitle.Name = "buttonUpdateTitle";
146 | this.buttonUpdateTitle.Size = new System.Drawing.Size(75, 23);
147 | this.buttonUpdateTitle.TabIndex = 12;
148 | this.buttonUpdateTitle.Text = "Update";
149 | this.buttonUpdateTitle.UseVisualStyleBackColor = true;
150 | this.buttonUpdateTitle.Click += new System.EventHandler(this.buttonUpdateTitle_Click);
151 | //
152 | // divider3
153 | //
154 | this.divider3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
155 | this.divider3.Location = new System.Drawing.Point(3, 275);
156 | this.divider3.Name = "divider3";
157 | this.divider3.Size = new System.Drawing.Size(300, 2);
158 | this.divider3.TabIndex = 13;
159 | //
160 | // HideShowMainForm
161 | //
162 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
163 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
164 | this.ClientSize = new System.Drawing.Size(306, 307);
165 | this.Controls.Add(this.divider3);
166 | this.Controls.Add(this.buttonUpdateTitle);
167 | this.Controls.Add(this.textBoxUpdateTitle);
168 | this.Controls.Add(this.labelUpdateTitle);
169 | this.Controls.Add(this.divider2);
170 | this.Controls.Add(this.divider1);
171 | this.Controls.Add(this.labelOpaque);
172 | this.Controls.Add(this.trackBarOpaque);
173 | this.Controls.Add(this.checkBoxHideAll);
174 | this.Controls.Add(this.labelWindowStatus);
175 | this.Controls.Add(this.checkBoxOnTop);
176 | this.Controls.Add(this.checkBoxShowHide);
177 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
178 | this.MaximizeBox = false;
179 | this.MinimizeBox = false;
180 | this.Name = "HideShowMainForm";
181 | this.Text = "Main Window Display Options";
182 | ((System.ComponentModel.ISupportInitialize)(this.trackBarOpaque)).EndInit();
183 | this.ResumeLayout(false);
184 | this.PerformLayout();
185 |
186 | }
187 |
188 | #endregion
189 |
190 | private System.Windows.Forms.CheckBox checkBoxShowHide;
191 | private System.Windows.Forms.CheckBox checkBoxOnTop;
192 | private System.Windows.Forms.Label labelWindowStatus;
193 | private System.Windows.Forms.CheckBox checkBoxHideAll;
194 | private System.Windows.Forms.TrackBar trackBarOpaque;
195 | private System.Windows.Forms.Label labelOpaque;
196 | private System.Windows.Forms.Label divider1;
197 | private System.Windows.Forms.Label divider2;
198 | private System.Windows.Forms.Label labelUpdateTitle;
199 | private System.Windows.Forms.TextBox textBoxUpdateTitle;
200 | private System.Windows.Forms.Button buttonUpdateTitle;
201 | private System.Windows.Forms.Label divider3;
202 | }
203 | }
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/HideShowMainForm.cs:
--------------------------------------------------------------------------------
1 |
2 | using CESDK;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Drawing;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace AOBSignatureGenerator.Forms
14 | {
15 | ///
16 | /// HideShowMainForm
17 | ///
18 | public partial class HideShowMainForm : Form
19 | {
20 | ///
21 | /// Hides Main Form or Shows main form
22 | ///
23 | public HideShowMainForm()
24 | {
25 | InitializeComponent();
26 |
27 | }
28 | ///
29 | /// checkBoxOnTop_CheckedChanged event
30 | ///
31 | ///
32 | ///
33 | private void checkBoxOnTop_CheckedChanged(object sender, EventArgs e)
34 | {
35 | var lua = CESDK.CESDK.currentPlugin.sdk.lua;
36 | try
37 | {
38 | if (checkBoxOnTop.Checked == true)
39 | {
40 | checkBoxShowHide.Enabled = false;
41 | checkBoxHideAll.Enabled = false;
42 | labelWindowStatus.ForeColor = System.Drawing.Color.Green;
43 | labelWindowStatus.Text = "Status: Main Window On Top Mode";
44 | lua.DoString("getMainForm().formStyle='fsSystemStayOnTop'");
45 | }
46 | else
47 | {
48 | checkBoxShowHide.Enabled = true;
49 | checkBoxHideAll.Enabled = true;
50 | labelWindowStatus.ForeColor = System.Drawing.Color.Black;
51 | labelWindowStatus.Text = "Status:";
52 | lua.DoString("getMainForm().formStyle='0'");
53 | }
54 | }
55 | catch (Exception ex)
56 | {
57 | MessageBox.Show(ex.Message, "Error");
58 | }
59 | }
60 |
61 | ///
62 | /// checkBoxShowHide_CheckedChanged Event
63 | ///
64 | ///
65 | ///
66 | private void checkBoxShowHide_CheckedChanged(object sender, EventArgs e)
67 | {
68 | var lua = CESDK.CESDK.currentPlugin.sdk.lua;
69 | try
70 | {
71 | if (checkBoxShowHide.Checked == true)
72 | {
73 | checkBoxOnTop.Enabled = false;
74 | checkBoxHideAll.Enabled = false;
75 | labelWindowStatus.ForeColor = System.Drawing.Color.Blue;
76 | labelWindowStatus.Text = "Status: Main Window is Hidden";
77 | lua.DoString("getMainForm().hide()");
78 | }
79 | else
80 | {
81 | checkBoxOnTop.Enabled = true;
82 | checkBoxHideAll.Enabled = true;
83 | labelWindowStatus.ForeColor = System.Drawing.Color.Black;
84 | labelWindowStatus.Text = "Status:";
85 | lua.DoString("getMainForm().show()");
86 | }
87 | }
88 | catch (Exception ex)
89 | {
90 | MessageBox.Show(ex.Message, "Error");
91 | }
92 | }
93 |
94 | ///
95 | /// Hide All Forms Event
96 | ///
97 | ///
98 | ///
99 | private void checkBoxHideAll_CheckedChanged(object sender, EventArgs e)
100 | {
101 | var lua = CESDK.CESDK.currentPlugin.sdk.lua;
102 | try
103 | {
104 | if (checkBoxHideAll.Checked == true)
105 | {
106 | checkBoxOnTop.Enabled = false;
107 | checkBoxShowHide.Enabled = false;
108 | labelWindowStatus.ForeColor = System.Drawing.Color.Red;
109 | labelWindowStatus.Text = "Status: All Windows are hidden";
110 |
111 | //atom0s from forum.cheatengine.org gave me a better way to write the above
112 | lua.DoString(@"f = hideForms();");
113 |
114 | }
115 | else
116 | {
117 | checkBoxOnTop.Enabled = true;
118 | checkBoxShowHide.Enabled = true;
119 | labelWindowStatus.ForeColor = System.Drawing.Color.Black;
120 | labelWindowStatus.Text = "Status:";
121 | lua.DoString(@"showForms(f);");
122 |
123 | }
124 | }
125 | catch (Exception ex)
126 | {
127 | MessageBox.Show(ex.Message, "Error");
128 | }
129 | }
130 |
131 | ///
132 | /// Changed Opcaity Slider Event
133 | ///
134 | ///
135 | ///
136 | private void slider_valueChanged(object sender, EventArgs e)
137 | {
138 | var lua = CESDK.CESDK.currentPlugin.sdk.lua;
139 | lua.DoString($@"local cnt = getFormCount();
140 | for x = 0, cnt - 1 do
141 | local frm = getForm(x);
142 | frm.setLayeredAttributes(0x0000FF, {255 - trackBarOpaque.Value}, 3)
143 | end");
144 | }
145 |
146 | ///
147 | /// buttonUpdateTitle_Click
148 | ///
149 | ///
150 | ///
151 | private void buttonUpdateTitle_Click(object sender, EventArgs e)
152 | {
153 | var lua = CESDK.CESDK.currentPlugin.sdk.lua;
154 | if (String.IsNullOrEmpty(textBoxUpdateTitle.Text))
155 | {
156 | MessageBox.Show("Title cannot be blank", "error");
157 | }
158 | else
159 | {
160 | lua.DoString($"getMainForm().Caption = '{textBoxUpdateTitle.Text}'");
161 | lua.DoString($"getApplication().Title = '{textBoxUpdateTitle.Text}'");
162 | labelWindowStatus.ForeColor = System.Drawing.Color.Black;
163 | labelWindowStatus.Text = "Status: Cheat Engine Title Updated";
164 | }
165 | }
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/HideShowMainForm.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 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/SignatureGeneratorForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace AOBSignatureGenerator
3 | {
4 | partial class SignatureGeneratorForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.textBoxInput = new System.Windows.Forms.TextBox();
33 | this.textBoxOutput = new System.Windows.Forms.TextBox();
34 | this.labelInputData = new System.Windows.Forms.Label();
35 | this.labelOutputData = new System.Windows.Forms.Label();
36 | this.buttonAOB = new System.Windows.Forms.Button();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.textBoxOutput2 = new System.Windows.Forms.TextBox();
39 | this.SuspendLayout();
40 | //
41 | // textBoxInput
42 | //
43 | this.textBoxInput.Location = new System.Drawing.Point(12, 31);
44 | this.textBoxInput.Multiline = true;
45 | this.textBoxInput.Name = "textBoxInput";
46 | this.textBoxInput.Size = new System.Drawing.Size(776, 160);
47 | this.textBoxInput.TabIndex = 0;
48 | //
49 | // textBoxOutput
50 | //
51 | this.textBoxOutput.Location = new System.Drawing.Point(12, 232);
52 | this.textBoxOutput.Name = "textBoxOutput";
53 | this.textBoxOutput.Size = new System.Drawing.Size(776, 22);
54 | this.textBoxOutput.TabIndex = 1;
55 | //
56 | // labelInputData
57 | //
58 | this.labelInputData.AutoSize = true;
59 | this.labelInputData.Location = new System.Drawing.Point(13, 9);
60 | this.labelInputData.Name = "labelInputData";
61 | this.labelInputData.Size = new System.Drawing.Size(158, 16);
62 | this.labelInputData.TabIndex = 2;
63 | this.labelInputData.Text = "Enter your AOB data here";
64 | //
65 | // labelOutputData
66 | //
67 | this.labelOutputData.AutoSize = true;
68 | this.labelOutputData.Location = new System.Drawing.Point(12, 210);
69 | this.labelOutputData.Name = "labelOutputData";
70 | this.labelOutputData.Size = new System.Drawing.Size(209, 16);
71 | this.labelOutputData.TabIndex = 3;
72 | this.labelOutputData.Text = "AOB Signature Data With Spacing";
73 | //
74 | // buttonAOB
75 | //
76 | this.buttonAOB.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
77 | this.buttonAOB.Location = new System.Drawing.Point(335, 319);
78 | this.buttonAOB.Name = "buttonAOB";
79 | this.buttonAOB.Size = new System.Drawing.Size(126, 41);
80 | this.buttonAOB.TabIndex = 4;
81 | this.buttonAOB.Text = "Create Signature";
82 | this.buttonAOB.UseVisualStyleBackColor = true;
83 | this.buttonAOB.Click += new System.EventHandler(this.buttonAOB_Click);
84 | //
85 | // label1
86 | //
87 | this.label1.AutoSize = true;
88 | this.label1.Location = new System.Drawing.Point(12, 271);
89 | this.label1.Name = "label1";
90 | this.label1.Size = new System.Drawing.Size(201, 16);
91 | this.label1.TabIndex = 5;
92 | this.label1.Text = "AOB Signature Data No Spacing";
93 | //
94 | // textBoxOutput2
95 | //
96 | this.textBoxOutput2.Location = new System.Drawing.Point(12, 291);
97 | this.textBoxOutput2.Name = "textBoxOutput2";
98 | this.textBoxOutput2.Size = new System.Drawing.Size(776, 22);
99 | this.textBoxOutput2.TabIndex = 6;
100 | //
101 | // SignatureGeneratorForm
102 | //
103 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
105 | this.ClientSize = new System.Drawing.Size(800, 373);
106 | this.Controls.Add(this.textBoxOutput2);
107 | this.Controls.Add(this.label1);
108 | this.Controls.Add(this.buttonAOB);
109 | this.Controls.Add(this.labelOutputData);
110 | this.Controls.Add(this.labelInputData);
111 | this.Controls.Add(this.textBoxOutput);
112 | this.Controls.Add(this.textBoxInput);
113 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
114 | this.Name = "SignatureGeneratorForm";
115 | this.Text = "AOB Signature Generator";
116 | this.ResumeLayout(false);
117 | this.PerformLayout();
118 |
119 | }
120 |
121 | #endregion
122 |
123 | private System.Windows.Forms.TextBox textBoxInput;
124 | private System.Windows.Forms.TextBox textBoxOutput;
125 | private System.Windows.Forms.Label labelInputData;
126 | private System.Windows.Forms.Label labelOutputData;
127 | private System.Windows.Forms.Button buttonAOB;
128 | private System.Windows.Forms.Label label1;
129 | private System.Windows.Forms.TextBox textBoxOutput2;
130 | }
131 | }
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/SignatureGeneratorForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Text.RegularExpressions;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace AOBSignatureGenerator
13 | {
14 | public partial class SignatureGeneratorForm : Form
15 | {
16 | public SignatureGeneratorForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void buttonAOB_Click(object sender, EventArgs e)
22 | {
23 | if (textBoxInput.Text == string.Empty)
24 | {
25 | MessageBox.Show("Please enter some hex data first.", "No Data");
26 | }
27 | else
28 | {
29 | // Call IsValidHexData() method and check if data we are using contains valid hex values
30 | if (IsValidHexData())
31 | {
32 | // Get number of rows with data in textbox
33 | int getLineCount = NumberOfRows();
34 |
35 | //Create list to save cleaned data.
36 | List lines = new List();
37 |
38 | //Find the shortest line in textBoxInput.Lines
39 | int minLen = textBoxInput.Lines[0].Length; //Set initial value
40 | foreach (string line in textBoxInput.Lines)
41 | {
42 | string l = line.Replace(" ", string.Empty);
43 | if (l.Length < minLen && l.Length > 0)
44 | {
45 | minLen = l.Length;
46 | }
47 | }
48 |
49 | //Loop through text from inputTextbox, clean strings, save update lines list
50 | for (int i = 0; i < getLineCount; i++)
51 | {
52 | //if line is blank, skip and dont add to list
53 | if (!String.IsNullOrEmpty(textBoxInput.Lines[i]))
54 | {
55 | string tmpText = textBoxInput.Lines[i].Replace(" ", string.Empty);
56 | //Make sure all strings being added to list has the same length
57 | lines.Add(tmpText.Substring(0, minLen));
58 | }
59 | }
60 |
61 | createSignature(getLineCount, minLen, lines); // Call method to generate AOB Signature
62 | }
63 | // If data contains non hex values, let user no to fix data
64 | else
65 | {
66 | MessageBox.Show("Please check your data, non hex values found and cannot be used", "Bad Hex Values");
67 | }
68 | }
69 | }
70 |
71 | //Create AOB Signature from cleaned data stored in the lines list
72 | private void createSignature(int lCount, int mlen, List lines)
73 | {
74 | string aobSignature = "";
75 | List signature = new List();
76 |
77 | for (int i = 0; i < mlen; i++)
78 | {
79 | //setup to tmp strings
80 | string tmp = "";
81 | string tmpChar = "";
82 | for (int j = 0; j < lCount; j++)
83 | {
84 | if (String.IsNullOrEmpty(tmpChar))
85 | {
86 | tmpChar = lines[j][i].ToString().ToUpper();
87 | }
88 | if (tmpChar == lines[j][i].ToString().ToUpper())
89 | {
90 | tmp = lines[j][i].ToString().ToUpper();
91 | }
92 | else
93 | {
94 | tmp = "?";
95 | break;
96 | }
97 |
98 | }
99 | signature.Add(tmp); //Update our signature list with temp values
100 | }
101 | string res = string.Join("", signature);
102 | //add spacing to the aobSignature
103 | aobSignature = Regex.Replace(res, @"(.{2})", "$1 ");
104 | ////update the output text boxes
105 | textBoxOutput.Text = aobSignature;
106 | textBoxOutput2.Text = res;
107 | }
108 |
109 | //Get number of rows in inputTextBox
110 | private int NumberOfRows()
111 | {
112 | // Get number of rows with data in textbox
113 | int getLineCount = 0;
114 | foreach (string t in textBoxInput.Lines)
115 | {
116 | if (t.Length > 0)
117 | {
118 | getLineCount += 1;
119 | }
120 | }
121 | return getLineCount;
122 | }
123 |
124 | //Check if textboxInput data is valid hex values
125 | private bool IsValidHexData()
126 | {
127 | string validHexValues = "0123456789ABCDEF";
128 | bool isValid = true;
129 |
130 | // Check of each char is a valid hex value, return true, else return false
131 | foreach (char text in Regex.Replace(textBoxInput.Text, @"\s", string.Empty))
132 | {
133 | if (validHexValues.Contains(Char.ToUpper(text)))
134 | {
135 | isValid = true;
136 | }
137 | else
138 | {
139 | isValid = false;
140 | break;
141 | }
142 | }
143 | return isValid;
144 | }
145 | }
146 |
147 | }
148 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/Forms/SignatureGeneratorForm.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 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/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("AOBSignatureGenerator")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AOBSignatureGenerator")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
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("08ffc0e1-ee22-4f56-8f09-fd668bdc8da2")]
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 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SDK/CEObjectWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CESDK
8 | {
9 | ///
10 | /// Base class for implementing objects inherited from TObject (just a destructor in this case)
11 | ///
12 | class CEObjectWrapper
13 | {
14 | protected CESDKLua lua = CESDK.currentPlugin.sdk.lua;
15 | protected IntPtr CEObject;
16 | public IntPtr obj { get { return CEObject; } }
17 |
18 |
19 |
20 | ~CEObjectWrapper()
21 | {
22 | if (CEObject != IntPtr.Zero)
23 | {
24 | lua.PushCEObject(CEObject);
25 | lua.PushString("destroy");
26 | lua.GetTable(-2);
27 |
28 | if (lua.IsFunction(-1))
29 | {
30 | lua.PCall(0, 0);
31 | }
32 | else
33 | throw new System.ApplicationException("Object without a destroy method");
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SDK/CESDK.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Reflection;
8 |
9 |
10 | //CE SDK wrapper. You usually don't need to be here, so close your eyes and walk away
11 |
12 | namespace CESDK
13 | {
14 |
15 | public abstract class CESDKPluginClass
16 | {
17 | public CESDK sdk;
18 | public abstract String GetPluginName();
19 | public abstract Boolean EnablePlugin();
20 | public abstract Boolean DisablePlugin();
21 | }
22 |
23 | [StructLayout(LayoutKind.Sequential)]
24 | public struct TExportedFunctions
25 | {
26 | public int sizeofExportedFunctions;
27 | public IntPtr GetLuaState;
28 | public IntPtr LuaRegister;
29 | public IntPtr LuaPushClassInstance;
30 | public IntPtr ProcessMessages;
31 | public IntPtr CheckSynchronize;
32 | }
33 |
34 | public class CESDK
35 | {
36 | public static CESDKPluginClass currentPlugin;
37 | public CESDKLua lua;
38 | private const int PLUGINVERSION = 6; //CE SDK plugin version it expects to work with (needed in case newer ce versions change things)
39 | static IntPtr PluginNamePtr;
40 |
41 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
42 | private static extern IntPtr LoadLibrary(string libname);
43 |
44 |
45 |
46 |
47 | [StructLayout(LayoutKind.Sequential)]
48 | private struct TPluginVersion
49 | {
50 | public UInt32 version;
51 | public IntPtr name;
52 | }
53 |
54 | [StructLayout(LayoutKind.Sequential)]
55 | private struct TPluginInit
56 | {
57 | public IntPtr name;
58 | public IntPtr GetVersion;
59 | public IntPtr EnablePlugin;
60 | public IntPtr DisablePlugin;
61 | public int version;
62 | }
63 |
64 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
65 | private delegate Boolean delegateGetVersion([MarshalAs(UnmanagedType.Struct)] ref TPluginVersion PluginVersion, int TPluginVersionSize);
66 |
67 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
68 | private delegate Boolean delegateEnablePlugin([MarshalAs(UnmanagedType.Struct)] ref TExportedFunctions ExportedFunctions, UInt32 pluginid);
69 |
70 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
71 | private delegate Boolean delegateDisablePlugin();
72 |
73 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
74 | private delegate void delegateProcessMessages();
75 |
76 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
77 | private delegate bool delegateCheckSynchronize(int timeout);
78 |
79 |
80 | private static CESDK mainself; //prevents garbage collection
81 |
82 | private delegateGetVersion delGetVersion;
83 | private delegateEnablePlugin delEnablePlugin;
84 | private delegateDisablePlugin delDisablePlugin;
85 | private delegateProcessMessages delProcessMessages;
86 | private delegateCheckSynchronize delCheckSynchronize;
87 |
88 | public UInt32 pluginid;
89 | public TExportedFunctions pluginexports;
90 |
91 | ///
92 | /// Call this to handle all waiting window messages in the CE main thread. Handy when doing something slow inside the main thread and you don't want the user to think CE has frozen
93 | ///
94 | public void ProcessMessages()
95 | {
96 | delProcessMessages();
97 | }
98 |
99 | ///
100 | /// Call this when have the main thread frozen but may be waiting for a thread to handle it's synchronize event (handy when you have frozen the main thread and have a thread running that's first syncing with CE's gui)
101 | ///
102 | /// Timeout in milliseconds to wait
103 | ///
104 |
105 | public bool CheckSynchronize(int timeout)
106 | {
107 | return delCheckSynchronize(timeout);
108 | }
109 |
110 |
111 | private Boolean GetVersion([MarshalAs(UnmanagedType.Struct)] ref TPluginVersion PluginVersion, int TPluginVersionSize)
112 | {
113 | PluginVersion.name = PluginNamePtr;
114 | PluginVersion.version = PLUGINVERSION;
115 | return true;
116 | }
117 |
118 | private Boolean EnablePlugin([MarshalAs(UnmanagedType.Struct)] ref TExportedFunctions ExportedFunctions, UInt32 pluginid)
119 | {
120 | this.pluginid = pluginid;
121 | pluginexports = ExportedFunctions;
122 |
123 | //setup the delegates
124 | if (delProcessMessages == null)
125 | delProcessMessages = Marshal.GetDelegateForFunctionPointer(pluginexports.ProcessMessages);
126 |
127 | if (delCheckSynchronize == null)
128 | delCheckSynchronize = Marshal.GetDelegateForFunctionPointer(pluginexports.CheckSynchronize);
129 |
130 | if (lua==null)
131 | lua = new CESDKLua(this);
132 |
133 | currentPlugin.sdk = this;
134 | return currentPlugin.EnablePlugin();
135 | }
136 |
137 | private Boolean DisablePlugin()
138 | {
139 | return currentPlugin.DisablePlugin();
140 | }
141 |
142 | CESDK()
143 | {
144 | delGetVersion = GetVersion;
145 | delEnablePlugin = EnablePlugin;
146 | delDisablePlugin = DisablePlugin;
147 | return;
148 | }
149 |
150 | public static int CEPluginInitialize(string parameters)
151 | {
152 | if (mainself == null)
153 | mainself = new CESDK();
154 |
155 | if ((Int64)PluginNamePtr == 0)
156 | {
157 | Type[] x=typeof(CESDKPluginClass).Assembly.GetTypes();
158 |
159 | for (int i=0; i(bla, (IntPtr)a, false);
186 |
187 | return 1;
188 | }
189 |
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SDK/CESDKLua.cs:
--------------------------------------------------------------------------------
1 | //Copyright Cheat Engine 2020
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Runtime.InteropServices;
8 |
9 | namespace CESDK
10 | {
11 | public class CESDKLua
12 | {
13 | private const int LUA_TNONE = -1;
14 | private const int LUA_TNIL = 0;
15 | private const int LUA_TBOOLEAN = 1;
16 | private const int LUA_TLIGHTUSERDATA = 2;
17 | private const int LUA_TNUMBER = 3;
18 | private const int LUA_TSTRING = 4;
19 | private const int LUA_TTABLE = 5;
20 | private const int LUA_TFUNCTION = 6;
21 | private const int LUA_TUSERDATA = 7;
22 | private const int LUA_TTHREAD = 8;
23 |
24 | [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Ansi)]
25 | static extern IntPtr LoadLibraryA([MarshalAs(UnmanagedType.LPStr)]string lpFileName);
26 |
27 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)]
28 | public static extern IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)]string procedureName);
29 |
30 | [DllImport("kernel32.dll", SetLastError = true)]
31 | public static extern bool FreeLibrary(IntPtr hModule);
32 |
33 |
34 | private CESDK sdk;
35 |
36 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
37 | public delegate int LuaCall(IntPtr lua_State);
38 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
39 | public delegate int LuaCallSimplified();
40 |
41 |
42 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
43 | private delegate int dlua_gettop(IntPtr state);
44 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
45 | private delegate int dlua_settop(IntPtr state, int idx);
46 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
47 | private delegate int dlua_pushvalue(IntPtr state, int idx);
48 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
49 | private delegate int dlua_rotate(IntPtr state, int idx, int n);
50 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
51 | private delegate int dlua_copy(IntPtr state, int fromidx, int toidx);
52 |
53 |
54 |
55 |
56 |
57 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
58 | private delegate int dlua_pushcclosure(IntPtr state, LuaCall func, int n);
59 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
60 | private delegate int dlua_setglobal(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string str);
61 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
62 | private delegate int dlua_getglobal(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string str);
63 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
64 | private delegate int dlua_pushnil(IntPtr state);
65 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
66 | private delegate int dlua_pushinteger(IntPtr state, [MarshalAs(UnmanagedType.I8)]Int64 i);
67 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
68 | private delegate int dlua_pushnumber(IntPtr state, [MarshalAs(UnmanagedType.R8)]Double n);
69 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
70 | private delegate int dlua_pushlstring(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string s, [MarshalAs(UnmanagedType.SysUInt)]IntPtr size);
71 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
72 | private delegate int dlua_pushstring(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string s);
73 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
74 | private delegate int dlua_pushboolean(IntPtr state, [MarshalAs(UnmanagedType.Bool)]bool b);
75 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
76 | private delegate int dlua_type(IntPtr state, int idx);
77 |
78 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
79 | private delegate bool dlua_isnumber(IntPtr state, int idx);
80 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
81 | private delegate bool dlua_isinteger(IntPtr state, int idx);
82 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
83 | private delegate bool dlua_isstring(IntPtr state, int idx);
84 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
85 | private delegate bool dlua_iscfunction(IntPtr state, int idx);
86 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
87 | private delegate bool dlua_isuserdata(IntPtr state, int idx);
88 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
89 | private delegate double dlua_tonumberx(IntPtr state, int idx, [MarshalAs(UnmanagedType.I4)] ref int isnum);
90 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
91 | private delegate Int64 dlua_tointegerx(IntPtr state, int idx, [MarshalAs(UnmanagedType.I4)] ref int isnum);
92 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
93 | private delegate bool dlua_toboolean(IntPtr state, int idx);
94 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
95 | private delegate IntPtr dlua_tolstring(IntPtr state, int idx, IntPtr sizeptr);
96 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)][return: MarshalAs(UnmanagedType.SysInt)]
97 | private delegate IntPtr dlua_touserdata(IntPtr state, int idx);
98 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
99 | private delegate int dlua_rawlen(IntPtr state, int idx);
100 |
101 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
102 | private delegate int dlua_gettable(IntPtr state, int idx);
103 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
104 | private delegate int dlua_settable(IntPtr state, int idx);
105 |
106 |
107 |
108 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
109 | private delegate int dlua_callk(IntPtr state, int nargs, int nresults, IntPtr context, IntPtr k);
110 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
111 | private delegate int dlua_pcallk(IntPtr state, int nargs, int nresults, IntPtr context, IntPtr k);
112 |
113 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
114 | private delegate int dluaL_loadstring(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string script);
115 |
116 |
117 |
118 |
119 | //ce plugin:
120 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
121 | private delegate IntPtr dGetLuaState();
122 |
123 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124 | private delegate IntPtr dLuaRegister(IntPtr state, [MarshalAs(UnmanagedType.LPStr)]string s, LuaCall func);
125 |
126 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
127 | private delegate void dLuaPushClassInstance(IntPtr state, IntPtr instance);
128 |
129 |
130 |
131 | //lua related sdk exports:
132 | private dGetLuaState _GetLuaState;
133 | private dLuaRegister LuaRegister;
134 | private dLuaPushClassInstance LuaPushClassInstance;
135 |
136 |
137 | //local native lua functions
138 | private dlua_gettop lua_gettop;
139 | private dlua_settop lua_settop;
140 | private dlua_pushvalue lua_pushvalue;
141 | private dlua_rotate lua_rotate;
142 | private dlua_copy lua_copy;
143 | private dlua_pushcclosure lua_pushcclosure;
144 | private dlua_setglobal lua_setglobal;
145 | private dlua_getglobal lua_getglobal;
146 | private dlua_pushnil lua_pushnil;
147 | private dlua_pushinteger lua_pushinteger;
148 | private dlua_pushnumber lua_pushnumber;
149 | private dlua_pushlstring lua_pushlstring;
150 | private dlua_pushstring lua_pushstring;
151 | private dlua_pushboolean lua_pushboolean;
152 | private dlua_type lua_type;
153 | private dlua_isnumber lua_isnumber;
154 | private dlua_isinteger lua_isinteger;
155 | private dlua_isstring lua_isstring;
156 | private dlua_iscfunction lua_iscfunction;
157 | private dlua_isuserdata lua_isuserdata;
158 | private dlua_tonumberx lua_tonumberx;
159 | private dlua_tointegerx lua_tointegerx;
160 | private dlua_toboolean lua_toboolean;
161 | private dlua_tolstring lua_tolstring;
162 | private dlua_touserdata lua_touserdata;
163 | private dlua_rawlen lua_rawlen;
164 | private dlua_gettable lua_gettable;
165 | private dlua_settable lua_settable;
166 | private dlua_callk lua_callk;
167 | private dlua_pcallk lua_pcallk;
168 |
169 | private dluaL_loadstring luaL_loadstring;
170 |
171 |
172 | public IntPtr State { get { return GetLuaState(); } }
173 |
174 | private static List luafunctions = new List();
175 |
176 | //c# versions
177 | public int GetTop() { return lua_gettop(State); }
178 | public int GetTop(IntPtr L) { return lua_gettop(L); }
179 | public int SetTop(int idx) { return lua_settop(State, idx); }
180 | public int SetTop(IntPtr L, int idx) { return lua_settop(L, idx); }
181 | public int PushValue(int idx) { return lua_pushvalue(State, idx); }
182 | public int PushValue(IntPtr L, int idx) { return lua_pushvalue(L, idx); }
183 | public int Rotate(int idx, int n) { return lua_rotate(State, idx, n); }
184 | public int Rotate(IntPtr L, int idx, int n) { return lua_rotate(L, idx, n); }
185 | public int Copy(int idx, int fromidx, int toidx) { return lua_copy(State, fromidx, toidx); }
186 | public int Copy(IntPtr L, int fromidx, int toidx) { return lua_copy(L, fromidx, toidx); }
187 |
188 |
189 | public void Pop(IntPtr L, int n) { lua_settop(State, -n - 1); }
190 | public void Pop(int n) { Pop(State, n); }
191 | public void Remove(IntPtr L, int idx) { Rotate(L, idx, -1); Pop(L, 1); }
192 | public void Remove(int idx) { Remove(State, idx); }
193 | public void Insert(IntPtr L, int idx) { lua_rotate(L, idx, 1); }
194 | public void Insert(int idx) { Insert(State, idx); }
195 |
196 | public void Replace(IntPtr L, int idx) { lua_copy(State, -1, idx); Pop(State, 1); }
197 | public void Replace(int idx) { Replace(State, idx); }
198 |
199 | public int Type(int idx) { return lua_type(State, idx); }
200 | public int Type(IntPtr L, int idx) { return lua_type(L, idx); }
201 |
202 |
203 | public int PushClosure(LuaCall func, int n)
204 | {
205 | return lua_pushcclosure(State, func, n);
206 | }
207 | public int PushFunction(LuaCall func) { return PushClosure(func, 0); }
208 | public int SetGlobal(string str) { return lua_setglobal(State, str); }
209 | public int GetGlobal(string str) { return lua_getglobal(State, str); }
210 |
211 | ///
212 | /// Registers a new function with CE's lua environment
213 | ///
214 | /// new lua function name
215 | /// pointer to the method to be called when the function is executed
216 | public void Register(string FuncName, LuaCallSimplified func)
217 | {
218 | LuaCall z = delegate (IntPtr x) {
219 | int r;
220 |
221 | IntPtr oldOverride = lua_StateOverride;
222 | lua_StateOverride = x;
223 | r = func();
224 | lua_StateOverride = oldOverride;
225 | return r;
226 | };
227 |
228 | luafunctions.Add(z); //prevent it from getting garbage collected
229 | LuaRegister(State, FuncName, z);
230 | }
231 |
232 | public void Register(string FuncName, LuaCall func)
233 | {
234 | LuaCall z = delegate (IntPtr x)
235 | {
236 | int r;
237 | IntPtr oldOverride = lua_StateOverride;
238 | lua_StateOverride = x;
239 | r = func(x);
240 | lua_StateOverride = oldOverride;
241 | return r;
242 | };
243 | luafunctions.Add(z); //prevent it from getting garbage collected
244 | LuaRegister(State, FuncName, z);
245 | }
246 |
247 | public void PushInteger(Int64 i) { lua_pushinteger(State, i); }
248 | public void PushInteger(IntPtr L, Int64 i) { lua_pushinteger(L, i); }
249 |
250 | public void PushNumber(Double n) { lua_pushnumber(State, n); }
251 | public void PushNumber(IntPtr L, Double n) { lua_pushnumber(L, n); }
252 |
253 | public void PushLString(string s, IntPtr size) { lua_pushlstring(State, s, size); }
254 | public void PushLString(IntPtr L, string s, IntPtr size) { lua_pushlstring(L, s, size); }
255 |
256 | public void PushString(string s) { lua_pushstring(State, s); }
257 | public void PushString(IntPtr L, string s) { lua_pushstring(L, s); }
258 |
259 | public void PushBoolean(bool b) { lua_pushboolean(State, b); }
260 | public void PushBoolean(IntPtr L, bool b) { lua_pushboolean(L, b); }
261 |
262 | public void PushCEObject(IntPtr L, IntPtr ceobject) { LuaPushClassInstance(L, ceobject); }
263 | public void PushCEObject(IntPtr ceobject) { LuaPushClassInstance(State, ceobject); }
264 |
265 |
266 | public Boolean IsFunction(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TFUNCTION; }
267 | public Boolean IsFunction(int idx) { return lua_type(State, idx) == LUA_TFUNCTION; }
268 | public Boolean IsTable(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TTABLE; }
269 | public Boolean IsTable(int idx) { return lua_type(State, idx) == LUA_TTABLE; }
270 | public Boolean IsLightUserdata(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TLIGHTUSERDATA; }
271 | public Boolean IsLightUserdata(int idx) { return lua_type(State, idx) == LUA_TLIGHTUSERDATA; }
272 | public Boolean IsHeavyUserdata(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TUSERDATA; }
273 | public Boolean IsHeavyUserdata(int idx) { return lua_type(State, idx) == LUA_TUSERDATA; }
274 | public Boolean IsNil(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TNIL; }
275 | public Boolean IsNil(int idx) { return lua_type(State, idx) == LUA_TNIL; }
276 | public Boolean IsBoolean(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TBOOLEAN; }
277 | public Boolean IsBoolean(int idx) { return lua_type(State, idx) == LUA_TBOOLEAN; }
278 | public Boolean IsThread(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TTHREAD; }
279 | public Boolean IsThread(int idx) { return lua_type(State, idx) == LUA_TTHREAD; }
280 | public Boolean IsNone(IntPtr L, int idx) { return lua_type(L, idx) == LUA_TNONE; }
281 | public Boolean IsNone(int idx) { return lua_type(State, idx) == LUA_TNONE; }
282 | public Boolean IsNoneOrNil(IntPtr L, int idx) { return lua_type(L, idx) <=0; }
283 | public Boolean IsNoneOrNil(int idx) { return lua_type(State, idx) <= 0; }
284 |
285 | public Boolean IsNumber(IntPtr L, int idx) { return lua_isnumber(L, idx); }
286 | public Boolean IsNumber(int idx) { return lua_isnumber(State, idx); }
287 | public Boolean IsInteger(IntPtr L, int idx) { return lua_isinteger(L, idx); }
288 | public Boolean IsInteger(int idx) { return lua_isinteger(State, idx); }
289 | public Boolean IsString(IntPtr L, int idx) { return lua_isstring(L, idx); }
290 | public Boolean IsString(int idx) { return lua_isstring(State, idx); }
291 | public Boolean IsCFunction(IntPtr L, int idx) { return lua_iscfunction(L, idx); }
292 | public Boolean IsCFunction(int idx) { return lua_iscfunction(State, idx); }
293 | public Boolean IsUserData(IntPtr L, int idx) { return lua_isuserdata(L, idx); }
294 | public Boolean IsUserData(int idx) { return lua_isuserdata(State, idx); }
295 | public Boolean IsCEObject(IntPtr L, int idx) { return IsHeavyUserdata(L, idx); }
296 | public Boolean IsCEObject(int idx) { return IsHeavyUserdata(State, idx); }
297 |
298 |
299 |
300 | public double ToNumber(IntPtr L, int idx) { int isnumber = 0; return lua_tonumberx(L, idx, ref isnumber); }
301 | public double ToNumber(int idx) { return ToNumber(State, idx); }
302 | public Int64 ToInteger(IntPtr L, int idx) {
303 | int isnumber = 0;
304 | Int64 r =lua_tointegerx(L, idx, ref isnumber);
305 |
306 | if (isnumber==0)
307 | {
308 | r=(Int64)lua_tonumberx(L, idx, ref isnumber);
309 | if (isnumber == 0)
310 | return 0;
311 | }
312 |
313 | return r;
314 | }
315 | public Int64 ToInteger(int idx) { return ToInteger(State, idx); }
316 |
317 | public bool ToBoolean(IntPtr L, int idx) { return lua_toboolean(L, idx); }
318 | public bool ToBoolean(int idx) { return lua_toboolean(State, idx); }
319 |
320 | public string ToLString(IntPtr L, int idx, ref IntPtr count)
321 | {
322 | IntPtr ps=lua_tolstring(L, idx, IntPtr.Zero);
323 | string s=Marshal.PtrToStringAnsi(ps);
324 | return s;
325 | }
326 | public string ToLString(int idx, ref IntPtr count) { return ToLString(State, idx, ref count); }
327 |
328 | public IntPtr ToCEObject(IntPtr L, int idx)
329 | {
330 | IntPtr p = lua_touserdata(L, idx);
331 | p=Marshal.ReadIntPtr(p);
332 |
333 | return p;
334 | }
335 | public IntPtr ToCEObject(int idx) { return ToCEObject(State, idx); }
336 |
337 | public int ObjLen(IntPtr L, int idx) { return lua_rawlen(L, idx); }
338 | public int ObjLen(int idx) { return lua_rawlen(State, idx); }
339 | public int GetTable(IntPtr L, int idx) { return lua_gettable(L, idx); }
340 | public int GetTable(int idx) { return lua_gettable(State, idx); }
341 | public int SetTable(IntPtr L, int idx) { return lua_settable(L, idx); }
342 | public int SetTable(int idx) { return lua_settable(State, idx); }
343 |
344 | public string ToString(IntPtr L, int idx)
345 | {
346 | IntPtr len = (IntPtr)ObjLen(L, idx);
347 | return ToLString(L, idx, ref len);
348 | }
349 | public string ToString(int idx) { return ToString(State, idx); }
350 |
351 | public int PCall(IntPtr L, int nargs, int nresults) {
352 | int pcr=lua_pcallk(L, nargs, nresults, IntPtr.Zero, IntPtr.Zero);
353 | if (pcr!=0)
354 | throw new System.ApplicationException("PCall failed with error " + pcr.ToString() + " (" + ToString(-1) + ")");
355 |
356 | return pcr;
357 | }
358 | public int PCall(int nargs, int nresults) { return PCall(State, nargs, nresults); }
359 |
360 |
361 | public int Call(IntPtr L, int nargs, int nresults) { return lua_callk(L, nargs, nresults, IntPtr.Zero, IntPtr.Zero); }
362 | public int Call(int nargs, int nresults) { return lua_callk(State, nargs, nresults, IntPtr.Zero, IntPtr.Zero); }
363 |
364 | public int LoadString(IntPtr L, string script) { return luaL_loadstring(L, script); }
365 | public int LoadString(string script) { return luaL_loadstring(State, script); }
366 |
367 | public int DoString(string x)
368 | {
369 | LoadString(x);
370 | return PCall(0, -1);
371 | }
372 |
373 | [ThreadStatic]
374 | static IntPtr lua_StateOverride = (IntPtr)0;
375 |
376 | private IntPtr GetLuaState()
377 | {
378 | if (lua_StateOverride != IntPtr.Zero)
379 | return lua_StateOverride;
380 |
381 | if (_GetLuaState == null)
382 | _GetLuaState = Marshal.GetDelegateForFunctionPointer(sdk.pluginexports.GetLuaState);
383 |
384 | /*
385 | if (lua_State==(IntPtr)0)
386 | {
387 |
388 |
389 | lua_State = _GetLuaState();
390 | }
391 | */
392 | return _GetLuaState();
393 | }
394 |
395 | public CESDKLua(CESDK sdk)
396 | {
397 | //init lua
398 | IntPtr hLibLua=LoadLibraryA("lua53-32.dll");
399 |
400 | if (hLibLua == IntPtr.Zero)
401 | hLibLua = LoadLibraryA("lua53-64.dll");
402 |
403 | if (hLibLua != IntPtr.Zero)
404 | {
405 | //load the most commonly used functions
406 | lua_gettop = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_gettop"));
407 | lua_settop = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_settop"));
408 | lua_pushvalue = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushvalue"));
409 | lua_rotate = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_rotate"));
410 | lua_copy = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_copy"));
411 | lua_pushcclosure = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushcclosure"));
412 | lua_setglobal = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_setglobal"));
413 | lua_getglobal = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_getglobal"));
414 | lua_pushnil = Marshal.GetDelegateForFunctionPointer (GetProcAddress(hLibLua, "lua_pushnil"));
415 | lua_pushinteger = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushinteger"));
416 | lua_pushnumber = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushnumber"));
417 | lua_pushlstring = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushlstring"));
418 | lua_pushstring = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushstring"));
419 | lua_pushboolean = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pushboolean"));
420 |
421 |
422 | lua_type = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_type"));
423 |
424 | lua_isnumber = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_isnumber"));
425 | lua_isinteger = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_isinteger"));
426 | lua_isstring = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_isstring"));
427 | lua_iscfunction = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_iscfunction"));
428 | lua_isuserdata = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_isuserdata"));
429 |
430 | lua_tonumberx = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_tonumberx"));
431 | lua_tointegerx = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_tointegerx"));
432 |
433 | lua_toboolean = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_toboolean"));
434 | lua_tolstring = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_tolstring"));
435 | lua_touserdata = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_touserdata"));
436 |
437 | lua_rawlen = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_rawlen"));
438 |
439 | lua_gettable = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_gettable"));
440 | lua_settable = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_settable"));
441 |
442 |
443 |
444 | lua_callk = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_callk"));
445 | lua_pcallk = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "lua_pcallk"));
446 |
447 | luaL_loadstring = Marshal.GetDelegateForFunctionPointer(GetProcAddress(hLibLua, "luaL_loadstring"));
448 | }
449 |
450 | LuaRegister = Marshal.GetDelegateForFunctionPointer(sdk.pluginexports.LuaRegister);
451 |
452 | LuaPushClassInstance = Marshal.GetDelegateForFunctionPointer(sdk.pluginexports.LuaPushClassInstance);
453 |
454 |
455 |
456 | this.sdk = sdk;
457 | }
458 |
459 | }
460 | }
461 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SDK/FoundList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CESDK
8 | {
9 | //Not much of an SDK but more an example of how to wrap the exposed classes by CE into C# classes. Learn from this and implement the other features you like
10 |
11 |
12 | class FoundList :CEObjectWrapper
13 | {
14 | public int Count { get { return GetCount(); } }
15 |
16 | int GetCount()
17 | {
18 | try
19 | {
20 | lua.PushCEObject(CEObject);
21 | lua.PushString("Count");
22 | lua.GetTable(-2);
23 |
24 | return (int)lua.ToInteger(-1);
25 | }
26 | finally
27 | {
28 | lua.SetTop(0);
29 | }
30 | }
31 |
32 | public string GetAddress(int i)
33 | {
34 |
35 | try
36 | {
37 | lua.PushCEObject(CEObject);
38 | lua.PushString("Address");
39 | lua.GetTable(-2);
40 |
41 | if (lua.IsTable(-1))
42 | {
43 | lua.PushInteger(i);
44 | lua.GetTable(-2); //gets index i from the Address table (pushInteger increased the stack by 1 so the -1 turned to -2, just in case you wanted to know...)
45 | return lua.ToString(-1);
46 | }
47 | }
48 | finally
49 | {
50 | lua.SetTop(0);
51 | }
52 |
53 | return "Error";
54 | }
55 |
56 | public string GetValue(int i)
57 | {
58 |
59 | try
60 | {
61 | lua.PushCEObject(CEObject);
62 | lua.PushString("Value");
63 | lua.GetTable(-2);
64 |
65 | if (lua.IsTable(-1))
66 | {
67 | lua.PushInteger(i);
68 | lua.GetTable(-2); //gets index i from the Address table (pushInteger increased the stack by 1 so the -1 turned to -2, just in case you wanted to know...)
69 | return lua.ToString(-1);
70 | }
71 | }
72 | finally
73 | {
74 | lua.SetTop(0);
75 | }
76 |
77 | return "Error";
78 | }
79 |
80 | public void Initialize()
81 | {
82 | try
83 | {
84 | lua.PushCEObject(CEObject);
85 |
86 | lua.PushString("initialize");
87 | lua.GetTable(-2);
88 |
89 | if (lua.IsFunction(-1) == false)
90 | throw new System.ApplicationException("foundlist with no initialize method");
91 |
92 | lua.PCall(0, 0);
93 | }
94 | finally
95 | {
96 | lua.SetTop(0);
97 | }
98 | }
99 |
100 | public FoundList(MemScan ms)
101 | {
102 | try
103 | {
104 | lua.GetGlobal("createFoundList");
105 | if (lua.IsNil(-1))
106 | throw new System.ApplicationException("You have no createFoundList (WTF)");
107 |
108 | lua.PushCEObject(ms.obj);
109 | int pcr = lua.PCall(1, 1);
110 |
111 | if (lua.IsCEObject(-1))
112 | CEObject = lua.ToCEObject(-1);
113 | else
114 | throw new System.ApplicationException("No idea what it returned");
115 | }
116 | finally
117 | {
118 | lua.SetTop(0);
119 | }
120 |
121 | }
122 |
123 |
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SDK/MemScan.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CESDK
8 | {
9 | //Not much of an SDK but more an example of how to wrap the exposed classes by CE into C# classes. Learn from this and implement the other features you like
10 |
11 | public enum ScanOptions
12 | {
13 | soUnknownValue = 0,
14 | soExactValue = 1,
15 | soValueBetween = 2,
16 | soBiggerThan = 3,
17 | soSmallerThan = 4,
18 | soIncreasedValue = 5,
19 | soIncreasedValueBy = 6,
20 | soDecreasedValue = 7,
21 | soDecreasedValueBy = 8,
22 | soChanged = 9,
23 | soUnchanged = 10
24 | }
25 |
26 | public enum VarTypes
27 | {
28 | vtByte = 0,
29 | vtWord = 1,
30 | vtDword = 2,
31 | vtQword = 3,
32 | vtSingle = 4,
33 | vtDouble = 5,
34 | vtString = 6,
35 | vtUnicodeString = 7, //--Only used by autoguess
36 | vtWideString = 7,
37 | vtByteArray = 8,
38 | vtBinary = 9,
39 | vtAll = 10,
40 | vtAutoAssembler = 11,
41 | vtPointer = 12, //--Only used by autoguess and structures
42 | vtCustom = 13,
43 | vtGrouped = 14
44 | }
45 |
46 | public enum RoundingTypes
47 | {
48 | rtRounded = 0,
49 | rtExtremerounded = 1,
50 | rtTruncated = 2
51 | }
52 |
53 | public enum FastScanMethods
54 | {
55 | fsmNotAligned = 0,
56 | fsmAligned = 1,
57 | fsmLastDigits = 2
58 | }
59 |
60 | public class ScanParameters
61 | {
62 | public string Value;
63 | public string Value2; //needed for between
64 | public ScanOptions ScanOption;
65 | public VarTypes VarType;
66 | public RoundingTypes RoundingType;
67 | public UInt64 StartAddress;
68 | public UInt64 StopAddress;
69 | public string ProtectionFlags;
70 | public FastScanMethods AlignmentType;
71 | public string AlignmentValue;
72 | public bool isHexadecimalInput;
73 | public bool isUTF16Scan;
74 | public bool isCaseSensitive; //for strings
75 | public bool isPercentageScan; //next scan
76 |
77 | public ScanParameters()
78 | {
79 | //default config
80 | ScanOption = ScanOptions.soExactValue;
81 | VarType = VarTypes.vtDword;
82 | RoundingType = RoundingTypes.rtExtremerounded;
83 | StartAddress = 0;
84 | StopAddress = (UInt64)(Int64.MaxValue);
85 | ProtectionFlags = "+W-C"; //wirable, not copy-on-write, and ignore execute
86 | AlignmentType = FastScanMethods.fsmAligned;
87 | AlignmentValue = "4";
88 | isHexadecimalInput = false;
89 | isUTF16Scan = false;
90 | isCaseSensitive = false;
91 | isPercentageScan = false;
92 | }
93 | }
94 |
95 | class MemScan : CEObjectWrapper
96 | {
97 | private bool scanStarted;
98 |
99 | public delegate void dScanDone(object sender);
100 | public delegate void dGUIUpdate(object sender, UInt64 TotalAddressesToScan, UInt64 CurrentlyScanned, UInt64 ResultsFound);
101 |
102 | public dScanDone OnScanDone;
103 | public dGUIUpdate OnGuiUpdate;
104 |
105 |
106 | public void WaitTillDone()
107 | {
108 | lua.PushCEObject(CEObject);
109 | lua.PushString("waitTillDone");
110 | lua.GetTable(-2);
111 |
112 | if (lua.IsFunction(-1) == false) throw new System.ApplicationException("memscan object without a waitTillDone method");
113 |
114 | lua.PCall(0, 0);
115 | lua.SetTop(0);
116 | }
117 |
118 | public void Scan(ScanParameters p)
119 | {
120 | try
121 | {
122 | lua.PushCEObject(CEObject);
123 |
124 |
125 | if (scanStarted == false)
126 | {
127 | //first scan
128 | lua.PushString("firstScan");
129 | lua.GetTable(-2);
130 |
131 | if (lua.IsFunction(-1)==false) throw new System.ApplicationException("memscan object without a firstScan method");
132 |
133 | lua.PushInteger((long)p.ScanOption);
134 | lua.PushInteger((long)p.VarType);
135 | lua.PushInteger((long)p.RoundingType);
136 | lua.PushString(p.Value);
137 | lua.PushString(p.Value2);
138 | lua.PushInteger((long)p.StartAddress);
139 | lua.PushInteger((long)p.StopAddress);
140 | lua.PushString(p.ProtectionFlags);
141 | lua.PushInteger((long)p.AlignmentType);
142 | lua.PushString(p.AlignmentValue);
143 | lua.PushBoolean(p.isHexadecimalInput);
144 | lua.PushBoolean(true); //isnotabinarystring
145 | lua.PushBoolean(p.isUTF16Scan);
146 | lua.PushBoolean(p.isCaseSensitive);
147 | lua.PCall(14, 0);
148 |
149 | scanStarted = true;
150 | }
151 | else
152 | {
153 | //next scan
154 | lua.PushString("nextScan");
155 | lua.GetTable(-2);
156 |
157 | //nextScan(scanoption, roundingtype, input1,input2, isHexadecimalInput, isNotABinaryString, isunicodescan, iscasesensitive, ispercentagescan, savedresultname OPTIONAL);
158 |
159 | if (lua.IsFunction(-1) == false) throw new System.ApplicationException("memscan object without a nextScan method");
160 |
161 | lua.PushInteger((long)p.ScanOption);
162 | lua.PushInteger((long)p.RoundingType);
163 | lua.PushString(p.Value);
164 | lua.PushString(p.Value2);
165 | lua.PushBoolean(p.isHexadecimalInput);
166 | lua.PushBoolean(true);
167 | lua.PushBoolean(p.isUTF16Scan);
168 | lua.PushBoolean(p.isCaseSensitive);
169 | lua.PushBoolean(p.isPercentageScan);
170 | lua.PCall(9, 0);
171 | }
172 | }
173 | finally
174 | {
175 | lua.SetTop(0);
176 | }
177 |
178 | }
179 |
180 | public void Reset()
181 | {
182 | //new scan
183 | lua.PushCEObject(CEObject);
184 | lua.PushString("newScan");
185 | lua.GetTable(-2);
186 |
187 | if (lua.IsFunction(-1) == false) throw new System.ApplicationException("memscan object without a newScan method");
188 |
189 | lua.PCall(0, 0);
190 | lua.SetTop(0);
191 |
192 | scanStarted = false;
193 | }
194 |
195 | private int LScanDone(IntPtr L)
196 | {
197 | //function(memscan) - called when the scan has finished
198 | if (OnScanDone != null)
199 | OnScanDone(this);
200 |
201 | return 0;
202 | }
203 |
204 | private int LGuiUpdate(IntPtr L)
205 | {
206 | //function(memscan, TotalAddressesToScan, CurrentlyScanned, ResultsFound) - Called during the scan so you can update the interface if needed
207 | if (OnGuiUpdate != null)
208 | {
209 | if (lua.GetTop()>=4)
210 | OnGuiUpdate(this, (UInt64)lua.ToInteger(2), (UInt64)lua.ToInteger(3), (UInt64)lua.ToInteger(4));
211 | }
212 |
213 | return 0;
214 | }
215 |
216 | CESDKLua.LuaCall dLScanDone; //prevent garbage collection
217 | CESDKLua.LuaCall dLGuiUpdate;
218 |
219 |
220 | ///
221 | /// Gets a MemScan object from CE
222 | ///
223 | public MemScan()
224 | {
225 | try
226 | {
227 | lua.GetGlobal("createMemScan");
228 | if (lua.IsNil(-1))
229 | throw new System.ApplicationException("You have no createFoundList (WTF)");
230 |
231 | lua.PCall(0, 1);
232 |
233 | if (lua.IsCEObject(-1))
234 | {
235 | CEObject = lua.ToCEObject(-1);
236 |
237 | //setup what happens when the scan is done
238 | dLScanDone = LScanDone;
239 | dLGuiUpdate = LGuiUpdate;
240 |
241 | lua.PushString("OnScanDone");
242 | lua.PushFunction(dLScanDone);
243 | lua.SetTable(-3);
244 |
245 | lua.PushString("OnGuiUpdate");
246 | lua.PushFunction(dLGuiUpdate);
247 | lua.SetTable(-3);
248 |
249 | }
250 | else
251 | throw new System.ApplicationException("No idea what it returned");
252 |
253 | }
254 | finally
255 | {
256 | lua.SetTop(0);
257 | }
258 | }
259 | }
260 | }
261 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SignatureGenerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 | using CESDK;
9 | using AOBSignatureGenerator.Forms;
10 |
11 | namespace AOBSignatureGenerator
12 | {
13 | ///
14 | /// SignatureGenerator
15 | ///
16 | public class SignatureGenerator : CESDKPluginClass
17 | {
18 | ///
19 | /// GetPluginName
20 | ///
21 | /// string
22 | public override string GetPluginName()
23 | {
24 | return " Misc Plugins for CE 7.1+ - written by HawkeyeZAR";
25 | }
26 |
27 | ///
28 | /// called when disabled
29 | ///
30 | /// bool
31 | public override bool DisablePlugin()
32 | {
33 |
34 | return true;
35 | }
36 |
37 | ///
38 | /// EnablePlugin
39 | ///
40 | /// bool
41 | public override bool EnablePlugin() //called when enabled
42 | {
43 | //you can use sdk here
44 | //sdk.lua.dostring("print('I am alive')");
45 | sdk.lua.Register("AOBSignature", LoadGUI);
46 | sdk.lua.Register("MainWindowDisplayUtils", LoadShowHide);
47 | sdk.lua.Register("HexDecCalculator", LoadCalc);
48 |
49 | sdk.lua.DoString(@"local m=MainForm.Menu
50 | local topm=createMenuItem(m)
51 | topm.Caption='Misc Utils'
52 | m.Items.insert(MainForm.miHelp.MenuIndex,topm)
53 | local mf1=createMenuItem(m)
54 | mf1.Caption='AOB Sig Creator .Net';
55 | mf1.OnClick=function(s)
56 | local i=AOBSignature(1)
57 | end
58 | topm.add(mf1)
59 |
60 | local mf2=createMenuItem(m)
61 | mf2.Caption='Change MainWindow Display Options';
62 | mf2.OnClick=function(s)
63 | local i=MainWindowDisplayUtils(1)
64 | end
65 | topm.add(mf2)
66 |
67 | local mf3=createMenuItem(m)
68 | mf3.Caption='Hex Decimal Calculator';
69 | mf3.OnClick=function(s)
70 | local i=HexDecCalculator(1)
71 | end
72 | topm.add(mf3)");
73 |
74 | //atom0s from forum.cheatengine.org gave me a better way to save the Forms
75 | sdk.lua.DoString(@"function hideForms()
76 | local ret = {};
77 | local cnt = getFormCount();
78 | for x = 0, cnt - 1 do
79 | local frm = getForm(x);
80 | if (frm ~= nil and frm.getVisible()) then
81 | frm.hide();
82 | local addr = readIntegerLocal(tonumber(tostring(frm):sub(11), 16));
83 | table.insert(ret, addr);
84 | end
85 | end
86 | return ret;
87 | end");
88 | sdk.lua.DoString(@"function showForms(t)
89 | local function hasval(t, val)
90 | for _, v in pairs(t) do
91 | if (v == val) then
92 | return true;
93 | end
94 | end
95 | return false;
96 | end
97 | local cnt = getFormCount();
98 | for x = 0, cnt - 1 do
99 | local frm = getForm(x);
100 | if (frm ~= nil) then
101 | local addr = readIntegerLocal(tonumber(tostring(frm):sub(11), 16));
102 | if (hasval(t, addr)) then
103 | frm.show();
104 | end
105 | end
106 | end
107 | end");
108 | return true;
109 | }
110 |
111 | ///
112 | /// Creates Main Form
113 | ///
114 | public void AOBSignatureForm()
115 | {
116 | int i = sdk.lua.GetTop();
117 | SignatureGeneratorForm formGen = new SignatureGeneratorForm();
118 |
119 | try
120 | {
121 | System.Windows.Forms.Application.Run(formGen);
122 | }
123 | catch (Exception ex)
124 | {
125 | MessageBox.Show(ex.Message);
126 | }
127 | }
128 |
129 | ///
130 | /// Create Second Form for HideShow Main Screen function
131 | ///
132 | public void HideShowForm()
133 | {
134 | int i = sdk.lua.GetTop();
135 | HideShowMainForm hideShow = new HideShowMainForm();
136 | try
137 | {
138 | System.Windows.Forms.Application.Run(hideShow);
139 | }
140 | catch (Exception ex)
141 | {
142 | MessageBox.Show(ex.Message);
143 | }
144 | }
145 | ///
146 | /// Create third form, calculator form
147 | ///
148 | public void CalcForm()
149 | {
150 | int i = sdk.lua.GetTop();
151 | Calculator calcShow = new Calculator();
152 | try
153 | {
154 | System.Windows.Forms.Application.Run(calcShow);
155 | }
156 | catch (Exception ex)
157 | {
158 | MessageBox.Show(ex.Message);
159 | }
160 | }
161 | ///
162 | /// LoadGUI - Runs AOBSignatureForm in new Thread
163 | ///
164 | /// int
165 | public int LoadGUI()
166 | {
167 | if (sdk.lua.ToBoolean(1))
168 | {
169 | //run in a thread
170 | Thread thr = new Thread(AOBSignatureForm);
171 | thr.Start();
172 | }
173 | return 1;
174 | }
175 |
176 | ///
177 | /// LoadShowHide - Runs HideShowForm in new Thread
178 | ///
179 | /// int
180 | public int LoadShowHide()
181 | {
182 | if (sdk.lua.ToBoolean(1))
183 | {
184 | //run in a thread
185 | Thread thr = new Thread(HideShowForm);
186 | thr.Start();
187 | }
188 | return 1;
189 | }
190 |
191 | ///
192 | /// LoadCalc - Loads Calculator form in new thread
193 | ///
194 | /// int
195 | public int LoadCalc()
196 | {
197 | if (sdk.lua.ToBoolean(1))
198 | {
199 | //run in a thread
200 | Thread thr = new Thread(CalcForm);
201 | thr.Start();
202 | }
203 | return 1;
204 | }
205 |
206 | }
207 | }
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SignatureGenerator.cs.old:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 | using CESDK;
9 | using AOBSignatureGenerator.Forms;
10 |
11 | namespace AOBSignatureGenerator
12 | {
13 | public class SignatureGenerator : CESDKPluginClass
14 | {
15 | public override string GetPluginName()
16 | {
17 | return " Misc Plugins for CE 7.1+ - written by HawkeyeZAR";
18 | }
19 |
20 | public override bool DisablePlugin() //called when disabled
21 | {
22 |
23 | return true;
24 | }
25 |
26 | public override bool EnablePlugin() //called when enabled
27 | {
28 | //you can use sdk here
29 | //sdk.lua.dostring("print('I am alive')");
30 | sdk.lua.Register("AOBSignature", LoadGUI);
31 | //sdk.lua.Register("MaindWindowMods", LoadShowHide);
32 | sdk.lua.DoString(@"local m=MainForm.Menu
33 | local topm=createMenuItem(m)
34 | topm.Caption='Misc Utils'
35 | m.Items.insert(MainForm.miHelp.MenuIndex,topm)
36 | local mf1=createMenuItem(m)
37 | mf1.Caption='AOB Sig Creator .Net';
38 | mf1.OnClick=function(s)
39 | local newthread=MessageDialog('Open the form in a new thread? (If not it will open inside the main GUI)',mtConfirmation,mbYes,mbNo)==mrYes
40 | local i=AOBSignature(newthread)
41 | end
42 | topm.add(mf1)
43 | // Add HideShowMainForm to a second button and add to main button
44 | local mf2=createMenuItem(m)
45 | mf2.Caption='Modify Main Window View';
46 | mf2.OnClick = function(s)
47 | local i=MaindWindowMods(newthread)
48 | end
49 | topm.add(mf2)");
50 | return true;
51 | }
52 |
53 | //Create Main Form
54 | public void AOBSignatureForm()
55 | {
56 | int i = sdk.lua.GetTop();
57 | SignatureGeneratorForm formGen = new SignatureGeneratorForm();
58 | try
59 | {
60 | System.Windows.Forms.Application.Run(formGen);
61 | }
62 | catch (Exception ex)
63 | {
64 | MessageBox.Show(ex.Message);
65 | }
66 | }
67 |
68 | //Create Second Form for HideShow Main Screen function
69 | public void HideShowForm()
70 | {
71 | int i = sdk.lua.GetTop();
72 | HideShowMainForm hideShow = new HideShowMainForm();
73 | try
74 | {
75 | System.Windows.Forms.Application.Run(hideShow);
76 | }
77 | catch (Exception ex)
78 | {
79 | MessageBox.Show(ex.Message);
80 | }
81 | }
82 | int LoadGUI()
83 | {
84 | if (sdk.lua.ToBoolean(1))
85 | {
86 | //run in a thread
87 | Thread thr = new Thread(AOBSignatureForm);
88 | thr.Start();
89 | }
90 | else
91 | {
92 | //run in the current thread (kinda)
93 | AOBSignatureForm();
94 | }
95 | return 1;
96 | }
97 |
98 | int LoadShowHide()
99 | {
100 | if (sdk.lua.ToBoolean(1))
101 | {
102 | //run in a thread
103 | Thread thr = new Thread(HideShowForm);
104 | thr.Start();
105 | }
106 | else
107 | {
108 | //run in the current thread (kinda)
109 | HideShowForm();
110 | ;
111 | }
112 | return 1;
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SignatureGeneratorForm.Designer.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace AOBSignatureGenerator
3 | {
4 | partial class SignatureGeneratorForm
5 | {
6 | ///
7 | /// Required designer variable.
8 | ///
9 | private System.ComponentModel.IContainer components = null;
10 |
11 | ///
12 | /// Clean up any resources being used.
13 | ///
14 | /// true if managed resources should be disposed; otherwise, false.
15 | protected override void Dispose(bool disposing)
16 | {
17 | if (disposing && (components != null))
18 | {
19 | components.Dispose();
20 | }
21 | base.Dispose(disposing);
22 | }
23 |
24 | #region Windows Form Designer generated code
25 |
26 | ///
27 | /// Required method for Designer support - do not modify
28 | /// the contents of this method with the code editor.
29 | ///
30 | private void InitializeComponent()
31 | {
32 | this.textBoxInput = new System.Windows.Forms.TextBox();
33 | this.textBoxOutput = new System.Windows.Forms.TextBox();
34 | this.labelInputData = new System.Windows.Forms.Label();
35 | this.labelOutputData = new System.Windows.Forms.Label();
36 | this.buttonAOB = new System.Windows.Forms.Button();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.textBoxOutput2 = new System.Windows.Forms.TextBox();
39 | this.SuspendLayout();
40 | //
41 | // textBoxInput
42 | //
43 | this.textBoxInput.Location = new System.Drawing.Point(12, 31);
44 | this.textBoxInput.Multiline = true;
45 | this.textBoxInput.Name = "textBoxInput";
46 | this.textBoxInput.Size = new System.Drawing.Size(776, 160);
47 | this.textBoxInput.TabIndex = 0;
48 | //
49 | // textBoxOutput
50 | //
51 | this.textBoxOutput.Location = new System.Drawing.Point(12, 232);
52 | this.textBoxOutput.Name = "textBoxOutput";
53 | this.textBoxOutput.Size = new System.Drawing.Size(776, 22);
54 | this.textBoxOutput.TabIndex = 1;
55 | //
56 | // labelInputData
57 | //
58 | this.labelInputData.AutoSize = true;
59 | this.labelInputData.Location = new System.Drawing.Point(13, 9);
60 | this.labelInputData.Name = "labelInputData";
61 | this.labelInputData.Size = new System.Drawing.Size(158, 16);
62 | this.labelInputData.TabIndex = 2;
63 | this.labelInputData.Text = "Enter your AOB data here";
64 | //
65 | // labelOutputData
66 | //
67 | this.labelOutputData.AutoSize = true;
68 | this.labelOutputData.Location = new System.Drawing.Point(12, 210);
69 | this.labelOutputData.Name = "labelOutputData";
70 | this.labelOutputData.Size = new System.Drawing.Size(209, 16);
71 | this.labelOutputData.TabIndex = 3;
72 | this.labelOutputData.Text = "AOB Signature Data With Spacing";
73 | //
74 | // buttonAOB
75 | //
76 | this.buttonAOB.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
77 | this.buttonAOB.Location = new System.Drawing.Point(335, 319);
78 | this.buttonAOB.Name = "buttonAOB";
79 | this.buttonAOB.Size = new System.Drawing.Size(126, 41);
80 | this.buttonAOB.TabIndex = 4;
81 | this.buttonAOB.Text = "Create Signature";
82 | this.buttonAOB.UseVisualStyleBackColor = true;
83 | this.buttonAOB.Click += new System.EventHandler(this.buttonAOB_Click);
84 | //
85 | // label1
86 | //
87 | this.label1.AutoSize = true;
88 | this.label1.Location = new System.Drawing.Point(12, 271);
89 | this.label1.Name = "label1";
90 | this.label1.Size = new System.Drawing.Size(201, 16);
91 | this.label1.TabIndex = 5;
92 | this.label1.Text = "AOB Signature Data No Spacing";
93 | //
94 | // textBoxOutput2
95 | //
96 | this.textBoxOutput2.Location = new System.Drawing.Point(12, 291);
97 | this.textBoxOutput2.Name = "textBoxOutput2";
98 | this.textBoxOutput2.Size = new System.Drawing.Size(776, 22);
99 | this.textBoxOutput2.TabIndex = 6;
100 | //
101 | // SignatureGeneratorForm
102 | //
103 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
105 | this.ClientSize = new System.Drawing.Size(800, 373);
106 | this.Controls.Add(this.textBoxOutput2);
107 | this.Controls.Add(this.label1);
108 | this.Controls.Add(this.buttonAOB);
109 | this.Controls.Add(this.labelOutputData);
110 | this.Controls.Add(this.labelInputData);
111 | this.Controls.Add(this.textBoxOutput);
112 | this.Controls.Add(this.textBoxInput);
113 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
114 | this.Name = "SignatureGeneratorForm";
115 | this.Text = "AOB Signature Generator";
116 | this.ResumeLayout(false);
117 | this.PerformLayout();
118 |
119 | }
120 |
121 | #endregion
122 |
123 | private System.Windows.Forms.TextBox textBoxInput;
124 | private System.Windows.Forms.TextBox textBoxOutput;
125 | private System.Windows.Forms.Label labelInputData;
126 | private System.Windows.Forms.Label labelOutputData;
127 | private System.Windows.Forms.Button buttonAOB;
128 | private System.Windows.Forms.Label label1;
129 | private System.Windows.Forms.TextBox textBoxOutput2;
130 | }
131 | }
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SignatureGeneratorForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Text.RegularExpressions;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace AOBSignatureGenerator
13 | {
14 | public partial class SignatureGeneratorForm : Form
15 | {
16 | public SignatureGeneratorForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private void buttonAOB_Click(object sender, EventArgs e)
22 | {
23 | if (textBoxInput.Text == string.Empty)
24 | {
25 | MessageBox.Show("Please enter some hex data first.", "No Data");
26 | }
27 | else
28 | {
29 | // Call IsValidHexData() method and check if data we are using contains valid hex values
30 | if (IsValidHexData())
31 | {
32 | // Get number of rows with data in textbox
33 | int getLineCount = NumberOfRows();
34 |
35 | //Create list to save cleaned data.
36 | List lines = new List();
37 |
38 | //Find the shortest line in textBoxInput.Lines
39 | int minLen = textBoxInput.Lines[0].Length; //Set initial value
40 | foreach (string line in textBoxInput.Lines)
41 | {
42 | string l = line.Replace(" ", string.Empty);
43 | if (l.Length < minLen && l.Length > 0)
44 | {
45 | minLen = l.Length;
46 | }
47 | }
48 |
49 | //Loop through text from inputTextbox, clean strings, save update lines list
50 | for (int i = 0; i < getLineCount; i++)
51 | {
52 | //if line is blank, skip and dont add to list
53 | if (!String.IsNullOrEmpty(textBoxInput.Lines[i]))
54 | {
55 | string tmpText = textBoxInput.Lines[i].Replace(" ", string.Empty);
56 | //Make sure all strings being added to list has the same length
57 | lines.Add(tmpText.Substring(0, minLen));
58 | }
59 | }
60 |
61 | createSignature(getLineCount, minLen, lines); // Call method to generate AOB Signature
62 | }
63 | // If data contains non hex values, let user no to fix data
64 | else
65 | {
66 | MessageBox.Show("Please check your data, non hex values found and cannot be used", "Bad Hex Values");
67 | }
68 | }
69 | }
70 |
71 | //Create AOB Signature from cleaned data stored in the lines list
72 | private void createSignature(int lCount, int mlen, List lines)
73 | {
74 | string aobSignature = "";
75 | List signature = new List();
76 |
77 | for (int i = 0; i < mlen; i++)
78 | {
79 | //setup to tmp strings
80 | string tmp = "";
81 | string tmpChar = "";
82 | for (int j = 0; j < lCount; j++)
83 | {
84 | if (String.IsNullOrEmpty(tmpChar))
85 | {
86 | tmpChar = lines[j][i].ToString().ToUpper();
87 | }
88 | if (tmpChar == lines[j][i].ToString().ToUpper())
89 | {
90 | tmp = lines[j][i].ToString().ToUpper();
91 | }
92 | else
93 | {
94 | tmp = "?";
95 | break;
96 | }
97 |
98 | }
99 | signature.Add(tmp); //Update our signature list with temp values
100 | }
101 | string res = string.Join("", signature);
102 | //add spacing to the aobSignature
103 | aobSignature = Regex.Replace(res, @"(.{2})", "$1 ");
104 | ////update the output text boxes
105 | textBoxOutput.Text = aobSignature;
106 | textBoxOutput2.Text = res;
107 | }
108 |
109 | //Get number of rows in inputTextBox
110 | private int NumberOfRows()
111 | {
112 | // Get number of rows with data in textbox
113 | int getLineCount = 0;
114 | foreach (string t in textBoxInput.Lines)
115 | {
116 | if (t.Length > 0)
117 | {
118 | getLineCount += 1;
119 | }
120 | }
121 | return getLineCount;
122 | }
123 |
124 | //Check if textboxInput data is valid hex values
125 | private bool IsValidHexData()
126 | {
127 | string validHexValues = "0123456789ABCDEF";
128 | bool isValid = true;
129 |
130 | // Check of each char is a valid hex value, return true, else return false
131 | foreach (char text in Regex.Replace(textBoxInput.Text, @"\s", string.Empty))
132 | {
133 | if (validHexValues.Contains(Char.ToUpper(text)))
134 | {
135 | isValid = true;
136 | }
137 | else
138 | {
139 | isValid = false;
140 | break;
141 | }
142 | }
143 | return isValid;
144 | }
145 | }
146 |
147 | }
148 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/SignatureGeneratorForm.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 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/bin/Debug/AOBSignatureGenerator.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/bin/Debug/AOBSignatureGenerator.dll
--------------------------------------------------------------------------------
/AOBSignatureGenerator/bin/Debug/AOBSignatureGenerator.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/bin/Debug/AOBSignatureGenerator.pdb
--------------------------------------------------------------------------------
/AOBSignatureGenerator/calc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/calc.png
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.Forms.HideShowMainForm.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.Forms.HideShowMainForm.resources
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.SignatureGeneratorForm.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.SignatureGeneratorForm.resources
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 7eec4774ef1e1e56fbd6243a81db0bf427e69820
2 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.csproj.AssemblyReference.cache
2 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.SignatureGeneratorForm.resources
3 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.csproj.GenerateResource.cache
4 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.csproj.CoreCompileInputs.cache
5 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\bin\Debug\AOBSignatureGenerator.dll
6 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\bin\Debug\AOBSignatureGenerator.pdb
7 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.dll
8 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.pdb
9 | C:\Users\HawkeyeZAR\Documents\Visual Studio 2022\Projects\CheatEnginePlugins\AOBSignatureGenerator\obj\Debug\AOBSignatureGenerator.Forms.HideShowMainForm.resources
10 |
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.dll
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/AOBSignatureGenerator.pdb
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/AOBSignatureGenerator/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/AOBSignatureGenerator/ss1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/ss1.jpg
--------------------------------------------------------------------------------
/AOBSignatureGenerator/ss2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/ss2.jpg
--------------------------------------------------------------------------------
/AOBSignatureGenerator/ss3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HawkeyeZAR/CheatEnginePlugins/b8d7ef900bc17b40741053697d75392d018d9a5d/AOBSignatureGenerator/ss3.png
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Jack Ackermann
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.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Misc Util plugins for CheatEngine - C# .Net
2 | ======================================================
3 |
4 | Written in C# using WindowsForms and .Net.
5 |
6 | This dll works with CheatEngine, a debugger and memory hacker used for games.
7 | Currently there are two utils, an AOB Signature Generator and a util to modify Cheat Engines Screen
8 |
9 |
10 | I will try to add more features to this plugin over time.
11 |
12 | AOB Signature Generator
13 | ------------------------
14 | *** I renamed the menu to Misc Utils ***
15 |
16 |
17 | 
18 |
19 |
20 | Change Window Display Options
21 | -----------------------------
22 | 
23 |
24 | 
25 |
26 | Change Cheat Engines Window Title
27 | ---------------------------------
28 | 
29 |
30 |
31 | Basic Hex and Decimal Calculator
32 | ---------------------------------
33 | Update: Increased max values to Int64 (Dec:9223372036854775807 or Hex: 7FFFFFFFFFFFFFFF)
34 |
35 | 
36 |
--------------------------------------------------------------------------------