Skip to content

Commit 5765f04

Browse files
committed
Add Dump Function for Later Use
1 parent e8f2930 commit 5765f04

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

PawMapLoader/PawMapLoader.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<AssemblyName>PawMapLoader</AssemblyName>
1313
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
15+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -570,6 +571,7 @@
570571
<Compile Include="Res\Components\PawScript.cs" />
571572
<Compile Include="Res\Components\PawScriptDamageable.cs" />
572573
<Compile Include="Res\Components\SceneRoot.cs" />
574+
<Compile Include="Res\Debug\MethodDump.cs" />
573575
<Compile Include="Res\Enum\AsyncBundleLoader.cs" />
574576
<Compile Include="Res\Enum\LevelDataProvider.cs" />
575577
<Compile Include="Res\FileManagement.cs" />
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.IO;
2+
using System.Linq;
3+
using System.Text;
4+
using Il2CppSystem;
5+
using Il2CppSystem.Reflection;
6+
7+
namespace PawMapLoader.Res.Debug
8+
{
9+
public class MethodDump
10+
{
11+
public static void Create()
12+
{
13+
var strh_DumpText = new StringBuilder();
14+
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
15+
{
16+
strh_DumpText.AppendLine("==== GAME DUMP ====");
17+
strh_DumpText.AppendLine($"[] {asm.GetName().Name}");
18+
Type[] types;
19+
try {types = asm.GetTypes();} catch { continue; }
20+
21+
foreach (var type in types)
22+
{
23+
strh_DumpText.AppendLine($"|| {type.Name}");
24+
25+
foreach (var method in type.GetMethods( BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance))
26+
{
27+
var tempstr = string.Join(", ", method.GetParameters().Select(p => $"{p.ParameterType.Name} {p.Name}"));
28+
strh_DumpText.AppendLine($"||==> {method.Name}({tempstr})");
29+
}
30+
}
31+
}
32+
File.WriteAllText(Path.Combine(Environment.CurrentDirectory, "GameDump.txt"), strh_DumpText.ToString());
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)