Skip to content

Commit 215aae3

Browse files
authored
Merge pull request #74 from irsdl/master
improving BF minifier
2 parents 3a50615 + f1849bd commit 215aae3

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

ysoserial/Generators/Generator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public const string
3232
NotBridgeNotDerived = "Not bridge or derived",
3333
NotBridgeButDervied = "Not bridge but derived", // Bridge has dervied meaning in it too
3434
BridgeAndDerived = "Bridge and dervied",
35-
Mask = "It relies on other gadgets and is not a real gadget on its own (not really bridged or derived)", // We hide these in normal help as they are only valuable for research purposes - example is ResourceSet
35+
Dummy = "It relies on other gadgets and is not a real gadget on its own (not bridged or derived either)", // We hide these in normal help as they are only valuable for research purposes - example is ResourceSet
3636
None="";
3737
}
3838
}

ysoserial/Generators/ResourceSetGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override string Finders()
3030

3131
public override List<string> Labels()
3232
{
33-
return new List<string> { GadgetTypes.Mask }; // It works because we have a hashtable that holds the actual gadget!
33+
return new List<string> { GadgetTypes.Dummy }; // It works because we have a hashtable that holds the actual gadget!
3434
}
3535

3636
public override OptionSet Options()

ysoserial/Helpers/BinaryFormatterMinifier.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ public static string AssemblyOrTypeNameMinifier(string strInput)
9090
strInput = strInput_simpleCorlibAsm;
9191
}
9292

93+
if (strInput.Contains(",mscorlib"))
94+
{
95+
string strInput_removedMSCORLIB = strInput.Replace(",mscorlib", "");
96+
97+
if (IsValid(strInput_removedMSCORLIB, isAssemblyString))
98+
strInput = strInput_removedMSCORLIB;
99+
}
100+
93101
return strInput;
94102
}
95103

ysoserial/Helpers/TestingArena/TestingArenaHome.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
using ysoserial.Helpers.ModifiedVulnerableBinaryFormatters;
1313
using System.Web.UI.WebControls;
1414
using System.Configuration;
15+
using System.Collections.Specialized;
16+
using System.Reflection;
17+
using System.Windows.Data;
18+
using System.Runtime.Serialization;
1519

1620
namespace ysoserial.Helpers.TestingArena
1721
{
@@ -36,13 +40,15 @@ public override OptionSet Options()
3640
public void Start(InputArgs inputArgs)
3741
{
3842
this.inputArgs = inputArgs;
43+
// Add your function here perhaps - some examples:
3944
//MinimiseTCDJsonAndRun();
4045
//ManualTCDGPayload4Minifying();
4146
//TextFormatterMinifying();
4247
//ActivitySurrogateSelector();
4348
Console.ReadLine();
4449
}
4550

51+
4652
private void ActivitySurrogateSelector()
4753
{
4854
string myApp = "TestConsoleApp_YSONET";

ysoserial/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private static void ShowHelp()
396396
ObjectHandle container = Activator.CreateInstance(null, "ysoserial.Generators." + g + "Generator");
397397
Generator gg = (Generator)container.Unwrap();
398398

399-
if (gg.Labels().Contains(GadgetTypes.Mask) && !show_fullhelp)
399+
if (gg.Labels().Contains(GadgetTypes.Dummy) && !show_fullhelp)
400400
{
401401
// We hide the Mask gadgets in normal help as they are not that important!
402402
continue;

0 commit comments

Comments
 (0)