Skip to content

Commit f26d403

Browse files
committed
Initial Commit.
1 parent 7237914 commit f26d403

10 files changed

+644
-1
lines changed

FrostbitePlugin.csproj

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" 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)' == '' ">x86</Platform>
7+
<ProjectGuid>{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>FrostbitePlugin</RootNamespace>
11+
<AssemblyName>FrostbitePlugin</AssemblyName>
12+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
16+
<PlatformTarget>x86</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>TRACE;DEBUG;WIN32</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
27+
<PlatformTarget>x86</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE;WIN32;RELEASE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
36+
<PlatformTarget>x64</PlatformTarget>
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>full</DebugType>
39+
<Optimize>false</Optimize>
40+
<OutputPath>bin\Debug\x64\</OutputPath>
41+
<DefineConstants>TRACE;DEBUG;WIN64</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
45+
</PropertyGroup>
46+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
47+
<PlatformTarget>x64</PlatformTarget>
48+
<DebugType>pdbonly</DebugType>
49+
<Optimize>true</Optimize>
50+
<OutputPath>bin\Release\x64\</OutputPath>
51+
<DefineConstants>TRACE;WIN64;RELEASE</DefineConstants>
52+
<ErrorReport>prompt</ErrorReport>
53+
<WarningLevel>4</WarningLevel>
54+
</PropertyGroup>
55+
<ItemGroup>
56+
<Reference Include="System" />
57+
<Reference Include="System.Core" />
58+
<Reference Include="System.Drawing" />
59+
<Reference Include="System.Xml.Linq" />
60+
<Reference Include="System.Data.DataSetExtensions" />
61+
<Reference Include="Microsoft.CSharp" />
62+
<Reference Include="System.Data" />
63+
<Reference Include="System.Net.Http" />
64+
<Reference Include="System.Xml" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<Compile Include="FrostbitePluginExt.cs" />
68+
<Compile Include="Properties\AssemblyInfo.cs" />
69+
<Compile Include="Properties\Resources.Designer.cs">
70+
<AutoGen>True</AutoGen>
71+
<DesignTime>True</DesignTime>
72+
<DependentUpon>Resources.resx</DependentUpon>
73+
</Compile>
74+
<Compile Include="WeakPtrNode.cs" />
75+
<Compile Include="WeakPtrSchemaConverter.cs" />
76+
</ItemGroup>
77+
<ItemGroup>
78+
<ProjectReference Include="..\ReClass.NET\ReClass.NET.csproj">
79+
<Project>{BFB8917D-E9B4-463F-A6E8-612C35728C78}</Project>
80+
<Name>ReClass.NET</Name>
81+
</ProjectReference>
82+
</ItemGroup>
83+
<ItemGroup>
84+
<EmbeddedResource Include="Properties\Resources.resx">
85+
<Generator>ResXFileCodeGenerator</Generator>
86+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
87+
</EmbeddedResource>
88+
</ItemGroup>
89+
<ItemGroup>
90+
<None Include="Resources\logo_frostbite.png" />
91+
</ItemGroup>
92+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
93+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
94+
Other similar extension points exist, see Microsoft.Common.targets.
95+
<Target Name="BeforeBuild">
96+
</Target>
97+
<Target Name="AfterBuild">
98+
</Target>
99+
-->
100+
</Project>

FrostbitePlugin.sln

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrostbitePlugin", "FrostbitePlugin.csproj", "{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "..\ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Debug|Any CPU.ActiveCfg = Debug|x86
21+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Debug|x64.ActiveCfg = Debug|x64
22+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Debug|x64.Build.0 = Debug|x64
23+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Debug|x86.ActiveCfg = Debug|x86
24+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Debug|x86.Build.0 = Debug|x86
25+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Release|Any CPU.ActiveCfg = Release|x86
26+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Release|x64.ActiveCfg = Release|x64
27+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Release|x64.Build.0 = Release|x64
28+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Release|x86.ActiveCfg = Release|x86
29+
{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}.Release|x86.Build.0 = Release|x86
30+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|Any CPU.ActiveCfg = Debug|x86
31+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x64.ActiveCfg = Debug|x64
32+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x64.Build.0 = Debug|x64
33+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x86.ActiveCfg = Debug|x86
34+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Debug|x86.Build.0 = Debug|x86
35+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|Any CPU.ActiveCfg = Release|x86
36+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x64.ActiveCfg = Release|x64
37+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x64.Build.0 = Release|x64
38+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x86.ActiveCfg = Release|x86
39+
{BFB8917D-E9B4-463F-A6E8-612C35728C78}.Release|x86.Build.0 = Release|x86
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
EndGlobal

FrostbitePluginExt.cs

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
using System;
2+
using System.Drawing;
3+
using System.Text;
4+
using ReClassNET;
5+
using ReClassNET.Nodes;
6+
using ReClassNET.Plugins;
7+
using ReClassNET.Util;
8+
9+
namespace FrostbitePlugin
10+
{
11+
public class FrostbitePluginExt : Plugin
12+
{
13+
private IPluginHost host;
14+
15+
internal static Settings Settings;
16+
17+
private INodeInfoReader reader;
18+
19+
private WeakPtrSchemaConverter converter;
20+
21+
public override Image Icon => Properties.Resources.logo_frostbite;
22+
23+
public override bool Initialize(IPluginHost host)
24+
{
25+
//System.Diagnostics.Debugger.Launch();
26+
27+
if (this.host != null)
28+
{
29+
Terminate();
30+
}
31+
32+
if (host == null)
33+
{
34+
throw new ArgumentNullException(nameof(host));
35+
}
36+
37+
this.host = host;
38+
39+
Settings = host.Settings;
40+
41+
// Register the InfoReader
42+
reader = new FrostBiteNodeInfoReader();
43+
host.RegisterNodeInfoReader(reader);
44+
45+
// Register the WeakPtr node
46+
converter = new WeakPtrSchemaConverter();
47+
host.RegisterNodeType(typeof(WeakPtrNode), converter, "Frostbite WeakPtr", Icon);
48+
49+
return true;
50+
}
51+
52+
public override void Terminate()
53+
{
54+
host.UnregisterNodeType(typeof(WeakPtrNode), converter);
55+
56+
host.UnregisterNodeInfoReader(reader);
57+
58+
host = null;
59+
}
60+
}
61+
62+
63+
/// <summary>A custom node info reader which outputs Frostbite type infos.</summary>
64+
class FrostBiteNodeInfoReader : INodeInfoReader
65+
{
66+
public string ReadNodeInfo(BaseNode node, IntPtr value, Memory memory)
67+
{
68+
var getTypeFnPtr = memory.Process.ReadRemoteObject<IntPtr>(value);
69+
if (getTypeFnPtr.MayBeValid())
70+
{
71+
#if WIN64
72+
var offset = memory.Process.ReadRemoteObject<int>(getTypeFnPtr + 3);
73+
var typeInfoPtr = getTypeFnPtr + offset + 7;
74+
#else
75+
var typeInfoPtr = memory.Process.ReadRemoteObject<IntPtr>(getTypeFnPtr + 1);
76+
#endif
77+
if (typeInfoPtr.MayBeValid())
78+
{
79+
var typeInfoDataPtr = memory.Process.ReadRemoteObject<IntPtr>(typeInfoPtr);
80+
if (typeInfoDataPtr.MayBeValid())
81+
{
82+
var namePtr = memory.Process.ReadRemoteObject<IntPtr>(typeInfoDataPtr);
83+
if (namePtr.MayBeValid())
84+
{
85+
return memory.Process.ReadRemoteString(Encoding.UTF8, namePtr, 64);
86+
}
87+
}
88+
}
89+
}
90+
91+
return null;
92+
}
93+
}
94+
}

Properties/AssemblyInfo.cs

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+
// Allgemeine Informationen über eine Assembly werden über die folgenden
6+
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7+
// die einer Assembly zugeordnet sind.
8+
[assembly: AssemblyTitle("Frostbite Helper")]
9+
[assembly: AssemblyDescription("A plugin which displays type infos of Frostbite classes and adds the WeakPtr node.")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("KN4CK3R")]
12+
[assembly: AssemblyProduct("ReClass.NET Plugin")]
13+
[assembly: AssemblyCopyright("")]
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 aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
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("ca79ba0b-0d80-476a-b793-fc7ef6dcead7")]
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")]

Properties/Resources.Designer.cs

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)