Skip to content

Commit 3aec7c8

Browse files
committed
From VB to CSharp, from GUI to CLI
1 parent 82c0362 commit 3aec7c8

18 files changed

+376
-905
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.30128.74
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ProxyRemover by Jomtek", "ProxyRemover by Jomtek\ProxyRemover by Jomtek.vbproj", "{A6AC4BBD-56DE-4D1D-91C0-32555896BB78}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jomtek's Proxy Remover", "Jomtek's Proxy Remover\Jomtek's Proxy Remover.csproj", "{66FA1749-D522-4CF6-9D36-D4418F950D4B}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{A6AC4BBD-56DE-4D1D-91C0-32555896BB78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{A6AC4BBD-56DE-4D1D-91C0-32555896BB78}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{A6AC4BBD-56DE-4D1D-91C0-32555896BB78}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{A6AC4BBD-56DE-4D1D-91C0-32555896BB78}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{66FA1749-D522-4CF6-9D36-D4418F950D4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{66FA1749-D522-4CF6-9D36-D4418F950D4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{66FA1749-D522-4CF6-9D36-D4418F950D4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{66FA1749-D522-4CF6-9D36-D4418F950D4B}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {CE14A57D-60A3-4362-A700-49BEEE926A21}
23+
SolutionGuid = {96C3FCE8-2F79-41C3-B6D5-601F62713E69}
2424
EndGlobalSection
2525
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3-
<startup>
3+
<startup>
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
55
</startup>
66
</configuration>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{66FA1749-D522-4CF6-9D36-D4418F950D4B}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>Jomtek_s_Proxy_Remover</RootNamespace>
10+
<AssemblyName>Jomtek%27s Proxy Remover</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="dnlib">
37+
<HintPath>..\..\..\..\Documents\Software cracking\Development\dnlib\dnlib.dll</HintPath>
38+
</Reference>
39+
<Reference Include="System" />
40+
<Reference Include="System.Core" />
41+
<Reference Include="System.Xml.Linq" />
42+
<Reference Include="System.Data.DataSetExtensions" />
43+
<Reference Include="Microsoft.CSharp" />
44+
<Reference Include="System.Data" />
45+
<Reference Include="System.Net.Http" />
46+
<Reference Include="System.Xml" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="Program.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
<Compile Include="ProxyRemover.cs" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<None Include="App.config" />
55+
</ItemGroup>
56+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
</Project>

Jomtek's Proxy Remover/Program.cs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using dnlib.DotNet;
2+
using dnlib.DotNet.Emit;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Reflection;
7+
using System.Text;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
11+
namespace Jomtek_s_Proxy_Remover
12+
{
13+
class Program
14+
{
15+
static void Main(string[] args)
16+
{
17+
while (true)
18+
{
19+
Console.Clear();
20+
21+
string modulePath = "";
22+
int proxyDepth = 0;
23+
24+
try
25+
{
26+
modulePath = args[0];
27+
}
28+
catch (IndexOutOfRangeException)
29+
{
30+
Console.WriteLine("Error : no module selected... press ENTER to exit.");
31+
Console.ReadLine();
32+
Environment.Exit(0);
33+
}
34+
35+
Console.Write("Proxy depth : ");
36+
int.TryParse(Console.ReadLine(), out proxyDepth);
37+
38+
if (proxyDepth < 1)
39+
{
40+
Console.WriteLine("Invalid proxy depth (should be greater than 1)");
41+
Thread.Sleep(700);
42+
continue;
43+
}
44+
45+
Console.Clear();
46+
47+
ModuleContext modCtx = ModuleDef.CreateModuleContext();
48+
ModuleDefMD module = ModuleDefMD.Load(modulePath, modCtx);
49+
50+
var myProxyRemover = new ProxyRemover(module, modulePath);
51+
int removedProxies = myProxyRemover.RemoveProxiesFromTypes(module.Types, proxyDepth);
52+
53+
if (removedProxies > 0) Console.WriteLine();
54+
Console.WriteLine(removedProxies + " proxies removed");
55+
Console.WriteLine();
56+
57+
if (removedProxies > 0)
58+
{
59+
Console.WriteLine("Saving module...");
60+
myProxyRemover.SaveModule();
61+
}
62+
63+
64+
Console.WriteLine("Done.");
65+
Console.ReadLine();
66+
break;
67+
}
68+
}
69+
}
70+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Jomtek's Proxy Remover")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Jomtek's Proxy Remover")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("66fa1749-d522-4cf6-9d36-d4418f950d4b")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)