├── .gitattributes ├── ProxyDllMaker.sln ├── ProxyDllMaker.v11.suo ├── ProxyDllMaker ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── FunctionDialog.Designer.cs ├── FunctionDialog.cs ├── FunctionDialog.resx ├── Helper.cs ├── OptionForm.Designer.cs ├── OptionForm.cs ├── OptionForm.resx ├── Options.cs ├── PEStuff.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ProxyDllMaker.csproj ├── Resources │ └── template_cpp.txt ├── UnDecorator.Designer.cs ├── UnDecorator.cs ├── UnDecorator.resx └── bin │ └── x64 │ └── Release │ └── ProxyDllMaker.exe └── README.MD /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /ProxyDllMaker.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31402.337 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyDllMaker", "ProxyDllMaker\ProxyDllMaker.csproj", "{3120A1EB-F52B-460E-87FB-DBAF640FFBDF}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Release|x64 = Release|x64 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {3120A1EB-F52B-460E-87FB-DBAF640FFBDF}.Release|x64.ActiveCfg = Release|x64 14 | EndGlobalSection 15 | GlobalSection(SolutionProperties) = preSolution 16 | HideSolutionNode = FALSE 17 | EndGlobalSection 18 | GlobalSection(ExtensibilityGlobals) = postSolution 19 | SolutionGuid = {53CEC752-6CDE-4EE0-B1E7-62DEA852F6DE} 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /ProxyDllMaker.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroKilo/ProxyDllMaker/8f020dd780682a0177e5f4bf0a4514557f697050/ProxyDllMaker.v11.suo -------------------------------------------------------------------------------- /ProxyDllMaker/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ProxyDllMaker/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyDllMaker 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Erforderliche Designervariable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Verwendete Ressourcen bereinigen. 12 | /// 13 | /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls 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 Vom Windows Form-Designer generierter Code 24 | 25 | /// 26 | /// Erforderliche Methode für die Designerunterstützung. 27 | /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 32 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 33 | this.openDLLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 34 | this.loadDefinitionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 | this.saveCFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 36 | this.saveDEFFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.generateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.withasmJumpsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.withCallsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 40 | this.withLinksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 41 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); 42 | this.undecorateAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 43 | this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); 44 | this.generateToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); 45 | this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 46 | this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 47 | this.undecoratorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.statusStrip1 = new System.Windows.Forms.StatusStrip(); 49 | this.status = new System.Windows.Forms.ToolStripStatusLabel(); 50 | this.tabControl1 = new System.Windows.Forms.TabControl(); 51 | this.tabPage1 = new System.Windows.Forms.TabPage(); 52 | this.rtb1 = new System.Windows.Forms.RichTextBox(); 53 | this.tabPage2 = new System.Windows.Forms.TabPage(); 54 | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 55 | this.listBox1 = new System.Windows.Forms.ListBox(); 56 | this.rtb4 = new System.Windows.Forms.RichTextBox(); 57 | this.tabPage3 = new System.Windows.Forms.TabPage(); 58 | this.tabControl2 = new System.Windows.Forms.TabControl(); 59 | this.tabPage4 = new System.Windows.Forms.TabPage(); 60 | this.rtb2 = new System.Windows.Forms.RichTextBox(); 61 | this.tabPage5 = new System.Windows.Forms.TabPage(); 62 | this.rtb3 = new System.Windows.Forms.RichTextBox(); 63 | this.menuStrip1.SuspendLayout(); 64 | this.statusStrip1.SuspendLayout(); 65 | this.tabControl1.SuspendLayout(); 66 | this.tabPage1.SuspendLayout(); 67 | this.tabPage2.SuspendLayout(); 68 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 69 | this.splitContainer1.Panel1.SuspendLayout(); 70 | this.splitContainer1.Panel2.SuspendLayout(); 71 | this.splitContainer1.SuspendLayout(); 72 | this.tabPage3.SuspendLayout(); 73 | this.tabControl2.SuspendLayout(); 74 | this.tabPage4.SuspendLayout(); 75 | this.tabPage5.SuspendLayout(); 76 | this.SuspendLayout(); 77 | // 78 | // menuStrip1 79 | // 80 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 81 | this.fileToolStripMenuItem, 82 | this.generateToolStripMenuItem, 83 | this.optionsToolStripMenuItem, 84 | this.toolsToolStripMenuItem}); 85 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 86 | this.menuStrip1.Name = "menuStrip1"; 87 | this.menuStrip1.Size = new System.Drawing.Size(534, 24); 88 | this.menuStrip1.TabIndex = 0; 89 | this.menuStrip1.Text = "menuStrip1"; 90 | // 91 | // fileToolStripMenuItem 92 | // 93 | this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 94 | this.openDLLToolStripMenuItem, 95 | this.loadDefinitionToolStripMenuItem, 96 | this.saveCFileToolStripMenuItem, 97 | this.saveDEFFileToolStripMenuItem}); 98 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; 99 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); 100 | this.fileToolStripMenuItem.Text = "File"; 101 | // 102 | // openDLLToolStripMenuItem 103 | // 104 | this.openDLLToolStripMenuItem.Name = "openDLLToolStripMenuItem"; 105 | this.openDLLToolStripMenuItem.Size = new System.Drawing.Size(164, 22); 106 | this.openDLLToolStripMenuItem.Text = "Open DLL..."; 107 | this.openDLLToolStripMenuItem.Click += new System.EventHandler(this.openDLLToolStripMenuItem_Click); 108 | // 109 | // loadDefinitionToolStripMenuItem 110 | // 111 | this.loadDefinitionToolStripMenuItem.Name = "loadDefinitionToolStripMenuItem"; 112 | this.loadDefinitionToolStripMenuItem.Size = new System.Drawing.Size(164, 22); 113 | this.loadDefinitionToolStripMenuItem.Text = "Load Definition..."; 114 | this.loadDefinitionToolStripMenuItem.Click += new System.EventHandler(this.loadDefinitionToolStripMenuItem_Click); 115 | // 116 | // saveCFileToolStripMenuItem 117 | // 118 | this.saveCFileToolStripMenuItem.Name = "saveCFileToolStripMenuItem"; 119 | this.saveCFileToolStripMenuItem.Size = new System.Drawing.Size(164, 22); 120 | this.saveCFileToolStripMenuItem.Text = "Save C File"; 121 | this.saveCFileToolStripMenuItem.Click += new System.EventHandler(this.saveCFileToolStripMenuItem_Click); 122 | // 123 | // saveDEFFileToolStripMenuItem 124 | // 125 | this.saveDEFFileToolStripMenuItem.Name = "saveDEFFileToolStripMenuItem"; 126 | this.saveDEFFileToolStripMenuItem.Size = new System.Drawing.Size(164, 22); 127 | this.saveDEFFileToolStripMenuItem.Text = "Save DEF File"; 128 | this.saveDEFFileToolStripMenuItem.Click += new System.EventHandler(this.saveDEFFileToolStripMenuItem_Click); 129 | // 130 | // generateToolStripMenuItem 131 | // 132 | this.generateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 133 | this.withasmJumpsToolStripMenuItem, 134 | this.withCallsToolStripMenuItem, 135 | this.withLinksToolStripMenuItem, 136 | this.toolStripMenuItem1, 137 | this.undecorateAllToolStripMenuItem, 138 | this.toolStripMenuItem2, 139 | this.generateToolStripMenuItem1}); 140 | this.generateToolStripMenuItem.Name = "generateToolStripMenuItem"; 141 | this.generateToolStripMenuItem.Size = new System.Drawing.Size(66, 20); 142 | this.generateToolStripMenuItem.Text = "Generate"; 143 | // 144 | // withasmJumpsToolStripMenuItem 145 | // 146 | this.withasmJumpsToolStripMenuItem.Name = "withasmJumpsToolStripMenuItem"; 147 | this.withasmJumpsToolStripMenuItem.Size = new System.Drawing.Size(267, 22); 148 | this.withasmJumpsToolStripMenuItem.Text = "make all/selected with _asm jumps..."; 149 | this.withasmJumpsToolStripMenuItem.Click += new System.EventHandler(this.withasmJumpsToolStripMenuItem_Click); 150 | // 151 | // withCallsToolStripMenuItem 152 | // 153 | this.withCallsToolStripMenuItem.Name = "withCallsToolStripMenuItem"; 154 | this.withCallsToolStripMenuItem.Size = new System.Drawing.Size(267, 22); 155 | this.withCallsToolStripMenuItem.Text = "make all/selected with calls..."; 156 | this.withCallsToolStripMenuItem.Click += new System.EventHandler(this.withCallsToolStripMenuItem_Click); 157 | // 158 | // withLinksToolStripMenuItem 159 | // 160 | this.withLinksToolStripMenuItem.Name = "withLinksToolStripMenuItem"; 161 | this.withLinksToolStripMenuItem.Size = new System.Drawing.Size(267, 22); 162 | this.withLinksToolStripMenuItem.Text = "make all/selected with links..."; 163 | this.withLinksToolStripMenuItem.Click += new System.EventHandler(this.withLinksToolStripMenuItem_Click); 164 | // 165 | // toolStripMenuItem1 166 | // 167 | this.toolStripMenuItem1.Name = "toolStripMenuItem1"; 168 | this.toolStripMenuItem1.Size = new System.Drawing.Size(264, 6); 169 | // 170 | // undecorateAllToolStripMenuItem 171 | // 172 | this.undecorateAllToolStripMenuItem.Name = "undecorateAllToolStripMenuItem"; 173 | this.undecorateAllToolStripMenuItem.Size = new System.Drawing.Size(267, 22); 174 | this.undecorateAllToolStripMenuItem.Text = "Undecorate All"; 175 | this.undecorateAllToolStripMenuItem.Click += new System.EventHandler(this.undecorateAllToolStripMenuItem_Click); 176 | // 177 | // toolStripMenuItem2 178 | // 179 | this.toolStripMenuItem2.Name = "toolStripMenuItem2"; 180 | this.toolStripMenuItem2.Size = new System.Drawing.Size(264, 6); 181 | // 182 | // generateToolStripMenuItem1 183 | // 184 | this.generateToolStripMenuItem1.Name = "generateToolStripMenuItem1"; 185 | this.generateToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F5; 186 | this.generateToolStripMenuItem1.Size = new System.Drawing.Size(267, 22); 187 | this.generateToolStripMenuItem1.Text = "Generate"; 188 | this.generateToolStripMenuItem1.Click += new System.EventHandler(this.generateToolStripMenuItem1_Click); 189 | // 190 | // optionsToolStripMenuItem 191 | // 192 | this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; 193 | this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); 194 | this.optionsToolStripMenuItem.Text = "Options"; 195 | this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); 196 | // 197 | // toolsToolStripMenuItem 198 | // 199 | this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 200 | this.undecoratorToolStripMenuItem}); 201 | this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; 202 | this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); 203 | this.toolsToolStripMenuItem.Text = "Tools"; 204 | // 205 | // undecoratorToolStripMenuItem 206 | // 207 | this.undecoratorToolStripMenuItem.Name = "undecoratorToolStripMenuItem"; 208 | this.undecoratorToolStripMenuItem.Size = new System.Drawing.Size(140, 22); 209 | this.undecoratorToolStripMenuItem.Text = "Undecorator"; 210 | this.undecoratorToolStripMenuItem.Click += new System.EventHandler(this.undecoratorToolStripMenuItem_Click); 211 | // 212 | // statusStrip1 213 | // 214 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 215 | this.status}); 216 | this.statusStrip1.Location = new System.Drawing.Point(0, 467); 217 | this.statusStrip1.Name = "statusStrip1"; 218 | this.statusStrip1.Size = new System.Drawing.Size(534, 22); 219 | this.statusStrip1.TabIndex = 1; 220 | this.statusStrip1.Text = "statusStrip1"; 221 | // 222 | // status 223 | // 224 | this.status.Name = "status"; 225 | this.status.Size = new System.Drawing.Size(10, 17); 226 | this.status.Text = " "; 227 | // 228 | // tabControl1 229 | // 230 | this.tabControl1.Controls.Add(this.tabPage1); 231 | this.tabControl1.Controls.Add(this.tabPage2); 232 | this.tabControl1.Controls.Add(this.tabPage3); 233 | this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; 234 | this.tabControl1.Location = new System.Drawing.Point(0, 24); 235 | this.tabControl1.Name = "tabControl1"; 236 | this.tabControl1.SelectedIndex = 0; 237 | this.tabControl1.Size = new System.Drawing.Size(534, 443); 238 | this.tabControl1.TabIndex = 2; 239 | // 240 | // tabPage1 241 | // 242 | this.tabPage1.Controls.Add(this.rtb1); 243 | this.tabPage1.Location = new System.Drawing.Point(4, 22); 244 | this.tabPage1.Name = "tabPage1"; 245 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 246 | this.tabPage1.Size = new System.Drawing.Size(526, 417); 247 | this.tabPage1.TabIndex = 0; 248 | this.tabPage1.Text = "Overview"; 249 | this.tabPage1.UseVisualStyleBackColor = true; 250 | // 251 | // rtb1 252 | // 253 | this.rtb1.DetectUrls = false; 254 | this.rtb1.Dock = System.Windows.Forms.DockStyle.Fill; 255 | this.rtb1.Font = new System.Drawing.Font("Courier New", 10F); 256 | this.rtb1.Location = new System.Drawing.Point(3, 3); 257 | this.rtb1.Name = "rtb1"; 258 | this.rtb1.Size = new System.Drawing.Size(520, 411); 259 | this.rtb1.TabIndex = 0; 260 | this.rtb1.Text = ""; 261 | this.rtb1.WordWrap = false; 262 | // 263 | // tabPage2 264 | // 265 | this.tabPage2.Controls.Add(this.splitContainer1); 266 | this.tabPage2.Location = new System.Drawing.Point(4, 22); 267 | this.tabPage2.Name = "tabPage2"; 268 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 269 | this.tabPage2.Size = new System.Drawing.Size(526, 417); 270 | this.tabPage2.TabIndex = 1; 271 | this.tabPage2.Text = "Exports"; 272 | this.tabPage2.UseVisualStyleBackColor = true; 273 | // 274 | // splitContainer1 275 | // 276 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 277 | this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 278 | this.splitContainer1.Location = new System.Drawing.Point(3, 3); 279 | this.splitContainer1.Name = "splitContainer1"; 280 | this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 281 | // 282 | // splitContainer1.Panel1 283 | // 284 | this.splitContainer1.Panel1.Controls.Add(this.listBox1); 285 | // 286 | // splitContainer1.Panel2 287 | // 288 | this.splitContainer1.Panel2.Controls.Add(this.rtb4); 289 | this.splitContainer1.Size = new System.Drawing.Size(520, 411); 290 | this.splitContainer1.SplitterDistance = 312; 291 | this.splitContainer1.TabIndex = 0; 292 | // 293 | // listBox1 294 | // 295 | this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill; 296 | this.listBox1.Font = new System.Drawing.Font("Courier New", 10F); 297 | this.listBox1.FormattingEnabled = true; 298 | this.listBox1.IntegralHeight = false; 299 | this.listBox1.ItemHeight = 16; 300 | this.listBox1.Location = new System.Drawing.Point(0, 0); 301 | this.listBox1.Name = "listBox1"; 302 | this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; 303 | this.listBox1.Size = new System.Drawing.Size(520, 312); 304 | this.listBox1.TabIndex = 1; 305 | this.listBox1.Click += new System.EventHandler(this.listBox1_Click); 306 | this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); 307 | this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_DoubleClick_1); 308 | // 309 | // rtb4 310 | // 311 | this.rtb4.DetectUrls = false; 312 | this.rtb4.Dock = System.Windows.Forms.DockStyle.Fill; 313 | this.rtb4.Font = new System.Drawing.Font("Courier New", 10F); 314 | this.rtb4.Location = new System.Drawing.Point(0, 0); 315 | this.rtb4.Name = "rtb4"; 316 | this.rtb4.Size = new System.Drawing.Size(520, 95); 317 | this.rtb4.TabIndex = 1; 318 | this.rtb4.Text = ""; 319 | this.rtb4.WordWrap = false; 320 | // 321 | // tabPage3 322 | // 323 | this.tabPage3.Controls.Add(this.tabControl2); 324 | this.tabPage3.Location = new System.Drawing.Point(4, 22); 325 | this.tabPage3.Name = "tabPage3"; 326 | this.tabPage3.Padding = new System.Windows.Forms.Padding(3); 327 | this.tabPage3.Size = new System.Drawing.Size(526, 417); 328 | this.tabPage3.TabIndex = 2; 329 | this.tabPage3.Text = "Output"; 330 | this.tabPage3.UseVisualStyleBackColor = true; 331 | // 332 | // tabControl2 333 | // 334 | this.tabControl2.Controls.Add(this.tabPage4); 335 | this.tabControl2.Controls.Add(this.tabPage5); 336 | this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill; 337 | this.tabControl2.Location = new System.Drawing.Point(3, 3); 338 | this.tabControl2.Name = "tabControl2"; 339 | this.tabControl2.SelectedIndex = 0; 340 | this.tabControl2.Size = new System.Drawing.Size(520, 411); 341 | this.tabControl2.TabIndex = 2; 342 | // 343 | // tabPage4 344 | // 345 | this.tabPage4.Controls.Add(this.rtb2); 346 | this.tabPage4.Location = new System.Drawing.Point(4, 22); 347 | this.tabPage4.Name = "tabPage4"; 348 | this.tabPage4.Padding = new System.Windows.Forms.Padding(3); 349 | this.tabPage4.Size = new System.Drawing.Size(512, 385); 350 | this.tabPage4.TabIndex = 0; 351 | this.tabPage4.Text = "Generated Code"; 352 | this.tabPage4.UseVisualStyleBackColor = true; 353 | // 354 | // rtb2 355 | // 356 | this.rtb2.DetectUrls = false; 357 | this.rtb2.Dock = System.Windows.Forms.DockStyle.Fill; 358 | this.rtb2.Font = new System.Drawing.Font("Courier New", 10F); 359 | this.rtb2.Location = new System.Drawing.Point(3, 3); 360 | this.rtb2.Name = "rtb2"; 361 | this.rtb2.Size = new System.Drawing.Size(506, 379); 362 | this.rtb2.TabIndex = 1; 363 | this.rtb2.Text = ""; 364 | this.rtb2.WordWrap = false; 365 | // 366 | // tabPage5 367 | // 368 | this.tabPage5.Controls.Add(this.rtb3); 369 | this.tabPage5.Location = new System.Drawing.Point(4, 22); 370 | this.tabPage5.Name = "tabPage5"; 371 | this.tabPage5.Padding = new System.Windows.Forms.Padding(3); 372 | this.tabPage5.Size = new System.Drawing.Size(512, 385); 373 | this.tabPage5.TabIndex = 1; 374 | this.tabPage5.Text = "Generated Definitions"; 375 | this.tabPage5.UseVisualStyleBackColor = true; 376 | // 377 | // rtb3 378 | // 379 | this.rtb3.DetectUrls = false; 380 | this.rtb3.Dock = System.Windows.Forms.DockStyle.Fill; 381 | this.rtb3.Font = new System.Drawing.Font("Courier New", 10F); 382 | this.rtb3.Location = new System.Drawing.Point(3, 3); 383 | this.rtb3.Name = "rtb3"; 384 | this.rtb3.Size = new System.Drawing.Size(506, 379); 385 | this.rtb3.TabIndex = 1; 386 | this.rtb3.Text = ""; 387 | this.rtb3.WordWrap = false; 388 | // 389 | // Form1 390 | // 391 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 392 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 393 | this.ClientSize = new System.Drawing.Size(534, 489); 394 | this.Controls.Add(this.tabControl1); 395 | this.Controls.Add(this.statusStrip1); 396 | this.Controls.Add(this.menuStrip1); 397 | this.MainMenuStrip = this.menuStrip1; 398 | this.Name = "Form1"; 399 | this.Text = "Proxy DLL Maker 1.4 by Warranty Voider"; 400 | this.menuStrip1.ResumeLayout(false); 401 | this.menuStrip1.PerformLayout(); 402 | this.statusStrip1.ResumeLayout(false); 403 | this.statusStrip1.PerformLayout(); 404 | this.tabControl1.ResumeLayout(false); 405 | this.tabPage1.ResumeLayout(false); 406 | this.tabPage2.ResumeLayout(false); 407 | this.splitContainer1.Panel1.ResumeLayout(false); 408 | this.splitContainer1.Panel2.ResumeLayout(false); 409 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 410 | this.splitContainer1.ResumeLayout(false); 411 | this.tabPage3.ResumeLayout(false); 412 | this.tabControl2.ResumeLayout(false); 413 | this.tabPage4.ResumeLayout(false); 414 | this.tabPage5.ResumeLayout(false); 415 | this.ResumeLayout(false); 416 | this.PerformLayout(); 417 | 418 | } 419 | 420 | #endregion 421 | 422 | private System.Windows.Forms.MenuStrip menuStrip1; 423 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; 424 | private System.Windows.Forms.ToolStripMenuItem openDLLToolStripMenuItem; 425 | private System.Windows.Forms.ToolStripMenuItem generateToolStripMenuItem; 426 | private System.Windows.Forms.ToolStripMenuItem withasmJumpsToolStripMenuItem; 427 | private System.Windows.Forms.ToolStripMenuItem withCallsToolStripMenuItem; 428 | private System.Windows.Forms.StatusStrip statusStrip1; 429 | private System.Windows.Forms.ToolStripStatusLabel status; 430 | private System.Windows.Forms.TabControl tabControl1; 431 | private System.Windows.Forms.TabPage tabPage1; 432 | private System.Windows.Forms.RichTextBox rtb1; 433 | private System.Windows.Forms.TabPage tabPage2; 434 | private System.Windows.Forms.TabPage tabPage3; 435 | private System.Windows.Forms.TabControl tabControl2; 436 | private System.Windows.Forms.TabPage tabPage4; 437 | private System.Windows.Forms.RichTextBox rtb2; 438 | private System.Windows.Forms.TabPage tabPage5; 439 | private System.Windows.Forms.RichTextBox rtb3; 440 | private System.Windows.Forms.ToolStripMenuItem saveCFileToolStripMenuItem; 441 | private System.Windows.Forms.ToolStripMenuItem saveDEFFileToolStripMenuItem; 442 | private System.Windows.Forms.ToolStripMenuItem loadDefinitionToolStripMenuItem; 443 | private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; 444 | private System.Windows.Forms.ToolStripMenuItem withLinksToolStripMenuItem; 445 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; 446 | private System.Windows.Forms.ToolStripMenuItem generateToolStripMenuItem1; 447 | private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; 448 | private System.Windows.Forms.ToolStripMenuItem undecoratorToolStripMenuItem; 449 | private System.Windows.Forms.SplitContainer splitContainer1; 450 | private System.Windows.Forms.ListBox listBox1; 451 | private System.Windows.Forms.RichTextBox rtb4; 452 | private System.Windows.Forms.ToolStripMenuItem undecorateAllToolStripMenuItem; 453 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; 454 | } 455 | } 456 | 457 | -------------------------------------------------------------------------------- /ProxyDllMaker/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using System.Runtime.Serialization.Json; 12 | 13 | namespace ProxyDllMaker 14 | { 15 | public partial class Form1 : Form 16 | { 17 | PeHeaderReader header; 18 | List exportlist; 19 | OptionForm optf; 20 | public string lastfilename; 21 | public Form1() 22 | { 23 | InitializeComponent(); 24 | if (File.Exists("settings.txt")) 25 | Options.LoadFromFile("settings.txt"); 26 | } 27 | 28 | private void openDLLToolStripMenuItem_Click(object sender, EventArgs e) 29 | { 30 | OpenFileDialog d = new OpenFileDialog(); 31 | d.Filter = "*.dll|*.dll"; 32 | if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) 33 | { 34 | lastfilename = Path.GetFileNameWithoutExtension(d.FileName); 35 | header = new PeHeaderReader(d.FileName); 36 | if (!header.Is32BitHeader) 37 | { 38 | status.Text = "64 BIT"; 39 | statusStrip1.BackColor = Color.LightBlue; 40 | withasmJumpsToolStripMenuItem.Enabled = false; 41 | } 42 | else 43 | { 44 | status.Text = "32 BIT"; 45 | statusStrip1.BackColor = Color.LightGreen; 46 | withasmJumpsToolStripMenuItem.Enabled = true; 47 | } 48 | rtb1.Text = Helper.DumpObject(header); 49 | try 50 | { 51 | exportlist = Helper.GetExports(d.FileName, Options.symMethod); 52 | RefreshExportList(); 53 | } 54 | catch (Exception ex) 55 | { 56 | MessageBox.Show("Error:\n" + ex.Message); 57 | } 58 | } 59 | } 60 | 61 | private void RefreshExportList() 62 | { 63 | listBox1.Items.Clear(); 64 | listBox1.Visible = false; 65 | foreach (Helper.ExportInfo e in exportlist) 66 | listBox1.Items.Add(Helper.ExportInfoToString(e)); 67 | listBox1.Visible = true; 68 | } 69 | 70 | private void withasmJumpsToolStripMenuItem_Click(object sender, EventArgs e) 71 | { 72 | if (listBox1.SelectedIndices.Count == 0) 73 | for (int i = 0; i < listBox1.Items.Count; i++) 74 | listBox1.SetSelected(i, true); 75 | for (int i = 0; i < listBox1.SelectedIndices.Count; i++) 76 | { 77 | Helper.ExportInfo ex = exportlist[listBox1.SelectedIndices[i]]; 78 | ex.WayOfExport = 1; 79 | exportlist[listBox1.SelectedIndices[i]] = ex; 80 | } 81 | RefreshExportList(); 82 | } 83 | 84 | private void withCallsToolStripMenuItem_Click(object sender, EventArgs e) 85 | { 86 | if (listBox1.SelectedIndices.Count == 0) 87 | for (int i = 0; i < listBox1.Items.Count; i++) 88 | listBox1.SetSelected(i, true); 89 | for (int i = 0; i < listBox1.SelectedIndices.Count; i++) 90 | { 91 | Helper.ExportInfo ex = exportlist[listBox1.SelectedIndices[i]]; 92 | ex.WayOfExport = 2; 93 | exportlist[listBox1.SelectedIndices[i]] = ex; 94 | } 95 | RefreshExportList(); 96 | } 97 | 98 | private void saveCFileToolStripMenuItem_Click(object sender, EventArgs e) 99 | { 100 | SaveFileDialog d = new SaveFileDialog(); 101 | d.Filter = lastfilename + ".c|" + lastfilename + ".c"; 102 | d.FileName = lastfilename + ".c"; 103 | if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) 104 | { 105 | File.WriteAllText(d.FileName, rtb2.Text); 106 | MessageBox.Show("Done."); 107 | } 108 | } 109 | 110 | private void saveDEFFileToolStripMenuItem_Click(object sender, EventArgs e) 111 | { 112 | SaveFileDialog d = new SaveFileDialog(); 113 | d.Filter = lastfilename + ".def|" + lastfilename + ".def"; 114 | d.FileName = lastfilename + ".def"; 115 | if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) 116 | { 117 | File.WriteAllText(d.FileName, rtb3.Text); 118 | MessageBox.Show("Done."); 119 | } 120 | } 121 | 122 | private void optionsToolStripMenuItem_Click(object sender, EventArgs e) 123 | { 124 | if (optf != null) 125 | optf.Close(); 126 | optf = new OptionForm(); 127 | optf.Show(); 128 | } 129 | 130 | private void withLinksToolStripMenuItem_Click(object sender, EventArgs e) 131 | { 132 | if (listBox1.SelectedIndices.Count == 0) 133 | for (int i = 0; i < listBox1.Items.Count; i++) 134 | listBox1.SetSelected(i, true); 135 | for (int i = 0; i < listBox1.SelectedIndices.Count; i++) 136 | { 137 | Helper.ExportInfo ex = exportlist[listBox1.SelectedIndices[i]]; 138 | ex.WayOfExport = 3; 139 | exportlist[listBox1.SelectedIndices[i]] = ex; 140 | } 141 | RefreshExportList(); 142 | } 143 | 144 | private void loadDefinitionToolStripMenuItem_Click(object sender, EventArgs e) 145 | { 146 | OpenFileDialog d = new OpenFileDialog(); 147 | d.Filter = "*.c;*.h;*.txt|*.c;*.h;*.txt"; 148 | if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) 149 | { 150 | string[] input = File.ReadAllLines(d.FileName); 151 | StringBuilder sb = new StringBuilder(); 152 | for (int i = 0; i < exportlist.Count; i++) 153 | if(exportlist[i].WayOfExport == 2) 154 | { 155 | 156 | bool found = false; 157 | foreach (string line in input) 158 | if (line.Contains(exportlist[i].Name + "(")) 159 | { 160 | Helper.ExportInfo info = exportlist[i]; 161 | info.Definition = line.Trim(); 162 | exportlist[i] = info; 163 | found = true; 164 | break; 165 | } 166 | if (!found) 167 | { 168 | sb.AppendLine(exportlist[i].Name); 169 | Helper.ExportInfo ex = exportlist[i]; 170 | ex.WayOfExport = 0; 171 | exportlist[i] = ex; 172 | } 173 | } 174 | RefreshExportList(); 175 | if (sb.Length != 0) 176 | MessageBox.Show("Error: no definition(s) found for:\n" + sb.ToString()+ "\n please use \"asm jmp\" or \"link\" as method for those exports"); 177 | } 178 | } 179 | 180 | private void generateToolStripMenuItem1_Click(object sender, EventArgs e) 181 | { 182 | GenerateDefintions(); 183 | GenerateCode(); 184 | } 185 | 186 | private void GenerateDefintions() 187 | { 188 | StringBuilder sb = new StringBuilder(); 189 | sb.AppendLine("EXPORTS"); 190 | int count = 0; 191 | foreach (Helper.ExportInfo e in exportlist) 192 | if (e.WayOfExport != 0 && e.WayOfExport != 3) 193 | sb.AppendFormat("{0}={1}{0} @{2}\n", e.Name, Options.prefix, count++ + 1); 194 | else if (e.WayOfExport == 3) 195 | count++; 196 | rtb3.Text = sb.ToString(); 197 | } 198 | 199 | private void GenerateCode() 200 | { 201 | string temp = Properties.Resources.template_cpp; 202 | int count = 0; 203 | foreach (Helper.ExportInfo e in exportlist) 204 | if (e.WayOfExport == 1 | e.WayOfExport == 2) 205 | count++; 206 | if (count != 0) 207 | temp = temp.Replace("##ph1##", "FARPROC p[" + count + "] = {0};"); 208 | else 209 | temp = temp.Replace("##ph1##", ""); 210 | temp = temp.Replace("##ph2##", lastfilename + Options.suffix); 211 | StringBuilder sb = new StringBuilder(); 212 | count = 0; 213 | foreach (Helper.ExportInfo e in exportlist) 214 | if (e.WayOfExport == 1 | e.WayOfExport == 2) 215 | sb.AppendFormat(" p[{0}] = GetProcAddress(hL,\"{1}\");\n", count++, e.Name); 216 | temp = temp.Replace("##ph3##", sb.ToString()); 217 | sb = new StringBuilder(); 218 | count = 0; 219 | foreach (Helper.ExportInfo e in exportlist) 220 | if(!e.isEmpty) 221 | switch (e.WayOfExport) 222 | { 223 | case 1: 224 | sb.AppendLine(MakeAsmJump(e, count++)); 225 | break; 226 | case 2: 227 | sb.AppendLine(MakeCall(e, count++)); 228 | break; 229 | case 3: 230 | sb.AppendLine(MakeLink(e)); 231 | break; 232 | } 233 | temp = temp.Replace("##ph4##", sb.ToString()); 234 | rtb2.Text = temp; 235 | } 236 | 237 | private string MakeAsmJump(Helper.ExportInfo e, int index) 238 | { 239 | StringBuilder sb = new StringBuilder(); 240 | sb.AppendLine("extern \"C\" __declspec(naked) void " + Options.prefix + e.Name + "()"); 241 | sb.AppendLine("{"); 242 | sb.AppendLine(" __asm"); 243 | sb.AppendLine(" {"); 244 | sb.AppendLine(" jmp p[" + index + "*4];"); 245 | sb.AppendLine(" }"); 246 | sb.AppendLine("}"); 247 | return sb.ToString(); 248 | } 249 | 250 | private string MakeCall(Helper.ExportInfo e, int index) 251 | { 252 | StringBuilder sb = new StringBuilder(); 253 | try 254 | { 255 | string def = e.Definition.Replace(";", "").Replace(e.Name, Options.prefix + e.Name); 256 | int namepos = def.IndexOf(Options.prefix + e.Name); 257 | def = def.Substring(namepos, def.Length - namepos); 258 | string argstr =def.Split('(')[1].Split(')')[0]; 259 | string[] args = argstr.Split(','); 260 | string argcall = ""; 261 | string argdef = ""; 262 | int acount = 1; 263 | if (argstr.Trim() == "") 264 | args = new string[0]; 265 | for (int i = 0; i < args.Length; i++) 266 | { 267 | if (args[i].ToLower().Replace(" ", "") == "void*") 268 | { 269 | if (header.Is32BitHeader) 270 | args[i] = "int "; 271 | else 272 | args[i] = "long "; 273 | args[i] += "a" + (acount++); 274 | } 275 | string[] argparts = args[i].Trim().Split(' '); 276 | if (argparts.Length == 1) 277 | argparts = new List() { argparts[0], "a" + (acount++) }.ToArray(); 278 | if (argparts.Length > 2) 279 | { 280 | StringBuilder sb2 = new StringBuilder(); 281 | for (int j = 0; j < argparts.Length - 1; j++) 282 | sb2.Append(argparts[j] + " "); 283 | argparts = new List() {sb2.ToString(), argparts[argparts.Length -1] }.ToArray(); 284 | } 285 | argcall += argparts[argparts.Length - 1].Replace("*", "").Trim() + ", "; 286 | argdef += argparts[0] + " " + argparts[1] + ", "; 287 | 288 | } 289 | if (args.Length > 0) 290 | { 291 | argcall = argcall.Substring(0, argcall.Length - 2); 292 | argdef = argdef.Substring(0, argdef.Length - 2); 293 | } 294 | string[] parts = e.Definition.Split(' '); 295 | if (header.Is32BitHeader) 296 | { 297 | sb.AppendLine("extern \"C\" int " + def.Split('(')[0] + "(" + argdef + ")"); 298 | sb.AppendLine("{"); 299 | sb.AppendLine(" typedef int (__stdcall *pS)(" + argdef + ");"); 300 | } 301 | else 302 | { 303 | sb.AppendLine("extern \"C\" long " + def.Split('(')[0] + "(" + argdef + ")"); 304 | sb.AppendLine("{"); 305 | sb.AppendLine(" typedef long (__stdcall *pS)(" +argdef + ");"); 306 | } 307 | sb.AppendLine(" pS pps = (pS)p[" + index + "*4];"); 308 | if (header.Is32BitHeader) 309 | sb.AppendLine(" int rv = pps(" + argcall + ");"); 310 | else 311 | sb.AppendLine(" long rv = pps(" + argcall + ");"); 312 | sb.AppendLine(" return rv;"); 313 | sb.AppendLine("}"); 314 | } 315 | catch (Exception) 316 | { 317 | sb = new StringBuilder(); 318 | MessageBox.Show("Error exporting \"" + e.Name + "\" with Definition:\n\"" + e.Definition + "\""); 319 | } 320 | return sb.ToString(); 321 | } 322 | 323 | private string MakeLink(Helper.ExportInfo e) 324 | { 325 | StringBuilder sb = new StringBuilder(); 326 | sb.Append("#pragma comment(linker, \"/export:"); 327 | sb.AppendFormat("{0}={1}.{2}", e.Name, lastfilename + Options.suffix, e.Name); 328 | sb.Append("\")"); 329 | sb.AppendLine(); 330 | return sb.ToString(); 331 | } 332 | 333 | private void undecoratorToolStripMenuItem_Click(object sender, EventArgs e) 334 | { 335 | new UnDecorator().Show(); 336 | } 337 | 338 | private void listBox1_DoubleClick_1(object sender, EventArgs e) 339 | { 340 | int n = listBox1.SelectedIndex; 341 | if (n == -1) 342 | return; 343 | FunctionDialog d = new FunctionDialog(); 344 | d.info = exportlist[n]; 345 | d.header = header; 346 | if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) 347 | { 348 | exportlist[n] = d.info; 349 | RefreshExportList(); 350 | } 351 | } 352 | 353 | private void listBox1_Click(object sender, EventArgs e) 354 | { 355 | RefreshPreview(); 356 | } 357 | 358 | private void undecorateAllToolStripMenuItem_Click(object sender, EventArgs e) 359 | { 360 | for (int i = 0; i < exportlist.Count; i++) 361 | { 362 | 363 | Helper.ExportInfo info = exportlist[i]; 364 | StringBuilder builder = new StringBuilder(255); 365 | DbgHelper.UnDecorateSymbolName(info.Name, builder, builder.Capacity, DbgHelper.UnDecorateFlags.UNDNAME_COMPLETE); 366 | info.Definition = builder.ToString(); 367 | exportlist[i] = info; 368 | } 369 | } 370 | 371 | private void listBox1_SelectedIndexChanged(object sender, EventArgs e) 372 | { 373 | RefreshPreview(); 374 | } 375 | 376 | private void RefreshPreview() 377 | { 378 | int n = listBox1.SelectedIndex; 379 | if (n == -1) 380 | return; 381 | Helper.ExportInfo info = exportlist[n]; 382 | StringBuilder sb = new StringBuilder(); 383 | sb.AppendFormat("Index\t\t: {0}\n", info.Index); 384 | sb.Append("Export\t:"); 385 | switch (info.WayOfExport) 386 | { 387 | case 0: 388 | sb.Append(" not exported"); 389 | break; 390 | case 1: 391 | sb.Append(" with asm jmp"); 392 | break; 393 | case 2: 394 | sb.Append(" with call"); 395 | break; 396 | case 3: 397 | sb.Append(" with link"); 398 | break; 399 | } 400 | sb.AppendLine(); 401 | sb.AppendFormat("Name\t\t: {0}\n", info.Name); 402 | sb.AppendFormat("Definition\t: {0}", info.Definition); 403 | rtb4.Text = sb.ToString(); 404 | } 405 | } 406 | } 407 | -------------------------------------------------------------------------------- /ProxyDllMaker/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 126, 17 125 | 126 | -------------------------------------------------------------------------------- /ProxyDllMaker/FunctionDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyDllMaker 2 | { 3 | partial class FunctionDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.textBox1 = new System.Windows.Forms.TextBox(); 33 | this.textBox2 = new System.Windows.Forms.TextBox(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.textBox3 = new System.Windows.Forms.TextBox(); 36 | this.label3 = new System.Windows.Forms.Label(); 37 | this.label4 = new System.Windows.Forms.Label(); 38 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 39 | this.button1 = new System.Windows.Forms.Button(); 40 | this.SuspendLayout(); 41 | // 42 | // label1 43 | // 44 | this.label1.Dock = System.Windows.Forms.DockStyle.Top; 45 | this.label1.Location = new System.Drawing.Point(0, 0); 46 | this.label1.Name = "label1"; 47 | this.label1.Size = new System.Drawing.Size(454, 20); 48 | this.label1.TabIndex = 0; 49 | this.label1.Text = "Index"; 50 | this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 51 | // 52 | // textBox1 53 | // 54 | this.textBox1.Dock = System.Windows.Forms.DockStyle.Top; 55 | this.textBox1.Enabled = false; 56 | this.textBox1.Font = new System.Drawing.Font("Courier New", 10F); 57 | this.textBox1.Location = new System.Drawing.Point(0, 20); 58 | this.textBox1.Name = "textBox1"; 59 | this.textBox1.Size = new System.Drawing.Size(454, 23); 60 | this.textBox1.TabIndex = 1; 61 | // 62 | // textBox2 63 | // 64 | this.textBox2.Dock = System.Windows.Forms.DockStyle.Top; 65 | this.textBox2.Font = new System.Drawing.Font("Courier New", 10F); 66 | this.textBox2.Location = new System.Drawing.Point(0, 63); 67 | this.textBox2.Name = "textBox2"; 68 | this.textBox2.Size = new System.Drawing.Size(454, 23); 69 | this.textBox2.TabIndex = 3; 70 | // 71 | // label2 72 | // 73 | this.label2.Dock = System.Windows.Forms.DockStyle.Top; 74 | this.label2.Location = new System.Drawing.Point(0, 43); 75 | this.label2.Name = "label2"; 76 | this.label2.Size = new System.Drawing.Size(454, 20); 77 | this.label2.TabIndex = 2; 78 | this.label2.Text = "Name"; 79 | this.label2.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 80 | // 81 | // textBox3 82 | // 83 | this.textBox3.Dock = System.Windows.Forms.DockStyle.Top; 84 | this.textBox3.Font = new System.Drawing.Font("Courier New", 10F); 85 | this.textBox3.Location = new System.Drawing.Point(0, 106); 86 | this.textBox3.Name = "textBox3"; 87 | this.textBox3.Size = new System.Drawing.Size(454, 23); 88 | this.textBox3.TabIndex = 5; 89 | // 90 | // label3 91 | // 92 | this.label3.Dock = System.Windows.Forms.DockStyle.Top; 93 | this.label3.Location = new System.Drawing.Point(0, 86); 94 | this.label3.Name = "label3"; 95 | this.label3.Size = new System.Drawing.Size(454, 20); 96 | this.label3.TabIndex = 4; 97 | this.label3.Text = "Definition String"; 98 | this.label3.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 99 | // 100 | // label4 101 | // 102 | this.label4.Dock = System.Windows.Forms.DockStyle.Top; 103 | this.label4.Location = new System.Drawing.Point(0, 129); 104 | this.label4.Name = "label4"; 105 | this.label4.Size = new System.Drawing.Size(454, 20); 106 | this.label4.TabIndex = 6; 107 | this.label4.Text = "Export Method"; 108 | this.label4.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 109 | // 110 | // comboBox1 111 | // 112 | this.comboBox1.Dock = System.Windows.Forms.DockStyle.Top; 113 | this.comboBox1.Font = new System.Drawing.Font("Courier New", 10F); 114 | this.comboBox1.FormattingEnabled = true; 115 | this.comboBox1.Location = new System.Drawing.Point(0, 149); 116 | this.comboBox1.Name = "comboBox1"; 117 | this.comboBox1.Size = new System.Drawing.Size(454, 24); 118 | this.comboBox1.TabIndex = 7; 119 | // 120 | // button1 121 | // 122 | this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; 123 | this.button1.Dock = System.Windows.Forms.DockStyle.Bottom; 124 | this.button1.Location = new System.Drawing.Point(0, 253); 125 | this.button1.Name = "button1"; 126 | this.button1.Size = new System.Drawing.Size(454, 23); 127 | this.button1.TabIndex = 8; 128 | this.button1.Text = "Save"; 129 | this.button1.UseVisualStyleBackColor = true; 130 | this.button1.Click += new System.EventHandler(this.button1_Click); 131 | // 132 | // FunctionDialog 133 | // 134 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 135 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 136 | this.ClientSize = new System.Drawing.Size(454, 276); 137 | this.Controls.Add(this.button1); 138 | this.Controls.Add(this.comboBox1); 139 | this.Controls.Add(this.label4); 140 | this.Controls.Add(this.textBox3); 141 | this.Controls.Add(this.label3); 142 | this.Controls.Add(this.textBox2); 143 | this.Controls.Add(this.label2); 144 | this.Controls.Add(this.textBox1); 145 | this.Controls.Add(this.label1); 146 | this.Name = "FunctionDialog"; 147 | this.Text = "Function Settings"; 148 | this.Load += new System.EventHandler(this.FunctionDialog_Load); 149 | this.ResumeLayout(false); 150 | this.PerformLayout(); 151 | 152 | } 153 | 154 | #endregion 155 | 156 | private System.Windows.Forms.Label label1; 157 | private System.Windows.Forms.TextBox textBox1; 158 | private System.Windows.Forms.TextBox textBox2; 159 | private System.Windows.Forms.Label label2; 160 | private System.Windows.Forms.TextBox textBox3; 161 | private System.Windows.Forms.Label label3; 162 | private System.Windows.Forms.Label label4; 163 | private System.Windows.Forms.ComboBox comboBox1; 164 | private System.Windows.Forms.Button button1; 165 | } 166 | } -------------------------------------------------------------------------------- /ProxyDllMaker/FunctionDialog.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 ProxyDllMaker 12 | { 13 | public partial class FunctionDialog : Form 14 | { 15 | public FunctionDialog() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | public Helper.ExportInfo info; 21 | public PeHeaderReader header; 22 | 23 | private void FunctionDialog_Load(object sender, EventArgs e) 24 | { 25 | textBox1.Text = info.Index.ToString(); 26 | textBox2.Text = info.Name; 27 | textBox3.Text = info.Definition; 28 | comboBox1.Items.Add("Not exported"); 29 | if (header.Is32BitHeader) 30 | comboBox1.Items.Add("with asm jmp"); 31 | comboBox1.Items.Add("with call"); 32 | comboBox1.Items.Add("with link"); 33 | if (header.Is32BitHeader) 34 | comboBox1.SelectedIndex = info.WayOfExport; 35 | else 36 | { 37 | if (info.WayOfExport == 0) 38 | comboBox1.SelectedIndex = 0; 39 | else 40 | comboBox1.SelectedIndex = info.WayOfExport - 1; 41 | } 42 | } 43 | 44 | private void button1_Click(object sender, EventArgs e) 45 | { 46 | info.Name = textBox2.Text; 47 | info.Definition = textBox3.Text; 48 | if (header.Is32BitHeader) 49 | info.WayOfExport = comboBox1.SelectedIndex; 50 | else 51 | { 52 | if (comboBox1.SelectedIndex == 0) 53 | info.WayOfExport = 0; 54 | else 55 | info.WayOfExport = comboBox1.SelectedIndex + 1; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ProxyDllMaker/FunctionDialog.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 | -------------------------------------------------------------------------------- /ProxyDllMaker/Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Runtime.InteropServices; 9 | 10 | using Microsoft.Win32.SafeHandles; 11 | using System.ComponentModel; 12 | 13 | namespace ProxyDllMaker 14 | { 15 | public static class Helper 16 | { 17 | [DllImport("dbghelp.dll", SetLastError = true, CharSet = CharSet.Unicode)] 18 | [return: MarshalAs(UnmanagedType.Bool)] 19 | public static extern bool SymInitialize(IntPtr hProcess, string UserSearchPath, [MarshalAs(UnmanagedType.Bool)]bool fInvadeProcess); 20 | 21 | [DllImport("dbghelp.dll", SetLastError = true, CharSet = CharSet.Unicode)] 22 | [return: MarshalAs(UnmanagedType.Bool)] 23 | public static extern bool SymCleanup(IntPtr hProcess); 24 | 25 | [DllImport("dbghelp.dll", SetLastError = true, CharSet = CharSet.Unicode)] 26 | public static extern ulong SymLoadModuleEx(IntPtr hProcess, IntPtr hFile, 27 | string ImageName, string ModuleName, long BaseOfDll, int DllSize, IntPtr Data, int Flags); 28 | 29 | [DllImport("dbghelp.dll", SetLastError = true, CharSet = CharSet.Unicode)] 30 | [return: MarshalAs(UnmanagedType.Bool)] 31 | public static extern bool SymEnumerateSymbols64(IntPtr hProcess, ulong BaseOfDll, SymEnumerateSymbolsProc64 EnumSymbolsCallback, IntPtr UserContext); 32 | public delegate bool SymEnumerateSymbolsProc64(string SymbolName, ulong SymbolAddress, uint SymbolSize, IntPtr UserContext); 33 | 34 | 35 | [DllImport("dbghelp.dll", SetLastError = true, CharSet = CharSet.Auto)] 36 | [return: MarshalAs(UnmanagedType.Bool)] 37 | public static extern bool SymEnumSymbols(IntPtr hProcess, ulong BaseOfDll, string Mask, SymEnumSymbolsCallback EnumSymbolsCallback, IntPtr UserContext); 38 | public delegate bool SymEnumSymbolsCallback(ref SYMBOL_INFO pSymInfo, uint SymbolSize, IntPtr UserContext); 39 | 40 | public const int MAX_SYM_NAME = 2000; 41 | public enum SYMFLAG : uint 42 | { 43 | SYMFLAG_VALUEPRESENT = 0x00000001, 44 | SYMFLAG_REGISTER = 0x00000008, 45 | SYMFLAG_REGREL = 0x00000010, 46 | SYMFLAG_FRAMEREL = 0x00000020, 47 | SYMFLAG_PARAMETER = 0x00000040, 48 | SYMFLAG_LOCAL = 0x00000080, 49 | SYMFLAG_CONSTANT = 0x00000100, 50 | SYMFLAG_EXPORT = 0x00000200, 51 | SYMFLAG_FORWARDER = 0x00000400, 52 | SYMFLAG_FUNCTION = 0x00000800, 53 | SYMFLAG_VIRTUAL = 0x00001000, 54 | SYMFLAG_THUNK = 0x00002000, 55 | SYMFLAG_TLSREL = 0x00004000, 56 | SYMFLAG_SLOT = 0x00008000, 57 | SYMFLAG_ILREL = 0x00010000, 58 | SYMFLAG_METADATA = 0x00020000, 59 | SYMFLAG_CLR_TOKEN = 0x00040000, 60 | SYMFLAG_NULL = 0x00080000, 61 | SYMFLAG_FUNC_NO_RETURN = 0x00100000, 62 | SYMFLAG_SYNTHETIC_ZEROBASE = 0x00200000, 63 | SYMFLAG_PUBLIC_CODE = 0x00400000, 64 | SYMFLAG_REGREL_ALIASINDIR = 0x00800000, 65 | SYMFLAG_RESET = 0x80000000, 66 | } 67 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] 68 | public struct SYMBOL_INFO 69 | { 70 | public uint SizeOfStruct; 71 | public uint TypeIndex; 72 | public ulong Reserved0; 73 | private ulong Reserved1; 74 | public uint Index; 75 | public uint Size; 76 | public ulong ModBase; 77 | public SYMFLAG Flags; 78 | public ulong Value; 79 | public ulong Address; 80 | public uint Register; 81 | public uint Scope; 82 | public uint Tag; 83 | public uint NameLen; 84 | public uint MaxNameLen; 85 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_SYM_NAME)] 86 | public string Name; 87 | } 88 | 89 | public enum SymbolRetrieveMethod 90 | { 91 | SymEnumSymbols, 92 | SymEnumerateSymbols64, 93 | DirectHeaderReading 94 | } 95 | public static string DumpObject(object obj) 96 | { 97 | System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(obj.GetType()); 98 | MemoryStream ms = new MemoryStream(); 99 | serializer.WriteObject(ms, obj); 100 | string midstep = Encoding.Default.GetString(ms.ToArray()); 101 | return FormatJson(midstep); 102 | } 103 | public static string FormatJson(string json) 104 | { 105 | string INDENT_STRING = " "; 106 | int indentation = 0; 107 | int quoteCount = 0; 108 | var result = 109 | from ch in json 110 | let quotes = ch == '"' ? quoteCount++ : quoteCount 111 | let lineBreak = ch == ',' && quotes % 2 == 0 ? ch + Environment.NewLine + String.Concat(Enumerable.Repeat(INDENT_STRING, indentation)) : null 112 | let openChar = ch == '{' || ch == '[' ? ch + Environment.NewLine + String.Concat(Enumerable.Repeat(INDENT_STRING, ++indentation)) : ch.ToString() 113 | let closeChar = ch == '}' || ch == ']' ? Environment.NewLine + String.Concat(Enumerable.Repeat(INDENT_STRING, --indentation)) + ch : ch.ToString() 114 | select lineBreak == null 115 | ? openChar.Length > 1 116 | ? openChar 117 | : closeChar 118 | : lineBreak; 119 | return String.Concat(result); 120 | } 121 | 122 | private static List infolist; 123 | public static bool EnumSymbolsCallback(ref SYMBOL_INFO pSymInfo, uint SymbolSize, IntPtr UserContext) 124 | { 125 | ExportInfo ex = new ExportInfo(); 126 | ex.Name = pSymInfo.Name; 127 | infolist.Add(ex); 128 | return true; 129 | } 130 | public static bool EnumerateSymbols64Callback(string name, ulong address, uint size, IntPtr context) 131 | { 132 | ExportInfo ex = new ExportInfo(); 133 | ex.Name = name; 134 | infolist.Add(ex); 135 | return true; 136 | } 137 | 138 | public static List GetExports(string path, SymbolRetrieveMethod method) 139 | { 140 | infolist = new List(); 141 | IntPtr hCurrentProcess = Process.GetCurrentProcess().Handle; 142 | ulong baseOfDll; 143 | bool status; 144 | status = SymInitialize(hCurrentProcess, null, false); 145 | if (status == false) 146 | throw new Exception("Failed to initialize sym."); 147 | baseOfDll = SymLoadModuleEx(hCurrentProcess, IntPtr.Zero, path, null, 0, 0, IntPtr.Zero, 0); 148 | if (baseOfDll == 0) 149 | { 150 | SymCleanup(hCurrentProcess); 151 | throw new Exception("Failed to load module."); 152 | } 153 | switch(method) 154 | { 155 | case SymbolRetrieveMethod.SymEnumerateSymbols64: 156 | if (!SymEnumerateSymbols64(hCurrentProcess, baseOfDll, EnumerateSymbols64Callback, IntPtr.Zero)) 157 | throw new Exception("Failed to enum symbols."); 158 | AutoAssignIndicies(); 159 | break; 160 | case SymbolRetrieveMethod.SymEnumSymbols: 161 | if (!SymEnumSymbols(hCurrentProcess, baseOfDll, "*", EnumSymbolsCallback, IntPtr.Zero)) 162 | throw new Exception("Failed to enum symbols."); 163 | AutoAssignIndicies(); 164 | break; 165 | case SymbolRetrieveMethod.DirectHeaderReading: 166 | if(!DirectMethod(path)) 167 | throw new Exception("Failed to enum symbols."); 168 | break; 169 | } 170 | SymCleanup(hCurrentProcess); 171 | return infolist; 172 | } 173 | 174 | public static void AutoAssignIndicies() 175 | { 176 | for (int i = 0; i < infolist.Count; i++) 177 | { 178 | ExportInfo e = infolist[i]; 179 | e.Index = i + 1; 180 | infolist[i] = e; 181 | } 182 | } 183 | 184 | public static bool DirectMethod(string filePath) 185 | { 186 | PeHeaderReader reader = new PeHeaderReader(filePath); 187 | long exportDirAddr = 0; 188 | long offset = 0; 189 | foreach (PeHeaderReader.IMAGE_SECTION_HEADER ish in reader.ImageSectionHeaders) 190 | { 191 | string test = ""; 192 | foreach (char c in ish.Name) 193 | if (c != '\0') 194 | test += c; 195 | if (test == ".rdata") 196 | { 197 | ulong vAddr, vSize; 198 | if(reader.Is32BitHeader) 199 | { 200 | vAddr = reader.OptionalHeader32.ExportTable.VirtualAddress; 201 | vSize = reader.OptionalHeader32.ExportTable.Size; 202 | } 203 | else 204 | { 205 | vAddr = reader.OptionalHeader64.ExportTable.VirtualAddress; 206 | vSize = reader.OptionalHeader64.ExportTable.Size; 207 | } 208 | if (vAddr == 0 || vSize == 0) 209 | return false; 210 | if (ish.VirtualAddress > vAddr || ish.VirtualAddress + ish.VirtualSize <= vAddr + vSize) 211 | return false; 212 | offset = (long)ish.PointerToRawData - (long)ish.VirtualAddress; 213 | exportDirAddr = (long)vAddr + offset; 214 | break; 215 | } 216 | } 217 | if (exportDirAddr == 0) 218 | return false; 219 | ReadExportTable(filePath, exportDirAddr, offset); 220 | return true; 221 | } 222 | 223 | public static void ReadExportTable(string fileName, long addr, long offset) 224 | { 225 | byte[] raw = File.ReadAllBytes(fileName); 226 | MemoryStream m = new MemoryStream(raw); 227 | m.Seek(addr + 16, 0); 228 | uint ordBase = ReadU32(m); 229 | uint countFunc = ReadU32(m); 230 | uint countNames = ReadU32(m); 231 | uint addrFuncTable = ReadU32(m); 232 | uint addrNamePointerTable = ReadU32(m); 233 | uint addrOrdTable = ReadU32(m); 234 | addrFuncTable = (uint)(addrFuncTable + offset); 235 | addrNamePointerTable = (uint)(addrNamePointerTable + offset); 236 | addrOrdTable = (uint)(addrOrdTable + offset); 237 | m.Seek(addrFuncTable, 0); 238 | uint[] exportAddresses = new uint[countFunc]; 239 | for (int i = 0; i < countFunc; i++) 240 | exportAddresses[i] = ReadU32(m); 241 | m.Seek(addrNamePointerTable, 0); 242 | uint[] namePointer = new uint[countNames]; 243 | for (int i = 0; i < countNames; i++) 244 | namePointer[i] = ReadU32(m); 245 | m.Seek(addrOrdTable, 0); 246 | ushort[] ordTable = new ushort[countNames]; 247 | for (int i = 0; i < countNames; i++) 248 | ordTable[i] = ReadU16(m); 249 | string[] funcNames = new string[countFunc]; 250 | for (int i = 0; i < countNames; i++) 251 | { 252 | m.Seek(namePointer[i] + offset, 0); 253 | string name = ReadCString(m); 254 | ushort ord = ordTable[i]; 255 | funcNames[ord] = name; 256 | } 257 | for(int i = 0; i < countFunc; i++) 258 | { 259 | ExportInfo ex = new ExportInfo(); 260 | ex.isEmpty = funcNames[i] == null; 261 | if (!ex.isEmpty) 262 | ex.Name = funcNames[i]; 263 | else 264 | ex.Name = Options.emptyFunc + (ordBase + i); 265 | ex.Index = (int)ordBase + i; 266 | infolist.Add(ex); 267 | } 268 | } 269 | 270 | public static string ReadCString(Stream s) 271 | { 272 | StringBuilder sb = new StringBuilder(); 273 | int b; 274 | while(true) 275 | { 276 | b = s.ReadByte(); 277 | if (b == -1 || b == 0) 278 | break; 279 | sb.Append((char)b); 280 | } 281 | return sb.ToString(); 282 | } 283 | 284 | public static ushort ReadU16(Stream s) 285 | { 286 | byte[] buff = new byte[2]; 287 | s.Read(buff, 0, 2); 288 | return BitConverter.ToUInt16(buff, 0); 289 | } 290 | public static uint ReadU32(Stream s) 291 | { 292 | byte[] buff = new byte[4]; 293 | s.Read(buff, 0, 4); 294 | return BitConverter.ToUInt32(buff, 0); 295 | } 296 | 297 | public struct ExportInfo 298 | { 299 | public string Name; 300 | public string Definition; 301 | public int WayOfExport; //0=none, 1=withasm, 2=withcalls, 3=withlink 302 | public int Index; 303 | public bool isEmpty; 304 | } 305 | 306 | public static string ExportInfoToString(ExportInfo e) 307 | { 308 | StringBuilder sb = new StringBuilder(); 309 | sb.Append(e.Index + "\t: \"" + e.Name + "\""); 310 | for (int i = 0; i < 10; i++) 311 | if (e.Name.Length + 12 < i * 8) 312 | sb.AppendLine("\t"); 313 | sb.AppendLine("Export:"); 314 | switch (e.WayOfExport) 315 | { 316 | case 0: 317 | sb.Append(" not exported"); 318 | break; 319 | case 1: 320 | sb.Append(" with asm jmp"); 321 | break; 322 | case 2: 323 | sb.Append(" with call"); 324 | break; 325 | case 3: 326 | sb.Append(" with link"); 327 | break; 328 | 329 | } 330 | return sb.ToString(); 331 | } 332 | } 333 | } 334 | -------------------------------------------------------------------------------- /ProxyDllMaker/OptionForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyDllMaker 2 | { 3 | partial class OptionForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.textBox1 = new System.Windows.Forms.TextBox(); 33 | this.button1 = new System.Windows.Forms.Button(); 34 | this.textBox2 = new System.Windows.Forms.TextBox(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.label3 = new System.Windows.Forms.Label(); 37 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 38 | this.textBox3 = new System.Windows.Forms.TextBox(); 39 | this.label4 = new System.Windows.Forms.Label(); 40 | this.SuspendLayout(); 41 | // 42 | // label1 43 | // 44 | this.label1.AutoSize = true; 45 | this.label1.Location = new System.Drawing.Point(13, 13); 46 | this.label1.Name = "label1"; 47 | this.label1.Size = new System.Drawing.Size(94, 13); 48 | this.label1.TabIndex = 0; 49 | this.label1.Text = "Original DLL Suffix"; 50 | // 51 | // textBox1 52 | // 53 | this.textBox1.Font = new System.Drawing.Font("Courier New", 10F); 54 | this.textBox1.Location = new System.Drawing.Point(180, 13); 55 | this.textBox1.Name = "textBox1"; 56 | this.textBox1.Size = new System.Drawing.Size(213, 23); 57 | this.textBox1.TabIndex = 2; 58 | this.textBox1.Text = "_org"; 59 | // 60 | // button1 61 | // 62 | this.button1.Location = new System.Drawing.Point(318, 128); 63 | this.button1.Name = "button1"; 64 | this.button1.Size = new System.Drawing.Size(75, 23); 65 | this.button1.TabIndex = 1; 66 | this.button1.Text = "Save"; 67 | this.button1.UseVisualStyleBackColor = true; 68 | this.button1.Click += new System.EventHandler(this.button1_Click); 69 | // 70 | // textBox2 71 | // 72 | this.textBox2.Font = new System.Drawing.Font("Courier New", 10F); 73 | this.textBox2.Location = new System.Drawing.Point(180, 42); 74 | this.textBox2.Name = "textBox2"; 75 | this.textBox2.Size = new System.Drawing.Size(213, 23); 76 | this.textBox2.TabIndex = 4; 77 | this.textBox2.Text = "Proxy_"; 78 | // 79 | // label2 80 | // 81 | this.label2.AutoSize = true; 82 | this.label2.Location = new System.Drawing.Point(13, 42); 83 | this.label2.Name = "label2"; 84 | this.label2.Size = new System.Drawing.Size(106, 13); 85 | this.label2.TabIndex = 3; 86 | this.label2.Text = "Proxy Function Prefix"; 87 | // 88 | // label3 89 | // 90 | this.label3.AutoSize = true; 91 | this.label3.Location = new System.Drawing.Point(13, 100); 92 | this.label3.Name = "label3"; 93 | this.label3.Size = new System.Drawing.Size(150, 13); 94 | this.label3.TabIndex = 5; 95 | this.label3.Text = "Export Name Retrieve Method"; 96 | // 97 | // comboBox1 98 | // 99 | this.comboBox1.Font = new System.Drawing.Font("Courier New", 8.25F); 100 | this.comboBox1.FormattingEnabled = true; 101 | this.comboBox1.ItemHeight = 14; 102 | this.comboBox1.Items.AddRange(new object[] { 103 | "WinAPI SymEnumerateSymbols64", 104 | "WinAPI SymEnumSymbols", 105 | "Direct Header Processing"}); 106 | this.comboBox1.Location = new System.Drawing.Point(180, 100); 107 | this.comboBox1.Name = "comboBox1"; 108 | this.comboBox1.Size = new System.Drawing.Size(213, 22); 109 | this.comboBox1.TabIndex = 7; 110 | // 111 | // textBox3 112 | // 113 | this.textBox3.Font = new System.Drawing.Font("Courier New", 10F); 114 | this.textBox3.Location = new System.Drawing.Point(180, 71); 115 | this.textBox3.Name = "textBox3"; 116 | this.textBox3.Size = new System.Drawing.Size(213, 23); 117 | this.textBox3.TabIndex = 9; 118 | this.textBox3.Text = "EmptyFunction_"; 119 | // 120 | // label4 121 | // 122 | this.label4.AutoSize = true; 123 | this.label4.Location = new System.Drawing.Point(13, 71); 124 | this.label4.Name = "label4"; 125 | this.label4.Size = new System.Drawing.Size(98, 13); 126 | this.label4.TabIndex = 8; 127 | this.label4.Text = "Empty Export Prefix"; 128 | // 129 | // OptionForm 130 | // 131 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 132 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 133 | this.ClientSize = new System.Drawing.Size(405, 153); 134 | this.Controls.Add(this.textBox3); 135 | this.Controls.Add(this.label4); 136 | this.Controls.Add(this.comboBox1); 137 | this.Controls.Add(this.label3); 138 | this.Controls.Add(this.textBox2); 139 | this.Controls.Add(this.label2); 140 | this.Controls.Add(this.button1); 141 | this.Controls.Add(this.textBox1); 142 | this.Controls.Add(this.label1); 143 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 144 | this.MaximizeBox = false; 145 | this.MinimizeBox = false; 146 | this.Name = "OptionForm"; 147 | this.Text = "Options"; 148 | this.Load += new System.EventHandler(this.OptionForm_Load); 149 | this.ResumeLayout(false); 150 | this.PerformLayout(); 151 | 152 | } 153 | 154 | #endregion 155 | 156 | private System.Windows.Forms.Label label1; 157 | private System.Windows.Forms.TextBox textBox1; 158 | private System.Windows.Forms.Button button1; 159 | private System.Windows.Forms.TextBox textBox2; 160 | private System.Windows.Forms.Label label2; 161 | private System.Windows.Forms.Label label3; 162 | private System.Windows.Forms.ComboBox comboBox1; 163 | private System.Windows.Forms.TextBox textBox3; 164 | private System.Windows.Forms.Label label4; 165 | } 166 | } -------------------------------------------------------------------------------- /ProxyDllMaker/OptionForm.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 ProxyDllMaker 12 | { 13 | public partial class OptionForm : Form 14 | { 15 | public OptionForm() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void button1_Click(object sender, EventArgs e) 21 | { 22 | Options.suffix = textBox1.Text; 23 | Options.prefix = textBox2.Text; 24 | Options.emptyFunc = textBox3.Text; 25 | Options.symMethod = (Helper.SymbolRetrieveMethod)comboBox1.SelectedIndex; 26 | Options.SaveToFile("settings.txt"); 27 | this.Close(); 28 | } 29 | 30 | private void OptionForm_Load(object sender, EventArgs e) 31 | { 32 | textBox1.Text = Options.suffix; 33 | textBox2.Text = Options.prefix; 34 | textBox3.Text = Options.emptyFunc; 35 | comboBox1.SelectedIndex = (int)Options.symMethod; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ProxyDllMaker/OptionForm.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 | -------------------------------------------------------------------------------- /ProxyDllMaker/Options.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | 9 | namespace ProxyDllMaker 10 | { 11 | public static class Options 12 | { 13 | public static string suffix = "_org"; 14 | public static string prefix = "Proxy_"; 15 | public static string emptyFunc = "EmptyFunction_"; 16 | public static Helper.SymbolRetrieveMethod symMethod; 17 | 18 | public static void SaveToFile(string path) 19 | { 20 | StringBuilder sb = new StringBuilder(); 21 | sb.AppendLine("suffix=" + suffix); 22 | sb.AppendLine("prefix=" + prefix); 23 | sb.AppendLine("empty=" + emptyFunc); 24 | sb.AppendLine("symmethod=" + (int)symMethod); 25 | File.WriteAllText(path, sb.ToString()); 26 | } 27 | public static void LoadFromFile(string path) 28 | { 29 | string[] lines = File.ReadAllLines(path); 30 | foreach (string line in lines) 31 | { 32 | try 33 | { 34 | string[] parts = line.Split('='); 35 | switch (parts[0].Trim().ToLower()) 36 | { 37 | case "suffix": 38 | suffix = parts[1].Trim(); 39 | break; 40 | case "prefix": 41 | prefix = parts[1].Trim(); 42 | break; 43 | case "empty": 44 | emptyFunc = parts[1].Trim(); 45 | break; 46 | case "symmethod": 47 | symMethod = (Helper.SymbolRetrieveMethod)Convert.ToInt32(parts[1].Trim()); 48 | break; 49 | } 50 | } 51 | catch (Exception) 52 | { 53 | } 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ProxyDllMaker/PEStuff.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Runtime.InteropServices; 8 | using Microsoft.Win32.SafeHandles; 9 | using System.ComponentModel; 10 | 11 | namespace ProxyDllMaker 12 | { 13 | public static class DbgHelper 14 | { 15 | [Flags] 16 | public enum UnDecorateFlags 17 | { 18 | UNDNAME_COMPLETE = (0x0000), // Enable full undecoration 19 | UNDNAME_NO_LEADING_UNDERSCORES = (0x0001), // Remove leading underscores from MS extended keywords 20 | UNDNAME_NO_MS_KEYWORDS = (0x0002), // Disable expansion of MS extended keywords 21 | UNDNAME_NO_FUNCTION_RETURNS = (0x0004), // Disable expansion of return type for primary declaration 22 | UNDNAME_NO_ALLOCATION_MODEL = (0x0008), // Disable expansion of the declaration model 23 | UNDNAME_NO_ALLOCATION_LANGUAGE = (0x0010), // Disable expansion of the declaration language specifier 24 | UNDNAME_NO_MS_THISTYPE = (0x0020), // NYI Disable expansion of MS keywords on the 'this' type for primary declaration 25 | UNDNAME_NO_CV_THISTYPE = (0x0040), // NYI Disable expansion of CV modifiers on the 'this' type for primary declaration 26 | UNDNAME_NO_THISTYPE = (0x0060), // Disable all modifiers on the 'this' type 27 | UNDNAME_NO_ACCESS_SPECIFIERS = (0x0080), // Disable expansion of access specifiers for members 28 | UNDNAME_NO_THROW_SIGNATURES = (0x0100), // Disable expansion of 'throw-signatures' for functions and pointers to functions 29 | UNDNAME_NO_MEMBER_TYPE = (0x0200), // Disable expansion of 'static' or 'virtual'ness of members 30 | UNDNAME_NO_RETURN_UDT_MODEL = (0x0400), // Disable expansion of MS model for UDT returns 31 | UNDNAME_32_BIT_DECODE = (0x0800), // Undecorate 32-bit decorated names 32 | UNDNAME_NAME_ONLY = (0x1000), // Crack only the name for primary declaration; return just [scope::]name. Does expand template params 33 | UNDNAME_NO_ARGUMENTS = (0x2000), // Don't undecorate arguments to function 34 | UNDNAME_NO_SPECIAL_SYMS = (0x4000), // Don't undecorate special names (v-table, vcall, vector xxx, metatype, etc) 35 | } 36 | 37 | [DllImport("dbghelp.dll", SetLastError = true, PreserveSig = true)] 38 | public static extern int UnDecorateSymbolName( 39 | [In] [MarshalAs(UnmanagedType.LPStr)] string DecoratedName, 40 | [Out] StringBuilder UnDecoratedName, 41 | [In] [MarshalAs(UnmanagedType.U4)] int UndecoratedLength, 42 | [In] [MarshalAs(UnmanagedType.U4)] UnDecorateFlags Flags); 43 | } 44 | [Serializable] 45 | public class PeHeaderReader { 46 | #region File Header Structures 47 | 48 | public struct IMAGE_DOS_HEADER { // DOS .EXE header 49 | public UInt16 e_magic; // Magic number 50 | public UInt16 e_cblp; // Bytes on last page of file 51 | public UInt16 e_cp; // Pages in file 52 | public UInt16 e_crlc; // Relocations 53 | public UInt16 e_cparhdr; // Size of header in paragraphs 54 | public UInt16 e_minalloc; // Minimum extra paragraphs needed 55 | public UInt16 e_maxalloc; // Maximum extra paragraphs needed 56 | public UInt16 e_ss; // Initial (relative) SS value 57 | public UInt16 e_sp; // Initial SP value 58 | public UInt16 e_csum; // Checksum 59 | public UInt16 e_ip; // Initial IP value 60 | public UInt16 e_cs; // Initial (relative) CS value 61 | public UInt16 e_lfarlc; // File address of relocation table 62 | public UInt16 e_ovno; // Overlay number 63 | public UInt16 e_res_0; // Reserved words 64 | public UInt16 e_res_1; // Reserved words 65 | public UInt16 e_res_2; // Reserved words 66 | public UInt16 e_res_3; // Reserved words 67 | public UInt16 e_oemid; // OEM identifier (for e_oeminfo) 68 | public UInt16 e_oeminfo; // OEM information; e_oemid specific 69 | public UInt16 e_res2_0; // Reserved words 70 | public UInt16 e_res2_1; // Reserved words 71 | public UInt16 e_res2_2; // Reserved words 72 | public UInt16 e_res2_3; // Reserved words 73 | public UInt16 e_res2_4; // Reserved words 74 | public UInt16 e_res2_5; // Reserved words 75 | public UInt16 e_res2_6; // Reserved words 76 | public UInt16 e_res2_7; // Reserved words 77 | public UInt16 e_res2_8; // Reserved words 78 | public UInt16 e_res2_9; // Reserved words 79 | public UInt32 e_lfanew; // File address of new exe header 80 | } 81 | 82 | [StructLayout(LayoutKind.Sequential)] 83 | public struct IMAGE_DATA_DIRECTORY { 84 | public UInt32 VirtualAddress; 85 | public UInt32 Size; 86 | } 87 | 88 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 89 | public struct IMAGE_OPTIONAL_HEADER32 { 90 | public UInt16 Magic; 91 | public Byte MajorLinkerVersion; 92 | public Byte MinorLinkerVersion; 93 | public UInt32 SizeOfCode; 94 | public UInt32 SizeOfInitializedData; 95 | public UInt32 SizeOfUninitializedData; 96 | public UInt32 AddressOfEntryPoint; 97 | public UInt32 BaseOfCode; 98 | public UInt32 BaseOfData; 99 | public UInt32 ImageBase; 100 | public UInt32 SectionAlignment; 101 | public UInt32 FileAlignment; 102 | public UInt16 MajorOperatingSystemVersion; 103 | public UInt16 MinorOperatingSystemVersion; 104 | public UInt16 MajorImageVersion; 105 | public UInt16 MinorImageVersion; 106 | public UInt16 MajorSubsystemVersion; 107 | public UInt16 MinorSubsystemVersion; 108 | public UInt32 Win32VersionValue; 109 | public UInt32 SizeOfImage; 110 | public UInt32 SizeOfHeaders; 111 | public UInt32 CheckSum; 112 | public UInt16 Subsystem; 113 | public UInt16 DllCharacteristics; 114 | public UInt32 SizeOfStackReserve; 115 | public UInt32 SizeOfStackCommit; 116 | public UInt32 SizeOfHeapReserve; 117 | public UInt32 SizeOfHeapCommit; 118 | public UInt32 LoaderFlags; 119 | public UInt32 NumberOfRvaAndSizes; 120 | 121 | public IMAGE_DATA_DIRECTORY ExportTable; 122 | public IMAGE_DATA_DIRECTORY ImportTable; 123 | public IMAGE_DATA_DIRECTORY ResourceTable; 124 | public IMAGE_DATA_DIRECTORY ExceptionTable; 125 | public IMAGE_DATA_DIRECTORY CertificateTable; 126 | public IMAGE_DATA_DIRECTORY BaseRelocationTable; 127 | public IMAGE_DATA_DIRECTORY Debug; 128 | public IMAGE_DATA_DIRECTORY Architecture; 129 | public IMAGE_DATA_DIRECTORY GlobalPtr; 130 | public IMAGE_DATA_DIRECTORY TLSTable; 131 | public IMAGE_DATA_DIRECTORY LoadConfigTable; 132 | public IMAGE_DATA_DIRECTORY BoundImport; 133 | public IMAGE_DATA_DIRECTORY IAT; 134 | public IMAGE_DATA_DIRECTORY DelayImportDescriptor; 135 | public IMAGE_DATA_DIRECTORY CLRRuntimeHeader; 136 | public IMAGE_DATA_DIRECTORY Reserved; 137 | } 138 | 139 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 140 | public struct IMAGE_OPTIONAL_HEADER64 { 141 | public UInt16 Magic; 142 | public Byte MajorLinkerVersion; 143 | public Byte MinorLinkerVersion; 144 | public UInt32 SizeOfCode; 145 | public UInt32 SizeOfInitializedData; 146 | public UInt32 SizeOfUninitializedData; 147 | public UInt32 AddressOfEntryPoint; 148 | public UInt32 BaseOfCode; 149 | public UInt64 ImageBase; 150 | public UInt32 SectionAlignment; 151 | public UInt32 FileAlignment; 152 | public UInt16 MajorOperatingSystemVersion; 153 | public UInt16 MinorOperatingSystemVersion; 154 | public UInt16 MajorImageVersion; 155 | public UInt16 MinorImageVersion; 156 | public UInt16 MajorSubsystemVersion; 157 | public UInt16 MinorSubsystemVersion; 158 | public UInt32 Win32VersionValue; 159 | public UInt32 SizeOfImage; 160 | public UInt32 SizeOfHeaders; 161 | public UInt32 CheckSum; 162 | public UInt16 Subsystem; 163 | public UInt16 DllCharacteristics; 164 | public UInt64 SizeOfStackReserve; 165 | public UInt64 SizeOfStackCommit; 166 | public UInt64 SizeOfHeapReserve; 167 | public UInt64 SizeOfHeapCommit; 168 | public UInt32 LoaderFlags; 169 | public UInt32 NumberOfRvaAndSizes; 170 | 171 | public IMAGE_DATA_DIRECTORY ExportTable; 172 | public IMAGE_DATA_DIRECTORY ImportTable; 173 | public IMAGE_DATA_DIRECTORY ResourceTable; 174 | public IMAGE_DATA_DIRECTORY ExceptionTable; 175 | public IMAGE_DATA_DIRECTORY CertificateTable; 176 | public IMAGE_DATA_DIRECTORY BaseRelocationTable; 177 | public IMAGE_DATA_DIRECTORY Debug; 178 | public IMAGE_DATA_DIRECTORY Architecture; 179 | public IMAGE_DATA_DIRECTORY GlobalPtr; 180 | public IMAGE_DATA_DIRECTORY TLSTable; 181 | public IMAGE_DATA_DIRECTORY LoadConfigTable; 182 | public IMAGE_DATA_DIRECTORY BoundImport; 183 | public IMAGE_DATA_DIRECTORY IAT; 184 | public IMAGE_DATA_DIRECTORY DelayImportDescriptor; 185 | public IMAGE_DATA_DIRECTORY CLRRuntimeHeader; 186 | public IMAGE_DATA_DIRECTORY Reserved; 187 | } 188 | 189 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 190 | public struct IMAGE_FILE_HEADER { 191 | public UInt16 Machine; 192 | public UInt16 NumberOfSections; 193 | public UInt32 TimeDateStamp; 194 | public UInt32 PointerToSymbolTable; 195 | public UInt32 NumberOfSymbols; 196 | public UInt16 SizeOfOptionalHeader; 197 | public UInt16 Characteristics; 198 | } 199 | 200 | // Grabbed the following 2 definitions from http://www.pinvoke.net/default.aspx/Structures/IMAGE_SECTION_HEADER.html 201 | 202 | [StructLayout(LayoutKind.Explicit)] 203 | public struct IMAGE_SECTION_HEADER { 204 | [FieldOffset(0)] 205 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] 206 | public char[] Name; 207 | [FieldOffset(8)] 208 | public UInt32 VirtualSize; 209 | [FieldOffset(12)] 210 | public UInt32 VirtualAddress; 211 | [FieldOffset(16)] 212 | public UInt32 SizeOfRawData; 213 | [FieldOffset(20)] 214 | public UInt32 PointerToRawData; 215 | [FieldOffset(24)] 216 | public UInt32 PointerToRelocations; 217 | [FieldOffset(28)] 218 | public UInt32 PointerToLinenumbers; 219 | [FieldOffset(32)] 220 | public UInt16 NumberOfRelocations; 221 | [FieldOffset(34)] 222 | public UInt16 NumberOfLinenumbers; 223 | [FieldOffset(36)] 224 | public DataSectionFlags Characteristics; 225 | 226 | public string Section { 227 | get { return new string(Name); } 228 | } 229 | } 230 | 231 | [Flags] 232 | public enum DataSectionFlags : uint { 233 | /// 234 | /// Reserved for future use. 235 | /// 236 | TypeReg = 0x00000000, 237 | /// 238 | /// Reserved for future use. 239 | /// 240 | TypeDsect = 0x00000001, 241 | /// 242 | /// Reserved for future use. 243 | /// 244 | TypeNoLoad = 0x00000002, 245 | /// 246 | /// Reserved for future use. 247 | /// 248 | TypeGroup = 0x00000004, 249 | /// 250 | /// The section should not be padded to the next boundary. This flag is obsolete and is replaced by IMAGE_SCN_ALIGN_1BYTES. This is valid only for object files. 251 | /// 252 | TypeNoPadded = 0x00000008, 253 | /// 254 | /// Reserved for future use. 255 | /// 256 | TypeCopy = 0x00000010, 257 | /// 258 | /// The section contains executable code. 259 | /// 260 | ContentCode = 0x00000020, 261 | /// 262 | /// The section contains initialized data. 263 | /// 264 | ContentInitializedData = 0x00000040, 265 | /// 266 | /// The section contains uninitialized data. 267 | /// 268 | ContentUninitializedData = 0x00000080, 269 | /// 270 | /// Reserved for future use. 271 | /// 272 | LinkOther = 0x00000100, 273 | /// 274 | /// The section contains comments or other information. The .drectve section has this type. This is valid for object files only. 275 | /// 276 | LinkInfo = 0x00000200, 277 | /// 278 | /// Reserved for future use. 279 | /// 280 | TypeOver = 0x00000400, 281 | /// 282 | /// The section will not become part of the image. This is valid only for object files. 283 | /// 284 | LinkRemove = 0x00000800, 285 | /// 286 | /// The section contains COMDAT data. For more information, see section 5.5.6, COMDAT Sections (Object Only). This is valid only for object files. 287 | /// 288 | LinkComDat = 0x00001000, 289 | /// 290 | /// Reset speculative exceptions handling bits in the TLB entries for this section. 291 | /// 292 | NoDeferSpecExceptions = 0x00004000, 293 | /// 294 | /// The section contains data referenced through the global pointer (GP). 295 | /// 296 | RelativeGP = 0x00008000, 297 | /// 298 | /// Reserved for future use. 299 | /// 300 | MemPurgeable = 0x00020000, 301 | /// 302 | /// Reserved for future use. 303 | /// 304 | Memory16Bit = 0x00020000, 305 | /// 306 | /// Reserved for future use. 307 | /// 308 | MemoryLocked = 0x00040000, 309 | /// 310 | /// Reserved for future use. 311 | /// 312 | MemoryPreload = 0x00080000, 313 | /// 314 | /// Align data on a 1-byte boundary. Valid only for object files. 315 | /// 316 | Align1Bytes = 0x00100000, 317 | /// 318 | /// Align data on a 2-byte boundary. Valid only for object files. 319 | /// 320 | Align2Bytes = 0x00200000, 321 | /// 322 | /// Align data on a 4-byte boundary. Valid only for object files. 323 | /// 324 | Align4Bytes = 0x00300000, 325 | /// 326 | /// Align data on an 8-byte boundary. Valid only for object files. 327 | /// 328 | Align8Bytes = 0x00400000, 329 | /// 330 | /// Align data on a 16-byte boundary. Valid only for object files. 331 | /// 332 | Align16Bytes = 0x00500000, 333 | /// 334 | /// Align data on a 32-byte boundary. Valid only for object files. 335 | /// 336 | Align32Bytes = 0x00600000, 337 | /// 338 | /// Align data on a 64-byte boundary. Valid only for object files. 339 | /// 340 | Align64Bytes = 0x00700000, 341 | /// 342 | /// Align data on a 128-byte boundary. Valid only for object files. 343 | /// 344 | Align128Bytes = 0x00800000, 345 | /// 346 | /// Align data on a 256-byte boundary. Valid only for object files. 347 | /// 348 | Align256Bytes = 0x00900000, 349 | /// 350 | /// Align data on a 512-byte boundary. Valid only for object files. 351 | /// 352 | Align512Bytes = 0x00A00000, 353 | /// 354 | /// Align data on a 1024-byte boundary. Valid only for object files. 355 | /// 356 | Align1024Bytes = 0x00B00000, 357 | /// 358 | /// Align data on a 2048-byte boundary. Valid only for object files. 359 | /// 360 | Align2048Bytes = 0x00C00000, 361 | /// 362 | /// Align data on a 4096-byte boundary. Valid only for object files. 363 | /// 364 | Align4096Bytes = 0x00D00000, 365 | /// 366 | /// Align data on an 8192-byte boundary. Valid only for object files. 367 | /// 368 | Align8192Bytes = 0x00E00000, 369 | /// 370 | /// The section contains extended relocations. 371 | /// 372 | LinkExtendedRelocationOverflow = 0x01000000, 373 | /// 374 | /// The section can be discarded as needed. 375 | /// 376 | MemoryDiscardable = 0x02000000, 377 | /// 378 | /// The section cannot be cached. 379 | /// 380 | MemoryNotCached = 0x04000000, 381 | /// 382 | /// The section is not pageable. 383 | /// 384 | MemoryNotPaged = 0x08000000, 385 | /// 386 | /// The section can be shared in memory. 387 | /// 388 | MemoryShared = 0x10000000, 389 | /// 390 | /// The section can be executed as code. 391 | /// 392 | MemoryExecute = 0x20000000, 393 | /// 394 | /// The section can be read. 395 | /// 396 | MemoryRead = 0x40000000, 397 | /// 398 | /// The section can be written to. 399 | /// 400 | MemoryWrite = 0x80000000 401 | } 402 | 403 | #endregion File Header Structures 404 | 405 | #region Private Fields 406 | 407 | /// 408 | /// The DOS header 409 | /// 410 | private IMAGE_DOS_HEADER dosHeader; 411 | /// 412 | /// The file header 413 | /// 414 | private IMAGE_FILE_HEADER fileHeader; 415 | /// 416 | /// Optional 32 bit file header 417 | /// 418 | private IMAGE_OPTIONAL_HEADER32 optionalHeader32; 419 | /// 420 | /// Optional 64 bit file header 421 | /// 422 | private IMAGE_OPTIONAL_HEADER64 optionalHeader64; 423 | /// 424 | /// Image Section headers. Number of sections is in the file header. 425 | /// 426 | private IMAGE_SECTION_HEADER[] imageSectionHeaders; 427 | 428 | #endregion Private Fields 429 | 430 | #region Public Methods 431 | 432 | public PeHeaderReader(string filePath) { 433 | // Read in the DLL or EXE and get the timestamp 434 | using (FileStream stream = new FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { 435 | BinaryReader reader = new BinaryReader(stream); 436 | dosHeader = FromBinaryReader(reader); 437 | 438 | // Add 4 bytes to the offset 439 | stream.Seek(dosHeader.e_lfanew, SeekOrigin.Begin); 440 | 441 | UInt32 ntHeadersSignature = reader.ReadUInt32(); 442 | fileHeader = FromBinaryReader(reader); 443 | if (this.Is32BitHeader) { 444 | optionalHeader32 = FromBinaryReader(reader); 445 | } 446 | else { 447 | optionalHeader64 = FromBinaryReader(reader); 448 | } 449 | 450 | imageSectionHeaders = new IMAGE_SECTION_HEADER[fileHeader.NumberOfSections]; 451 | for(int headerNo = 0; headerNo < imageSectionHeaders.Length; ++headerNo) { 452 | imageSectionHeaders[headerNo] = FromBinaryReader(reader); 453 | } 454 | 455 | } 456 | } 457 | 458 | /// 459 | /// Gets the header of the .NET assembly that called this function 460 | /// 461 | /// 462 | public static PeHeaderReader GetCallingAssemblyHeader() { 463 | // Get the path to the calling assembly, which is the path to the 464 | // DLL or EXE that we want the time of 465 | string filePath = System.Reflection.Assembly.GetCallingAssembly().Location; 466 | 467 | // Get and return the timestamp 468 | return new PeHeaderReader(filePath); 469 | } 470 | 471 | /// 472 | /// Gets the header of the .NET assembly that called this function 473 | /// 474 | /// 475 | public static PeHeaderReader GetAssemblyHeader() { 476 | // Get the path to the calling assembly, which is the path to the 477 | // DLL or EXE that we want the time of 478 | string filePath = System.Reflection.Assembly.GetAssembly(typeof(PeHeaderReader)).Location; 479 | 480 | // Get and return the timestamp 481 | return new PeHeaderReader(filePath); 482 | } 483 | 484 | /// 485 | /// Reads in a block from a file and converts it to the struct 486 | /// type specified by the template parameter 487 | /// 488 | /// 489 | /// 490 | /// 491 | public static T FromBinaryReader(BinaryReader reader) { 492 | // Read in a byte array 493 | byte[] bytes = reader.ReadBytes(Marshal.SizeOf(typeof(T))); 494 | 495 | // Pin the managed memory while, copy it out the data, then unpin it 496 | GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 497 | T theStructure = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); 498 | handle.Free(); 499 | 500 | return theStructure; 501 | } 502 | 503 | #endregion Public Methods 504 | 505 | #region Properties 506 | 507 | /// 508 | /// Gets if the file header is 32 bit or not 509 | /// 510 | public bool Is32BitHeader { 511 | get { 512 | UInt16 IMAGE_FILE_32BIT_MACHINE = 0x0100; 513 | return (IMAGE_FILE_32BIT_MACHINE & FileHeader.Characteristics) == IMAGE_FILE_32BIT_MACHINE; 514 | } 515 | } 516 | 517 | /// 518 | /// Gets the file header 519 | /// 520 | public IMAGE_FILE_HEADER FileHeader { 521 | get { 522 | return fileHeader; 523 | } 524 | } 525 | 526 | /// 527 | /// Gets the optional header 528 | /// 529 | public IMAGE_OPTIONAL_HEADER32 OptionalHeader32 { 530 | get { 531 | return optionalHeader32; 532 | } 533 | } 534 | 535 | /// 536 | /// Gets the optional header 537 | /// 538 | public IMAGE_OPTIONAL_HEADER64 OptionalHeader64 { 539 | get { 540 | return optionalHeader64; 541 | } 542 | } 543 | 544 | public IMAGE_SECTION_HEADER[] ImageSectionHeaders { 545 | get { 546 | return imageSectionHeaders; 547 | } 548 | } 549 | 550 | /// 551 | /// Gets the timestamp from the file header 552 | /// 553 | public DateTime TimeStamp { 554 | get { 555 | // Timestamp is a date offset from 1970 556 | DateTime returnValue = new DateTime(1970, 1, 1, 0, 0, 0); 557 | 558 | // Add in the number of seconds since 1970/1/1 559 | returnValue = returnValue.AddSeconds(fileHeader.TimeDateStamp); 560 | // Adjust to local timezone 561 | returnValue += TimeZone.CurrentTimeZone.GetUtcOffset(returnValue); 562 | 563 | return returnValue; 564 | } 565 | } 566 | 567 | #endregion Properties 568 | } 569 | } 570 | -------------------------------------------------------------------------------- /ProxyDllMaker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace ProxyDllMaker 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// Der Haupteinstiegspunkt für die Anwendung. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ProxyDllMaker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Allgemeine Informationen über eine Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die mit einer Assembly verknüpft sind. 8 | [assembly: AssemblyTitle("ProxyDllMaker")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ProxyDllMaker")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar 18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von 19 | // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 23 | [assembly: Guid("10c6be1f-73fd-4b5e-9de8-b86dc2ae2bde")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | // Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern 33 | // übernehmen, indem Sie "*" eingeben: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ProxyDllMaker/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Dieser Code wurde von einem Tool generiert. 4 | // Laufzeitversion:4.0.30319.34209 5 | // 6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 7 | // der Code erneut generiert wird. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ProxyDllMaker.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. 17 | /// 18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert 19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. 20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen 21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProxyDllMaker.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle 51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Sucht eine lokalisierte Zeichenfolge, die #include "stdafx.h" 65 | ///#pragma pack(1) 66 | /// 67 | ///FARPROC p[##ph1##] = {0}; 68 | /// 69 | ///extern "C" BOOL WINAPI DllMain(HINSTANCE hInst,DWORD reason,LPVOID) 70 | ///{ 71 | /// if (reason == DLL_PROCESS_ATTACH) 72 | /// { 73 | /// HINSTANCE hLThis = hInst; 74 | /// HINSTANCE hL = LoadLibrary(_T(".\\##ph2##")); 75 | /// if (!hL) return false; 76 | /// ##ph3## 77 | /// } 78 | /// if (reason == DLL_PROCESS_DETACH) 79 | /// FreeLibrary(hL); 80 | /// return 1; 81 | ///} 82 | ///##ph4## 83 | /// ähnelt. 84 | /// 85 | internal static string template_cpp { 86 | get { 87 | return ResourceManager.GetString("template_cpp", resourceCulture); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ProxyDllMaker/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\template_cpp.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 123 | 124 | -------------------------------------------------------------------------------- /ProxyDllMaker/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34209 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ProxyDllMaker.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ProxyDllMaker/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ProxyDllMaker/ProxyDllMaker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {3120A1EB-F52B-460E-87FB-DBAF640FFBDF} 8 | WinExe 9 | Properties 10 | ProxyDllMaker 11 | ProxyDllMaker 12 | v4.5 13 | 512 14 | 15 | 16 | bin\x64\Release\ 17 | TRACE 18 | false 19 | pdbonly 20 | x64 21 | prompt 22 | ManagedMinimumRules.ruleset 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Form 41 | 42 | 43 | Form1.cs 44 | 45 | 46 | Form 47 | 48 | 49 | FunctionDialog.cs 50 | 51 | 52 | 53 | Form 54 | 55 | 56 | OptionForm.cs 57 | 58 | 59 | 60 | 61 | 62 | 63 | Form 64 | 65 | 66 | UnDecorator.cs 67 | 68 | 69 | Form1.cs 70 | 71 | 72 | FunctionDialog.cs 73 | 74 | 75 | OptionForm.cs 76 | 77 | 78 | ResXFileCodeGenerator 79 | Resources.Designer.cs 80 | Designer 81 | 82 | 83 | True 84 | Resources.resx 85 | True 86 | 87 | 88 | UnDecorator.cs 89 | 90 | 91 | SettingsSingleFileGenerator 92 | Settings.Designer.cs 93 | 94 | 95 | True 96 | Settings.settings 97 | True 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 114 | -------------------------------------------------------------------------------- /ProxyDllMaker/Resources/template_cpp.txt: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include 4 | #include 5 | #pragma pack(1) 6 | 7 | ##ph1## 8 | 9 | extern "C" BOOL WINAPI DllMain(HINSTANCE hInst,DWORD reason,LPVOID) 10 | { 11 | static HINSTANCE hL; 12 | if (reason == DLL_PROCESS_ATTACH) 13 | { 14 | hL = LoadLibrary(_T(".\\##ph2##.dll")); 15 | if (!hL) return false; 16 | ##ph3## MessageBox(NULL, _T("Hello World"), _T("Hi"), NULL); 17 | } 18 | if (reason == DLL_PROCESS_DETACH) 19 | FreeLibrary(hL); 20 | return TRUE; 21 | } 22 | 23 | ##ph4## 24 | -------------------------------------------------------------------------------- /ProxyDllMaker/UnDecorator.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyDllMaker 2 | { 3 | partial class UnDecorator 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.textBox1 = new System.Windows.Forms.TextBox(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.textBox2 = new System.Windows.Forms.TextBox(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.button1 = new System.Windows.Forms.Button(); 36 | this.SuspendLayout(); 37 | // 38 | // textBox1 39 | // 40 | this.textBox1.Dock = System.Windows.Forms.DockStyle.Top; 41 | this.textBox1.Font = new System.Drawing.Font("Courier New", 10F); 42 | this.textBox1.Location = new System.Drawing.Point(0, 20); 43 | this.textBox1.Name = "textBox1"; 44 | this.textBox1.Size = new System.Drawing.Size(292, 23); 45 | this.textBox1.TabIndex = 3; 46 | // 47 | // label1 48 | // 49 | this.label1.Dock = System.Windows.Forms.DockStyle.Top; 50 | this.label1.Location = new System.Drawing.Point(0, 0); 51 | this.label1.Name = "label1"; 52 | this.label1.Size = new System.Drawing.Size(292, 20); 53 | this.label1.TabIndex = 2; 54 | this.label1.Text = "Symbol Name"; 55 | this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 56 | // 57 | // textBox2 58 | // 59 | this.textBox2.Dock = System.Windows.Forms.DockStyle.Top; 60 | this.textBox2.Font = new System.Drawing.Font("Courier New", 10F); 61 | this.textBox2.Location = new System.Drawing.Point(0, 63); 62 | this.textBox2.Name = "textBox2"; 63 | this.textBox2.Size = new System.Drawing.Size(292, 23); 64 | this.textBox2.TabIndex = 5; 65 | // 66 | // label2 67 | // 68 | this.label2.Dock = System.Windows.Forms.DockStyle.Top; 69 | this.label2.Location = new System.Drawing.Point(0, 43); 70 | this.label2.Name = "label2"; 71 | this.label2.Size = new System.Drawing.Size(292, 20); 72 | this.label2.TabIndex = 4; 73 | this.label2.Text = "Undecorated"; 74 | this.label2.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 75 | // 76 | // button1 77 | // 78 | this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; 79 | this.button1.Dock = System.Windows.Forms.DockStyle.Bottom; 80 | this.button1.Location = new System.Drawing.Point(0, 250); 81 | this.button1.Name = "button1"; 82 | this.button1.Size = new System.Drawing.Size(292, 23); 83 | this.button1.TabIndex = 9; 84 | this.button1.Text = "Undecorate"; 85 | this.button1.UseVisualStyleBackColor = true; 86 | this.button1.Click += new System.EventHandler(this.button1_Click); 87 | // 88 | // UnDecorator 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.ClientSize = new System.Drawing.Size(292, 273); 93 | this.Controls.Add(this.button1); 94 | this.Controls.Add(this.textBox2); 95 | this.Controls.Add(this.label2); 96 | this.Controls.Add(this.textBox1); 97 | this.Controls.Add(this.label1); 98 | this.Name = "UnDecorator"; 99 | this.Text = "UnDecorator"; 100 | this.ResumeLayout(false); 101 | this.PerformLayout(); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private System.Windows.Forms.TextBox textBox1; 108 | private System.Windows.Forms.Label label1; 109 | private System.Windows.Forms.TextBox textBox2; 110 | private System.Windows.Forms.Label label2; 111 | private System.Windows.Forms.Button button1; 112 | 113 | } 114 | } -------------------------------------------------------------------------------- /ProxyDllMaker/UnDecorator.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 ProxyDllMaker 12 | { 13 | public partial class UnDecorator : Form 14 | { 15 | public UnDecorator() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void button1_Click(object sender, EventArgs e) 21 | { 22 | StringBuilder builder = new StringBuilder(255); 23 | DbgHelper.UnDecorateSymbolName(textBox1.Text, builder, builder.Capacity, DbgHelper.UnDecorateFlags.UNDNAME_COMPLETE); 24 | textBox2.Text = builder.ToString(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ProxyDllMaker/UnDecorator.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 | -------------------------------------------------------------------------------- /ProxyDllMaker/bin/x64/Release/ProxyDllMaker.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroKilo/ProxyDllMaker/8f020dd780682a0177e5f4bf0a4514557f697050/ProxyDllMaker/bin/x64/Release/ProxyDllMaker.exe -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | This tool can generate code and export definitions to create a proxy DLL in 32bit and 64bit --------------------------------------------------------------------------------