C++: Rename il2cpp-api-functions-ptr.h and il2cpp-types-ptr.h

This commit is contained in:
Katy Coe
2020-08-01 16:56:11 +02:00
parent 4ae6772f5a
commit 8372afd619
3 changed files with 16 additions and 15 deletions

View File

@@ -116,8 +116,8 @@ typedef size_t uintptr_t;
} }
writer.Close(); writer.Close();
// Write API function pointers to il2cpp-function-ptr.h // Write API function pointers to il2cpp-api-functions-ptr.h
var il2cppFnPtrFile = Path.Combine(srcDataPath, "il2cpp-function-ptr.h"); var il2cppFnPtrFile = Path.Combine(srcDataPath, "il2cpp-api-functions-ptr.h");
using var fs2 = new FileStream(il2cppFnPtrFile, FileMode.Create); using var fs2 = new FileStream(il2cppFnPtrFile, FileMode.Create);
writer = new StreamWriter(fs2, Encoding.ASCII); writer = new StreamWriter(fs2, Encoding.ASCII);
@@ -136,8 +136,8 @@ typedef size_t uintptr_t;
writer.Close(); writer.Close();
// Write application type definition addresses to il2cpp-type-ptr.h // Write application type definition addresses to il2cpp-types-ptr.h
var il2cppTypeInfoFile = Path.Combine(srcDataPath, "il2cpp-type-ptr.h"); var il2cppTypeInfoFile = Path.Combine(srcDataPath, "il2cpp-types-ptr.h");
using var fs3 = new FileStream(il2cppTypeInfoFile, FileMode.Create); using var fs3 = new FileStream(il2cppTypeInfoFile, FileMode.Create);
writer = new StreamWriter(fs3, Encoding.ASCII); writer = new StreamWriter(fs3, Encoding.ASCII);

View File

@@ -122,6 +122,7 @@ namespace Il2CppInspector.Properties {
/// ///
///#include <string> ///#include <string>
///#include <sstream> ///#include <sstream>
///#include <iomanip>
/// ///
///// Helper function to get the module base address ///// Helper function to get the module base address
///uintptr_t GetBaseAddress(); ///uintptr_t GetBaseAddress();
@@ -133,7 +134,7 @@ namespace Il2CppInspector.Properties {
///void NewConsole(); ///void NewConsole();
/// ///
///// Helper function to convert a pointer to hex ///// Helper function to convert a pointer to hex
///template<typename T> std::string to_hex_string(T [rest of string was truncated]";. ///template<t [rest of string was truncated]";.
/// </summary> /// </summary>
internal static string Cpp_HelpersH { internal static string Cpp_HelpersH {
get { get {
@@ -153,7 +154,7 @@ namespace Il2CppInspector.Properties {
///#include &quot;il2cpp-types.h&quot; ///#include &quot;il2cpp-types.h&quot;
/// ///
///// IL2CPP API function pointers ///// IL2CPP API function pointers
///#include &quot;il2cpp-function-ptr.h&quot; ///#include &quot;il2cpp-api-functions-ptr.h&quot;
/// ///
///// IL2CPP APIs ///// IL2CPP APIs
///#define DO_API(r, n, p) extern r (*n) p ///#define DO_API(r, n, p) extern r (*n) p
@@ -163,8 +164,7 @@ namespace Il2CppInspector.Properties {
///// Application-specific functions ///// Application-specific functions
///#define DO_APP_FUNC(a, r, n, p) extern r (*n) p ///#define DO_APP_FUNC(a, r, n, p) extern r (*n) p
///namespace app { ///namespace app {
/// #include &quot;il2cpp-functions.h&quot; /// #incl [rest of string was truncated]&quot;;.
///} [rest of string was truncated]&quot;;.
/// </summary> /// </summary>
internal static string Cpp_Il2CppAppDataH { internal static string Cpp_Il2CppAppDataH {
get { get {
@@ -195,7 +195,7 @@ namespace Il2CppInspector.Properties {
///#undef DO_APP_FUNC ///#undef DO_APP_FUNC
/// ///
///// TypeInfo pointers ///// TypeInfo pointers
///#define DO_TYPEDEF(a, n [rest of string was truncated]&quot;;. ///# [rest of string was truncated]&quot;;.
/// </summary> /// </summary>
internal static string Cpp_Il2CppInitCpp { internal static string Cpp_Il2CppInitCpp {
get { get {

View File

@@ -190,6 +190,7 @@ void NewConsole() {
#include &lt;string&gt; #include &lt;string&gt;
#include &lt;sstream&gt; #include &lt;sstream&gt;
#include &lt;iomanip&gt;
// Helper function to get the module base address // Helper function to get the module base address
uintptr_t GetBaseAddress(); uintptr_t GetBaseAddress();
@@ -290,9 +291,9 @@ void Run()
&lt;/ItemGroup&gt; &lt;/ItemGroup&gt;
&lt;ItemGroup&gt; &lt;ItemGroup&gt;
&lt;ClInclude Include="appdata\il2cpp-api-functions.h" /&gt; &lt;ClInclude Include="appdata\il2cpp-api-functions.h" /&gt;
&lt;ClInclude Include="appdata\il2cpp-function-ptr.h" /&gt; &lt;ClInclude Include="appdata\il2cpp-api-functions-ptr.h" /&gt;
&lt;ClInclude Include="appdata\il2cpp-functions.h" /&gt; &lt;ClInclude Include="appdata\il2cpp-functions.h" /&gt;
&lt;ClInclude Include="appdata\il2cpp-type-ptr.h" /&gt; &lt;ClInclude Include="appdata\il2cpp-types-ptr.h" /&gt;
&lt;ClInclude Include="appdata\il2cpp-types.h" /&gt; &lt;ClInclude Include="appdata\il2cpp-types.h" /&gt;
&lt;ClInclude Include="framework\helpers.h" /&gt; &lt;ClInclude Include="framework\helpers.h" /&gt;
&lt;ClInclude Include="framework\il2cpp-appdata.h" /&gt; &lt;ClInclude Include="framework\il2cpp-appdata.h" /&gt;
@@ -1143,7 +1144,7 @@ EndGlobal
#include "il2cpp-types.h" #include "il2cpp-types.h"
// IL2CPP API function pointers // IL2CPP API function pointers
#include "il2cpp-function-ptr.h" #include "il2cpp-api-functions-ptr.h"
// IL2CPP APIs // IL2CPP APIs
#define DO_API(r, n, p) extern r (*n) p #define DO_API(r, n, p) extern r (*n) p
@@ -1160,7 +1161,7 @@ namespace app {
// TypeInfo pointers // TypeInfo pointers
#define DO_TYPEDEF(a, n) extern n ## __Class* n ## __TypeInfo #define DO_TYPEDEF(a, n) extern n ## __Class* n ## __TypeInfo
namespace app { namespace app {
#include "il2cpp-type-ptr.h" #include "il2cpp-types-ptr.h"
} }
#undef DO_TYPEDEF</value> #undef DO_TYPEDEF</value>
</data> </data>
@@ -1189,7 +1190,7 @@ namespace app {
// TypeInfo pointers // TypeInfo pointers
#define DO_TYPEDEF(a, n) n ## __Class* n ## __TypeInfo #define DO_TYPEDEF(a, n) n ## __Class* n ## __TypeInfo
namespace app { namespace app {
#include "il2cpp-type-ptr.h" #include "il2cpp-types-ptr.h"
} }
#undef DO_TYPEDEF #undef DO_TYPEDEF
@@ -1213,7 +1214,7 @@ void init_il2cpp()
// Define TypeInfo variables // Define TypeInfo variables
#define DO_TYPEDEF(a, n) n ## __TypeInfo = *(n ## __Class**) (baseAddress + a); #define DO_TYPEDEF(a, n) n ## __TypeInfo = *(n ## __Class**) (baseAddress + a);
#include "il2cpp-type-ptr.h" #include "il2cpp-types-ptr.h"
#undef DO_TYPEDEF #undef DO_TYPEDEF
}</value> }</value>
</data> </data>