Skip to content

Commit b92f496

Browse files
committed
Fix showcase
1 parent 828e590 commit b92f496

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

Images/show.gif

827 KB
Loading

Images/showcase.gif

-1.39 MB
Binary file not shown.

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</p>
1313

1414
## Showcase
15-
<img src="Images/showcase.gif">
15+
<img src="Images/show.gif">
1616

1717
# Usage
1818
```sh
@@ -38,36 +38,36 @@ Pack the Output File | No
3838

3939
# Usage can be found in ```Methods\MiddleMan.cs```
4040
```csharp
41-
internal static class MiddleMan
41+
internal static class MiddleMan
42+
{
43+
public static void Prefix(ref object __instance, ref object obj, ref object[] parameters, ref object[] arguments)
4244
{
43-
public static void Prefix(ref object __instance, ref object obj, ref object[] parameters, ref object[] arguments)
45+
var virtualizedMethodName = new StackTrace().GetFrame(7).GetMethod();
46+
var method = (MethodBase) __instance;
47+
48+
ConsoleLogger.Warn("\tVMP MethodName: {0} (MDToken {1:X4})", virtualizedMethodName.FullDescription(), virtualizedMethodName.MetadataToken.ToString());
49+
50+
ConsoleLogger.Warn("\tMethodName: {0}", method.Name);
51+
ConsoleLogger.Warn("\tFullDescription: {0}", method.FullDescription());
52+
ConsoleLogger.Warn("\tMethodType: {0}", method.GetType());
53+
if (obj != null) ConsoleLogger.Warn("\nObj: {0}", obj.GetType());
54+
55+
// Loop through parameters and log them
56+
for (var i = 0; i < parameters.Length; i++)
4457
{
45-
var virtualizedMethodName = new StackTrace().GetFrame(7).GetMethod();
46-
var method = (MethodBase) __instance;
47-
48-
ConsoleLogger.Warn("\tVMP MethodName: {0} (MDToken {1:X4})", virtualizedMethodName.FullDescription(), virtualizedMethodName.MetadataToken.ToString());
49-
ConsoleLogger.Warn("\tMethodName: {0}", method.Name);
50-
ConsoleLogger.Warn("\tFullDescription: {0}", method.FullDescription());
51-
ConsoleLogger.Warn("\tMethodType: {0}", method.GetType());
52-
if (obj != null) ConsoleLogger.Warn("\nObj: {0}", obj.GetType());
53-
54-
// Loop through parameters and log them
55-
for (var i = 0; i < parameters.Length; i++)
56-
{
57-
var parameter = parameters[i] ?? "null";
58-
ConsoleLogger.Warn("\tParameter ({1}) [{0}]: ({2})", i, parameter.GetType(), parameter);
59-
}
60-
61-
var returnType = method is MethodInfo info ? info.ReturnType.FullName : "System.Object";
62-
ConsoleLogger.Warn("\tMDToken: 0x{0:X4}", method.MetadataToken);
63-
ConsoleLogger.Warn("\tReturn Type: {0}", returnType);
64-
}
65-
66-
public static void Postfix(ref object __instance, ref object __result, ref object obj, ref object[] parameters, ref object[] arguments)
67-
{
68-
ConsoleLogger.Warn("\tReturns: {0}", __result);
58+
var parameter = parameters[i] ?? "null";
59+
ConsoleLogger.Warn("\tParameter ({1}) [{0}]: ({2})", i, parameter.GetType(), parameter);
6960
}
61+
var returnType = method is MethodInfo info ? info.ReturnType.FullName : "System.Object";
62+
ConsoleLogger.Warn("\tMDToken: 0x{0:X4}", method.MetadataToken);
63+
ConsoleLogger.Warn("\tReturn Type: {0}", returnType);
64+
}
65+
66+
public static void Postfix(ref object __instance, ref object __result, ref object obj, ref object[] parameters, ref object[] arguments)
67+
{
68+
ConsoleLogger.Warn("\tReturns: {0}", __result);
7069
}
70+
}
7171
```
7272

7373
## Current Features

0 commit comments

Comments
 (0)