first commit
This commit is contained in:
commit
7dd9dd689e
40 changed files with 4100 additions and 0 deletions
74
ProtoGen/ProtoCache.cpp
Normal file
74
ProtoGen/ProtoCache.cpp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#include "ProtoCache.h"
|
||||
#include "ProtoMetadata.h"
|
||||
|
||||
TypeCache TypeCache::init() {
|
||||
TypeCache cache;
|
||||
|
||||
auto corlib = Il2CppApi::AssemblyGetImage(Il2CppApi::DomainAssemblyOpen("mscorlib.dll"));
|
||||
auto assembly = Il2CppApi::AssemblyGetImage(Il2CppApi::DomainAssemblyOpen("Assembly-CSharp.dll"));
|
||||
|
||||
cache.type_map = std::map<std::size_t, CachedType> {
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Object")),
|
||||
Object,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Boolean")),
|
||||
Boolean,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Byte")),
|
||||
Byte,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "SByte")),
|
||||
SByte,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "UInt16")),
|
||||
UInt16,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Int16")),
|
||||
Int16,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "UInt32")),
|
||||
UInt32,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Int32")),
|
||||
Int32,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "UInt64")),
|
||||
UInt64,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Int64")),
|
||||
Int64,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Single")),
|
||||
Single,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Double")),
|
||||
Double,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "String")),
|
||||
String,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(corlib, "System", "Enum")),
|
||||
Enum,
|
||||
},
|
||||
{
|
||||
reinterpret_cast<std::size_t>(Il2CppApi::ClassFromName(assembly, "", BYTE_STRING)),
|
||||
ByteString,
|
||||
},
|
||||
};
|
||||
|
||||
return cache;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue