精华内容
下载资源
问答
  • cpp
    千次阅读
    2021-05-17 17:49:34

    简述

    Cppcheck 是一种 C/C++ 代码缺陷静态检查工具。不一样于 C/C++ 编译器及不少其它分析工具,它不检查代码中的语法错误。Cppcheck 只检查编译器检查不出来的 bug 类型,其目的是检查代码中真正的错误(即:零误报)。数据库

    |版权声明:一去、二三里,未经博主容许不得转载。编程

    介绍

    支持的代码和平台:json

    能够检查非标准代码,包括不一样的编译器扩展、内联汇编代码等。

    Cppcheck 应该被处理最新 C++ 标准的任何 C++ 编译器所编译。

    Cppcheck 应该在任何有足够 CPU 和内存的平台上工做。

    要知道 Cppcheck 有限制,Cppcheck 不多在报告错误方面出错,但有不少 bug,它不能检测。markdown

    经过仔细测试软件,你会发现软件中有更多的 bug,而不是使用 Cppcheck。但 Cppcheck 仍能够检测到在测试和评估软件时错过的一些 bug。多线程

    开始使用

    第一个测试程序

    这里有一段简单的代码:函数

    int main()

    {

    char a[10];

    a[10] = 0; return 0; }

    1

    2

    3

    4

    5

    6

    将代码保存进 file.c 文件中,执行:工具

    cppcheck file.c

    1

    注意:执行此命令前,须要将 cppcheck.exe 所在路径添加至环境变量 PATH 中。性能

    这时,将会从 cppcheck 中输出:测试

    Checking file.c …

    [file.c:4]: (error) Array ‘a[10]’ accessed at index 10, which is out of bounds.

    检查文件夹中的全部文件

    一般一个项目会有许多源文件,若是须要同时检查,Cppcheck 能够检查文件夹中的全部文件:

    cppcheck path

    1

    若是 path 是一个文件夹,cppcheck 将递归检查这个文件夹中的全部源文件。

    Checking path/file1.cpp…

    1/2 files checked 50% done

    Checking path/file2.cpp…

    2/2 files checked 100% done

    手动检查文件或使用项目文件

    使用 Cppcheck 能够手动检查文件,经过指定文件/文件夹来检查和设置,或者可使用一个工程文件(cmake/visual studio)。

    使用项目文件更快,由于它只须要很是少的配置。

    手动检查文件能够更好的控制分析。

    不必定哪一种方法会有最好的结果,建议尝试一下,可能会获得不一样的结果,发现大多数 bug 须要使用这两种方法。

    检查时排除某个文件或文件夹

    排除一个文件或文件夹有两个选项,第一个选项是只提供你想检查的路径和文件:

    cppcheck src/a src/b

    1

    全部位于 src/a 和 src/b 下的文件都会被检查。

    方式二:使用 -i 选项

    这时,将会忽略指定的文件/文件夹,使用下面命令在 src/c 将不会被检查:

    cppcheck -isrc/c src

    1

    严重性

    可能的严重性消息有:

    错误

    当发现 bug 时使用

    警告

    关于防护性编程,以防止 bug 的建议

    风格警告

    风格有关问题的代码清理(未使用的函数、冗余代码、常量性等等)

    可移植性警告

    可移植性警告。64 位的可移植性,代码可能在不一样的编译器中运行结果不一样。

    性能警告

    建议使代码更快。这些建议只是基于常识,即便修复这些消息,也不肯定会获得任何可测量的性能提高。

    信息消息

    配置问题,建议在配置期间仅启用这些。

    启用消息

    默认状况下,只显示错误消息,能够经过 --enable 命令启用更多检查。

    启用警告消息:

    cppcheck --enable=warning file.c

    1

    启用性能消息:

    cppcheck --enable=performance file.c

    1

    启用信息消息:

    cppcheck --enable=information file.c

    1

    因为历史缘由 --enable=style 能够启用警告、性能、可移植性和样式信息。当使用旧 XML 格式时,这些都由 style 表示:

    cppcheck --enable=style file.c

    1

    启用警告和性能消息:

    cppcheck --enable=warning,performance file.c

    1

    启用 unusedFunction 检查。这不能经过 --enable=style 启用,由于不会在库中正常工做。

    cppcheck --enable=unusedFunction file.c

    1

    启用全部消息:

    cppcheck --enable=all

    1

    不肯定消息

    默认状况下,若是肯定,Cppcheck 只显示错误消息。若是使用 --inconclusive,当分析不肯定时,也会写错误消息。

    cppcheck --inconclusive path

    1

    这固然会致使错误的警告,即便在没有 bug 的状况下,也可能会报 bug。若是能够接受错误的警告,可使用此命令。

    保存结果到文件中

    不少时候,会但愿将结果保存在一个文件中,可使用 shell 的管道重定向错误输出到一个文件:

    cppcheck file.c 2> err.txt

    1

    多线程检查

    选项 -j 用于指定须要使用的线程数,例如,使用 4 个线程检查文件夹中的文件:

    cppcheck -j 4 path

    1

    注意:这将禁用 unusedFunction 检查。

    平台

    应该使用一个与你的目标匹配的平台配置。

    默认状况下,若是代码在本地编译和执行,Cppcheck 会使用本地平台配置。

    Cppcheck 具备用于 Unix 和 Windows 目标的内置配置,能够轻松地使用这些 --platform 命令行标志。

    还能够在 XML 文件中建立本身的自定义平台配置。这里有一个例子:

    8signed24484812442

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    项目

    当使用 CMake 或 Visual Studio 时,可使用 --project 来分析项目。

    它会给你快速和简单的结果,不须要作太多的配置。但很难说这是否将会给你最好的结果,建议试一试它,并尝试不使用 --project 分析源代码,看哪一个选项更适合。

    CMake

    Cppcheck 能够理解编译数据库,能够用 CMake 生成这些。

    例如:

    $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

    1

    文件 compile_commands.json 在当前文件夹中建立。

    如今像这样运行 Cppcheck:

    $ cppcheck --project=compile_commands.json

    1

    Visual Studio

    能够对单个项目文件(*.vcxproj)或整个解决方案(*.sln)运行 Cppcheck。

    在整个解决方案上运行 cppcheck:

    $ cppcheck --project=foobar.sln

    1

    在单个项目文件上运行 cppcheck:

    $ cppcheck --project=foobar.vcxproj

    1

    注意:还有一个 Visual Studio 插件,容许在 Visual Studio 中运行 cppcheck。

    预处理器设置

    若是使用 --project,那么 Cppcheck 将使用项目文件中的预处理器设置。

    不然,可能须要配置包含路径,定义等。

    定义

    这有一个文件,有两个配置(定义和没定义 A):

    #ifdef A

    x = y;

    #else

    x = z;

    #endif

    1

    2

    3

    4

    5

    默认状况下,Cppcheck 将检查全部预处理器配置(除了那些具备 #error 的配置),因此上述代码将被分析在当 A 定义和不定义的状况下。

    可使用 -D 更改。当使用 -D 时,cppcheck 将默认只检查给定的配置,不会检查其它,这就是编译器的工做原理。可是可使用 --force 或 --max-configs 来覆盖配置数量。

    检查全部配置:

    cppcheck file.c

    1

    只检查配置 A:

    cppcheck -DA file.c

    1

    当定义宏 A 时,检查全部配置:

    cppcheck -DA --force file.c

    1

    另外一个有用的标志多是 -U,它未定义符号。 用法示例:

    cppcheck -UX file.c

    1

    这意味着 X 没有定义,Cppcheck 不会检查当定义 X 时会发生什么。

    XML 输出

    Cppcheck 能够生成 XML 格式的输出。有一个旧的 XML 格式(version 1)和一个新的 XML 格式(version 2)。若是能够,请使用新版本。

    旧版本保持向后兼容性。它不会改变,但有一天可能会被删除。使用 --xml 支持这种格式。

    新版本修复一些旧格式的问题。新格式可能会在 cppcheck 的将来版本中更新,并带有新的属性和元素。用于检查文件并以新的 XML 格式输出错误的示例命令:

    cppcheck --xml-version=2 file.cpp

    1

    这是一个 version 2 示例:

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    元素

    每一个错误都在 元素中,属性:

    id

    错误的 id,这些都是有效的符号名称。

    severity

    error、warning、style、performance、portability、information 中的任何一个。

    msg

    短格式的错误消息

    verbose

    长格式的错误消息

    inconclusive

    此属性仅在消息不肯定时使用

    cwe

    消息的 CWE ID,此属性仅在消息的 CWE ID 已知时使用。

    元素

    元素列出全部错误相关位置,首先列出主要位置。

    属性:

    file

    文件名,相对路径和绝对路径都是可能的。

    file0

    源文件的名称(可选)

    line

    一个数字

    msg

    此属性尚不存在,但未来能够为每一个位置添加一条短消息。

    格式化输出

    若是想从新格式化输出,使它看起来不一样,可使用模板。

    要得到 Visual Studio 兼容的输出,可使用 --template=vs:

    cppcheck --template=vs gui/test.cpp

    1

    输出将以下所示:

    Checking gui/test.cpp…

    gui/test.cpp(31): error: Memory leak: b

    gui/test.cpp(16): error: Mismatching allocation and deallocation: k

    要得到 gcc 兼容的输出,可使用 --template=gcc:

    cppcheck --template=gcc gui/test.cpp

    1

    输出将以下所示:

    Checking gui/test.cpp…

    gui/test.cpp:31: error: Memory leak: b

    gui/test.cpp:16: error: Mismatching allocation and deallocation: k

    能够编写本身的模式(例如,逗号分隔格式):

    cppcheck --template="{file},{line},{severity},{id},{message}" gui/test.cpp

    1

    输出将以下所示:

    Checking gui/test.cpp…

    gui/test.cpp,31,error,memleak,Memory leak: b

    gui/test.cpp,16,error,mismatchAllocDealloc,Mismatching allocation and deallocation: k

    支持如下格式说明符:

    callstack

    调用栈 - 若是可用

    file

    文件名

    id

    消息 id

    line

    行号

    message

    详细的消息文本

    severity

    一个消息的类型/等级

    支持转义序列: \b(退格)、\n(换行)、\r(换页)、\t(水平制表符)

    更多相关内容
  • Cpp

    2021-03-21 01:17:12
    C ++ 我将分享cpp语言的基础知识
  • cpp

    2021-02-19 23:23:10
    cpp
  • log4cpp源码完整解析

    2016-05-16 21:51:13
    完整分析了log4cpp的整体架构,详细介绍了log4cpp的这个重要组件的实现分析了log4cpp内部所使用的设计模式。介绍了log4cpp中的Category的完整实现细节,介绍了所有的Layout及其子类的具体实现。也详细介绍了比较常用...
  • CPP的简单例子

    2016-11-20 00:12:40
    谭浩强的C++中的案例,对于C++学习者,这可能不是最好的选择,但是,也给需要的人分享下
  • CPP_Unreal_1:C ++和虚幻引擎#1
  • Dev-Cpp 5.8.3

    热门讨论 2014-11-16 11:01:02
    很实用,体积不大,支持Win8.1,有简体中文
  • cpp封装dll和so,cpp调用so

    千次阅读 2022-01-14 17:06:27
    一种是写在头文件上直接#inlucde进来使用的,但是编译成动态库基本都是g++ -fPIC -shared libxxx.cpp -0 libxxx.so,这样一般就是编译产生了so文件,后面可以直接调用,或者编译,对于main.cpp,前者是g++ -o a.out ...

    Linux的so文件到底是干嘛的?浅析Linux的动态链接库 - 知乎微信公众号:ilulaoshi,原文发表在我的个人网站:Linux的so文件到底是干嘛的?浅析Linux的动态链接库 上一篇我们分析了Hello World是如何编译的,即使一个非常简单的程序,也需要依赖C标准库和系统库,链接其实就…https://zhuanlan.zhihu.com/p/235551437(windows平台下)深入详解C++创建动态链接库DLL以及如何使用它(一) - 知乎前言:C以及C++的动态链接库和静态链接库,说起来很简单,但是实际上在创建的过程中有很多的坑,本人也是一路踩了很多坑,查了很多资料,下决定写一篇完整的文章来详细解释使用VS创建C++动态链接库的完整流程。本…https://zhuanlan.zhihu.com/p/103082370linux 动态链接库so的封装及调用_YHR14的博客-CSDN博客_linux 封装动态链接库       首先定义hello.c文件#include <stdio.h>void hello(const char * name){ printf("Hello , %s!\n", name);}       定义hello.h头文件#ifndef HELLO_H#define HELLO_Hint g_count = 100;vo...https://blog.csdn.net/YHR14/article/details/81742519        如何使用vs将C++项目打包成一个dll_qq_41614283的博客-CSDN博客_c++ 打包dllcolor=#0099ff size=50 face=“黑体”https://blog.csdn.net/qq_41614283/article/details/106089843

    linux 动态链接库so的封装及调用_YHR14的博客-CSDN博客_linux 封装so库       首先定义hello.c文件#include &lt;stdio.h&gt;void hello(const char * name){ printf("Hello , %s!\n", name);}       定义hello.h头文件#ifndef HELLO_H#define HELLO_Hint g_count = 100;vo...https://blog.csdn.net/YHR14/article/details/81742519Linux C++简单生成与调用so库_jaykk的博客-CSDN博客_linux下c++调用so文件Linux C++简单生成与调用so库生成so库调用so库初探解决参考资料网上有很多C语言编译so库的方法,用C++的偏少,遇见了一些坑,这里记录一下,以作参照。生成so库先实现一个最简单的函数,libtest.cpp(先不考虑extern "C"这句话):#include<iostream>//extern "C"double ddd(double a){return...https://blog.csdn.net/m0_37980456/article/details/103644846CMAKE使用链接第三方SO库 - 简书CMake 命名变量 set(INC_DIR /usr/local/include) set(LINK_DIR /usr/local/lib) set(SOURCE_FILE...https://www.jianshu.com/p/354c64b0e26bcpp代码在linux平台封成动态库so文件,也可以封装成.a静态文件,在win平台都是封成dll,so和dll都是可以被python和cpp调用的。其实封成dll对我来说意义不大,但是so的生成意义还是很多的,封成so简单的就是gcc命令行,复杂的就通过cmake来转。cpp调用这块稍微看一下,转不是重点,尤其是在dll上转,后面python调用so是重点,值得关注。

    1.DLL

            dll是win下的动态链接库,linux中的so有.so和与之对应的头文件,win下的动态库有两个文件,一个是引入库.lib文件,一个是动态库.dll文件. 要用extern "C" _declspec(dllexport) 来导出dll。

    2.cpp调用so

            之前是把cpp代码在linux平台转成so或者是可执行文件,用cmake也是可以转可执行文件的,转可执行文件一般是 g++ -o xxx xxx.cpp,然后./xxx,即可执行。cpp代码在linux上一定要先编译,不编译无法执行的。一种是直接写在程序中调用的,void *handle = dlopen("./libtest.so",RTLD_LAZY);一种是写在头文件上直接#inlucde进来使用的,但是编译成动态库基本都是g++ -fPIC -shared libxxx.cpp -0 libxxx.so,这样一般就是编译产生了so文件,后面可以直接调用,或者编译,对于main.cpp,前者是g++ -o a.out main.cpp -ldl,后面一定要加ldl,不然编译不成功,后者的话,复杂一点,(注意cpp用g++编译,c用gcc编译)。

    3.cmake如何编译调用so文件

            放在cmake中一起编译是最常见的做法了,图像上最常见的opencv,imagemagick之类的很多都提前做成so,放在项目中直接调用,当然imagemagick和opencv也需要一些底层的库支持,这些库是需要提前安装好的,放在项目中转成so提前编译好的做法是比较好的隔离开平台之间的相互影响。

    命名变量
    set(OPENCV_ROOT_DIR ${THIRDPARTY_DIR}/opencv)
    
    去哪里找头文件(.h)
    include_directories(${OPENCV_ROOT_DIR}/linux_x86_64)
    
    去哪里找库文件(.cpp)
    link_directories(${OPENCV_ROOT_DIR}/linux_x86_64)
    
    要链接的库文件的名字,
    target_link_libraries(test libopencv.so)

    展开全文
  • unity il2cpp 热更实现

    千次阅读 2021-02-05 14:58:53
    unity libil2cpp.so 代码动态库热更实现 代码热更分别要实现动态库热更和global-metadata.dat的热更。 libil2cpp.so动态库热更 构造一个libil2cpp.so一样的导出函数的跳板动态库,把所有的函数转发到跳板来, 在...

    unity libil2cpp.so 代码动态库热更实现

    代码热更分别要实现动态库热更和global-metadata.dat的热更。无任何兼容问题。

    libil2cpp.so动态库热更

    构造一个libil2cpp.so一样的导出函数的跳板动态库,把所有的函数转发到跳板来, 在跳板里实现加载自定义的libil2cpp.so达到热更目的。

    1.声明出il2cpp所有的导出函数

    //
    // Created by Administrator on 2019/5/14.
    //
    
    #ifndef TEST_UPDATE_IL2CPP_API_FUNCTIONS_H
    #define TEST_UPDATE_IL2CPP_API_FUNCTIONS_H
    #include <stdint.h>
    #include <stddef.h>
    #ifndef DO_API_NO_RETURN
    #define DO_API_NO_RETURN(r, n, p) DO_API(r,n,p)
    #endif
    typedef void (*Il2CppMethodPointer)();
    typedef uint16_t Il2CppChar;
    typedef struct
    {
    void* (*malloc_func)(size_t size);
    void* (*aligned_malloc_func)(size_t size, size_t alignment);
    void (*free_func)(void *ptr);
    void (*aligned_free_func)(void *ptr);
    void* (*calloc_func)(size_t nmemb, size_t size);
    void* (*realloc_func)(void *ptr, size_t size);
    void* (*aligned_realloc_func)(void *ptr, size_t size, size_t alignment);
    } Il2CppMemoryCallbacks;
    typedef void Il2CppClass;
    typedef void Il2CppArray;
    typedef void Il2CppImage;
    typedef void Il2CppAssembly;
    typedef void Il2CppReflectionType;
    typedef void EventInfo;
    typedef uintptr_t il2cpp_array_size_t;
    typedef void FieldInfo;
    typedef void PropertyInfo;
    typedef void MethodInfo;
    typedef void Il2CppType;
    typedef enum
    {
    Stat_VOID,
    }Il2CppStat;
    
    typedef enum
    {
    Event_VOID,
    }Il2CppGCEvent;
    
    typedef enum
    {
    Kind_VOID,
    }Il2CppProfileFileIOKind;
    
    typedef enum
    {
    Policy_VOID,
    }Il2CppRuntimeUnhandledExceptionPolicy;
    
    typedef enum
    {
        Flags_VOID,
    } Il2CppProfileFlags;
    
    typedef void Il2CppDomain;
    typedef void Il2CppException;
    typedef void Il2CppObject;
    typedef void Il2CppReflectionMethod;
    typedef void Il2CppProfiler;
    typedef void Il2CppString;
    typedef void Il2CppThread;
    typedef void Il2CppManagedMemorySnapshot;
    typedef void Il2CppCustomAttrInfo;
    typedef void Il2CppStackFrameInfo;
    typedef char Il2CppNativeChar;
    typedef void (*il2cpp_register_object_callback)(Il2CppObject** arr, int size, void* userdata);
    typedef void (*il2cpp_WorldChangedCallback)();
    typedef void (*Il2CppFrameWalkFunc) (const Il2CppStackFrameInfo *info, void *user_data);
    typedef void (*Il2CppProfileFunc) (Il2CppProfiler* prof);
    typedef void (*Il2CppProfileMethodFunc) (Il2CppProfiler* prof, const MethodInfo *method);
    typedef void (*Il2CppProfileAllocFunc) (Il2CppProfiler* prof, Il2CppObject *obj, Il2CppClass *klass);
    typedef void (*Il2CppProfileGCFunc) (Il2CppProfiler* prof, Il2CppGCEvent event, int generation);
    typedef void (*Il2CppProfileGCResizeFunc) (Il2CppProfiler* prof, int64_t new_size);
    typedef void (*Il2CppProfileFileIOFunc) (Il2CppProfiler* prof, Il2CppProfileFileIOKind kind, int count);
    typedef void (*Il2CppProfileThreadFunc) (Il2CppProfiler *prof, unsigned long tid);
    typedef void (*Il2CppLogCallback)(const char*);
    typedef const Il2CppNativeChar* (*Il2CppSetFindPlugInCallback)(const Il2CppNativeChar*);
    
    #define DEFINE_IL2CPP_FUN(a, b, c)\
    DO_API(a, b, c);\
    typedef a (*p_##b)c;
    
    DEFINE_IL2CPP_FUN(void, il2cpp_init, (const char* domain_name));
    DEFINE_IL2CPP_FUN(void, il2cpp_init_utf16, (const Il2CppChar * domain_name));
    DEFINE_IL2CPP_FUN(void, il2cpp_shutdown, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_set_config_dir, (const char *config_path));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_data_dir, (const char *data_path));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_temp_dir, (const char *temp_path));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_commandline_arguments, (int argc, const char* const argv[], const char* basedir));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_commandline_arguments_utf16, (int argc, const Il2CppChar * const argv[], const char* basedir));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_config_utf16, (const Il2CppChar * executablePath));
    DEFINE_IL2CPP_FUN(void, il2cpp_set_config, (const char* executablePath));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_set_memory_callbacks, (Il2CppMemoryCallbacks * callbacks));
    DEFINE_IL2CPP_FUN(const Il2CppImage*, il2cpp_get_corlib, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_add_internal_call, (const char* name, Il2CppMethodPointer method));
    DEFINE_IL2CPP_FUN(Il2CppMethodPointer, il2cpp_resolve_icall, (const char* name));
    
    DEFINE_IL2CPP_FUN(void*, il2cpp_alloc, (size_t size));
    DEFINE_IL2CPP_FUN(void, il2cpp_free, (void* ptr));
    
    // array
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_array_class_get, (Il2CppClass * element_class, uint32_t rank));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_array_length, (Il2CppArray * array));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_array_get_byte_length, (Il2CppArray * array));
    DEFINE_IL2CPP_FUN(Il2CppArray*, il2cpp_array_new, (Il2CppClass * elementTypeInfo, il2cpp_array_size_t length));
    DEFINE_IL2CPP_FUN(Il2CppArray*, il2cpp_array_new_specific, (Il2CppClass * arrayTypeInfo, il2cpp_array_size_t length));
    DEFINE_IL2CPP_FUN(Il2CppArray*, il2cpp_array_new_full, (Il2CppClass * array_class, il2cpp_array_size_t * lengths, il2cpp_array_size_t * lower_bounds));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_bounded_array_class_get, (Il2CppClass * element_class, uint32_t rank, bool bounded));
    DEFINE_IL2CPP_FUN(int, il2cpp_array_element_size, (const Il2CppClass * array_class));
    
    // assembly
    DEFINE_IL2CPP_FUN(const Il2CppImage*, il2cpp_assembly_get_image, (const Il2CppAssembly * assembly));
    
    // class
    DEFINE_IL2CPP_FUN(const Il2CppType*, il2cpp_class_enum_basetype, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_generic, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_inflated, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_assignable_from, (Il2CppClass * klass, Il2CppClass * oklass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_subclass_of, (Il2CppClass * klass, Il2CppClass * klassc, bool check_interfaces));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_has_parent, (Il2CppClass * klass, Il2CppClass * klassc));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_from_il2cpp_type, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_from_name, (const Il2CppImage * image, const char* namespaze, const char *name));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_from_system_type, (Il2CppReflectionType * type));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_get_element_class, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(const EventInfo*, il2cpp_class_get_events, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(FieldInfo*, il2cpp_class_get_fields, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_get_nested_types, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_get_interfaces, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(const PropertyInfo*, il2cpp_class_get_properties, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(const PropertyInfo*, il2cpp_class_get_property_from_name, (Il2CppClass * klass, const char *name));
    DEFINE_IL2CPP_FUN(FieldInfo*, il2cpp_class_get_field_from_name, (Il2CppClass * klass, const char *name));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_class_get_methods, (Il2CppClass * klass, void* *iter));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_class_get_method_from_name, (Il2CppClass * klass, const char* name, int argsCount));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_class_get_name, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_class_get_namespace, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_get_parent, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_get_declaring_type, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_class_instance_size, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(size_t, il2cpp_class_num_fields, (const Il2CppClass * enumKlass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_valuetype, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_class_value_size, (Il2CppClass * klass, uint32_t * align));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_blittable, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(int, il2cpp_class_get_flags, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_abstract, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_interface, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(int, il2cpp_class_array_element_size, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_class_from_type, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(const Il2CppType*, il2cpp_class_get_type, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_class_get_type_token, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_has_attribute, (Il2CppClass * klass, Il2CppClass * attr_class));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_has_references, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_class_is_enum, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(const Il2CppImage*, il2cpp_class_get_image, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_class_get_assemblyname, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(int, il2cpp_class_get_rank, (const Il2CppClass * klass));
    
    // testing only
    DEFINE_IL2CPP_FUN(size_t, il2cpp_class_get_bitmap_size, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(void, il2cpp_class_get_bitmap, (Il2CppClass * klass, size_t * bitmap));
    
    // stats
    DEFINE_IL2CPP_FUN(bool, il2cpp_stats_dump_to_file, (const char *path));
    DEFINE_IL2CPP_FUN(uint64_t, il2cpp_stats_get_value, (Il2CppStat stat));
    
    // domain
    DEFINE_IL2CPP_FUN(Il2CppDomain*, il2cpp_domain_get, ());
    DEFINE_IL2CPP_FUN(const Il2CppAssembly*, il2cpp_domain_assembly_open, (Il2CppDomain * domain, const char* name));
    DEFINE_IL2CPP_FUN(const Il2CppAssembly**, il2cpp_domain_get_assemblies, (const Il2CppDomain * domain, size_t * size));
    
    // exception
    DEFINE_IL2CPP_FUN(void, il2cpp_raise_exception, (Il2CppException*));
    DEFINE_IL2CPP_FUN(Il2CppException*, il2cpp_exception_from_name_msg, (const Il2CppImage * image, const char *name_space, const char *name, const char *msg));
    DEFINE_IL2CPP_FUN(Il2CppException*, il2cpp_get_exception_argument_null, (const char *arg));
    DEFINE_IL2CPP_FUN(void, il2cpp_format_exception, (const Il2CppException * ex, char* message, int message_size));
    DEFINE_IL2CPP_FUN(void, il2cpp_format_stack_trace, (const Il2CppException * ex, char* output, int output_size));
    DEFINE_IL2CPP_FUN(void, il2cpp_unhandled_exception, (Il2CppException*));
    
    // field
    DEFINE_IL2CPP_FUN(int, il2cpp_field_get_flags, (FieldInfo * field));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_field_get_name, (FieldInfo * field));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_field_get_parent, (FieldInfo * field));
    DEFINE_IL2CPP_FUN(size_t, il2cpp_field_get_offset, (FieldInfo * field));
    DEFINE_IL2CPP_FUN(const Il2CppType*, il2cpp_field_get_type, (FieldInfo * field));
    DEFINE_IL2CPP_FUN(void, il2cpp_field_get_value, (Il2CppObject * obj, FieldInfo * field, void *value));
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_field_get_value_object, (FieldInfo * field, Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(bool, il2cpp_field_has_attribute, (FieldInfo * field, Il2CppClass * attr_class));
    DEFINE_IL2CPP_FUN(void, il2cpp_field_set_value, (Il2CppObject * obj, FieldInfo * field, void *value));
    DEFINE_IL2CPP_FUN(void, il2cpp_field_static_get_value, (FieldInfo * field, void *value));
    DEFINE_IL2CPP_FUN(void, il2cpp_field_static_set_value, (FieldInfo * field, void *value));
    DEFINE_IL2CPP_FUN(void, il2cpp_field_set_value_object, (Il2CppObject * instance, FieldInfo * field, Il2CppObject * value));
    
    // gc
    DEFINE_IL2CPP_FUN(void, il2cpp_gc_collect, (int maxGenerations));
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_gc_collect_a_little, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_gc_disable, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_gc_enable, ());
    DEFINE_IL2CPP_FUN(bool, il2cpp_gc_is_disabled, ());
    DEFINE_IL2CPP_FUN(int64_t, il2cpp_gc_get_used_size, ());
    DEFINE_IL2CPP_FUN(int64_t, il2cpp_gc_get_heap_size, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_gc_wbarrier_set_field, (Il2CppObject * obj, void **targetAddress, void *object));
    
    // gchandle
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_gchandle_new, (Il2CppObject * obj, bool pinned));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_gchandle_new_weakref, (Il2CppObject * obj, bool track_resurrection));
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_gchandle_get_target , (uint32_t gchandle));
    DEFINE_IL2CPP_FUN(void, il2cpp_gchandle_free, (uint32_t gchandle));
    
    // liveness
    DEFINE_IL2CPP_FUN(void*, il2cpp_unity_liveness_calculation_begin, (Il2CppClass * filter, int max_object_count, il2cpp_register_object_callback callback, void* userdata, il2cpp_WorldChangedCallback onWorldStarted, il2cpp_WorldChangedCallback onWorldStopped));
    DEFINE_IL2CPP_FUN(void, il2cpp_unity_liveness_calculation_end, (void* state));
    DEFINE_IL2CPP_FUN(void, il2cpp_unity_liveness_calculation_from_root, (Il2CppObject * root, void* state));
    DEFINE_IL2CPP_FUN(void, il2cpp_unity_liveness_calculation_from_statics, (void* state));
    
    // method
    DEFINE_IL2CPP_FUN(const Il2CppType*, il2cpp_method_get_return_type, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_method_get_declaring_type, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_method_get_name, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_method_get_from_reflection, (const Il2CppReflectionMethod * method));
    DEFINE_IL2CPP_FUN(Il2CppReflectionMethod*, il2cpp_method_get_object, (const MethodInfo * method, Il2CppClass * refclass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_method_is_generic, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(bool, il2cpp_method_is_inflated, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(bool, il2cpp_method_is_instance, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_method_get_param_count, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(const Il2CppType*, il2cpp_method_get_param, (const MethodInfo * method, uint32_t index));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_method_get_class, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(bool, il2cpp_method_has_attribute, (const MethodInfo * method, Il2CppClass * attr_class));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_method_get_flags, (const MethodInfo * method, uint32_t * iflags));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_method_get_token, (const MethodInfo * method));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_method_get_param_name, (const MethodInfo * method, uint32_t index));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install, (Il2CppProfiler * prof, Il2CppProfileFunc shutdown_callback));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_set_events, (Il2CppProfileFlags events));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install_enter_leave, (Il2CppProfileMethodFunc enter, Il2CppProfileMethodFunc fleave));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install_allocation, (Il2CppProfileAllocFunc callback));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install_gc, (Il2CppProfileGCFunc callback, Il2CppProfileGCResizeFunc heap_resize_callback));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install_fileio, (Il2CppProfileFileIOFunc callback));
    DEFINE_IL2CPP_FUN(void, il2cpp_profiler_install_thread, (Il2CppProfileThreadFunc start, Il2CppProfileThreadFunc end));
    
    
    // property
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_property_get_flags, (PropertyInfo * prop));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_property_get_get_method, (PropertyInfo * prop));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_property_get_set_method, (PropertyInfo * prop));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_property_get_name, (PropertyInfo * prop));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_property_get_parent, (PropertyInfo * prop));
    
    // object
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_object_get_class, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_object_get_size, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_object_get_virtual_method, (Il2CppObject * obj, const MethodInfo * method));
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_object_new, (const Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(void*, il2cpp_object_unbox, (Il2CppObject * obj));
    
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_value_box, (Il2CppClass * klass, void* data));
    
    // monitor
    DEFINE_IL2CPP_FUN(void, il2cpp_monitor_enter, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(bool, il2cpp_monitor_try_enter, (Il2CppObject * obj, uint32_t timeout));
    DEFINE_IL2CPP_FUN(void, il2cpp_monitor_exit, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(void, il2cpp_monitor_pulse, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(void, il2cpp_monitor_pulse_all, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(void, il2cpp_monitor_wait, (Il2CppObject * obj));
    DEFINE_IL2CPP_FUN(bool, il2cpp_monitor_try_wait, (Il2CppObject * obj, uint32_t timeout));
    
    // runtime
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_runtime_invoke, (const MethodInfo * method, void *obj, void **params, Il2CppException **exc));
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_runtime_invoke_convert_args, (const MethodInfo * method, void *obj, Il2CppObject **params, int paramCount, Il2CppException **exc));
    DEFINE_IL2CPP_FUN(void, il2cpp_runtime_class_init, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(void, il2cpp_runtime_object_init, (Il2CppObject * obj));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_runtime_object_init_exception, (Il2CppObject * obj, Il2CppException** exc));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_runtime_unhandled_exception_policy_set, (Il2CppRuntimeUnhandledExceptionPolicy value));
    
    // string
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_string_length, (Il2CppString * str));
    DEFINE_IL2CPP_FUN(Il2CppChar*, il2cpp_string_chars, (Il2CppString * str));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_new, (const char* str));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_new_len, (const char* str, uint32_t length));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_new_utf16, (const Il2CppChar * text, int32_t len));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_new_wrapper, (const char* str));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_intern, (Il2CppString * str));
    DEFINE_IL2CPP_FUN(Il2CppString*, il2cpp_string_is_interned, (Il2CppString * str));
    
    // thread
    DEFINE_IL2CPP_FUN(Il2CppThread*, il2cpp_thread_current, ());
    DEFINE_IL2CPP_FUN(Il2CppThread*, il2cpp_thread_attach, (Il2CppDomain * domain));
    DEFINE_IL2CPP_FUN(void, il2cpp_thread_detach, (Il2CppThread * thread));
    
    DEFINE_IL2CPP_FUN(Il2CppThread**, il2cpp_thread_get_all_attached_threads, (size_t * size));
    DEFINE_IL2CPP_FUN(bool, il2cpp_is_vm_thread, (Il2CppThread * thread));
    
    // stacktrace
    DEFINE_IL2CPP_FUN(void, il2cpp_current_thread_walk_frame_stack, (Il2CppFrameWalkFunc func, void* user_data));
    DEFINE_IL2CPP_FUN(void, il2cpp_thread_walk_frame_stack, (Il2CppThread * thread, Il2CppFrameWalkFunc func, void* user_data));
    DEFINE_IL2CPP_FUN(bool, il2cpp_current_thread_get_top_frame, (Il2CppStackFrameInfo * frame));
    DEFINE_IL2CPP_FUN(bool, il2cpp_thread_get_top_frame, (Il2CppThread * thread, Il2CppStackFrameInfo * frame));
    DEFINE_IL2CPP_FUN(bool, il2cpp_current_thread_get_frame_at, (int32_t offset, Il2CppStackFrameInfo * frame));
    DEFINE_IL2CPP_FUN(bool, il2cpp_thread_get_frame_at, (Il2CppThread * thread, int32_t offset, Il2CppStackFrameInfo * frame));
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_current_thread_get_stack_depth, ());
    DEFINE_IL2CPP_FUN(int32_t, il2cpp_thread_get_stack_depth, (Il2CppThread * thread));
    
    // type
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_type_get_object, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(int, il2cpp_type_get_type, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(Il2CppClass*, il2cpp_type_get_class_or_element_class, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(char*, il2cpp_type_get_name, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(bool, il2cpp_type_is_byref, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(uint32_t, il2cpp_type_get_attrs, (const Il2CppType * type));
    DEFINE_IL2CPP_FUN(bool, il2cpp_type_equals, (const Il2CppType * type, const Il2CppType * otherType));
    DEFINE_IL2CPP_FUN(char*, il2cpp_type_get_assembly_qualified_name, (const Il2CppType * type));
    
    // image
    DEFINE_IL2CPP_FUN(const Il2CppAssembly*, il2cpp_image_get_assembly, (const Il2CppImage * image));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_image_get_name, (const Il2CppImage * image));
    DEFINE_IL2CPP_FUN(const char*, il2cpp_image_get_filename, (const Il2CppImage * image));
    DEFINE_IL2CPP_FUN(const MethodInfo*, il2cpp_image_get_entry_point, (const Il2CppImage * image));
    
    DEFINE_IL2CPP_FUN(size_t, il2cpp_image_get_class_count, (const Il2CppImage * image));
    DEFINE_IL2CPP_FUN(const Il2CppClass*, il2cpp_image_get_class, (const Il2CppImage * image, size_t index));
    
    // Memory information
    DEFINE_IL2CPP_FUN(Il2CppManagedMemorySnapshot*, il2cpp_capture_memory_snapshot, ());
    DEFINE_IL2CPP_FUN(void, il2cpp_free_captured_memory_snapshot, (Il2CppManagedMemorySnapshot * snapshot));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_set_find_plugin_callback, (Il2CppSetFindPlugInCallback method));
    
    // Logging
    DEFINE_IL2CPP_FUN(void, il2cpp_register_log_callback, (Il2CppLogCallback method));
    
    // Debugger
    DEFINE_IL2CPP_FUN(void, il2cpp_debugger_set_agent_options, (const char* options));
    DEFINE_IL2CPP_FUN(bool, il2cpp_is_debugger_attached, ());
    
    // TLS module
    DEFINE_IL2CPP_FUN(void, il2cpp_unity_install_unitytls_interface, (const void* unitytlsInterfaceStruct));
    
    // custom attributes
    DEFINE_IL2CPP_FUN(Il2CppCustomAttrInfo*, il2cpp_custom_attrs_from_class, (Il2CppClass * klass));
    DEFINE_IL2CPP_FUN(Il2CppCustomAttrInfo*, il2cpp_custom_attrs_from_method, (const MethodInfo * method));
    
    DEFINE_IL2CPP_FUN(Il2CppObject*, il2cpp_custom_attrs_get_attr, (Il2CppCustomAttrInfo * ainfo, Il2CppClass * attr_klass));
    DEFINE_IL2CPP_FUN(bool, il2cpp_custom_attrs_has_attr, (Il2CppCustomAttrInfo * ainfo, Il2CppClass * attr_klass));
    DEFINE_IL2CPP_FUN(Il2CppArray*,  il2cpp_custom_attrs_construct, (Il2CppCustomAttrInfo * cinfo));
    
    DEFINE_IL2CPP_FUN(void, il2cpp_custom_attrs_free, (Il2CppCustomAttrInfo * ainfo));
    
    #endif //TEST_UPDATE_IL2CPP_API_FUNCTIONS_H
    

     2.实现所有的跳板

    //
    // Created by Administrator on 2019/5/14.
    //
    #include "il2cpp-api.h"
    #define CallIl2CppFun1(funname, par) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(par);
    
    #define CallIl2CppFun0(funname) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )();
    
    #define CallIl2CppFun2(funname, p1, p2) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2);
    
    #define CallIl2CppFun3(funname, p1, p2, p3) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2, p3);
    
    #define CallIl2CppFun4(funname, p1, p2, p3, p4) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2, p3, p4);
    
    #define CallIl2CppFun5(funname, p1, p2, p3, p4, p5) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2, p3, p4, p5);
    
    #define CallIl2CppFun6(funname, p1, p2, p3, p4, p5, p6) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2, p3, p4, p5, p6);
    
    #define CallIl2CppFun7(funname, p1, p2, p3, p4, p5, p6, p7) \
    extern void* g_##funname;\
    return ((p_##funname)g_##funname )(p1, p2, p3, p4, p5, p6, p7);
    
    void il2cpp_init(const char* domain_name)
    {
        CallIl2CppFun1(il2cpp_init, domain_name);
    }
    
    void il2cpp_init_utf16(const Il2CppChar* domain_name)
    {
        CallIl2CppFun1(il2cpp_init_utf16, domain_name);
    }
    
    void il2cpp_shutdown()
    {
        CallIl2CppFun0(il2cpp_shutdown);
    }
    
    void il2cpp_set_config_dir(const char *config_path)
    {
        CallIl2CppFun1(il2cpp_set_config_dir, config_path);
    }
    
    void il2cpp_set_data_dir(const char *data_path)
    {
        CallIl2CppFun1(il2cpp_set_data_dir, data_path);
    }
    
    void il2cpp_set_temp_dir(const char *temp_dir)
    {
        CallIl2CppFun1(il2cpp_set_temp_dir, temp_dir);
    }
    
    void il2cpp_set_commandline_arguments(int argc, const char* const argv[], const char* basedir)
    {
        CallIl2CppFun3(il2cpp_set_commandline_arguments, argc, argv, basedir);
    }
    
    void il2cpp_set_commandline_arguments_utf16(int argc, const Il2CppChar* const argv[], const char* basedir)
    {
        CallIl2CppFun3(il2cpp_set_commandline_arguments_utf16, argc, argv, basedir);
    }
    
    void il2cpp_set_config_utf16(const Il2CppChar* executablePath)
    {
        CallIl2CppFun1(il2cpp_set_config_utf16, executablePath);
    }
    
    void il2cpp_set_config(const char* executablePath)
    {
        CallIl2CppFun1(il2cpp_set_config, executablePath);
    }
    
    void il2cpp_set_memory_callbacks(Il2CppMemoryCallbacks* callbacks)
    {
        CallIl2CppFun1(il2cpp_set_memory_callbacks, callbacks);
    }
    
    const Il2CppImage* il2cpp_get_corlib()
    {
        CallIl2CppFun0(il2cpp_get_corlib);
    }
    
    void il2cpp_add_internal_call(const char* name, Il2CppMethodPointer method)
    {
        CallIl2CppFun2(il2cpp_add_internal_call, name, method);
    }
    
    Il2CppMethodPointer il2cpp_resolve_icall(const char* name)
    {
        CallIl2CppFun1(il2cpp_resolve_icall, name);
    }
    
    void* il2cpp_alloc(size_t size)
    {
        CallIl2CppFun1(il2cpp_alloc, size);
    }
    
    void il2cpp_free(void* ptr)
    {
        CallIl2CppFun1(il2cpp_free, ptr);
    }
    
    // array
    
    Il2CppClass *il2cpp_array_class_get(Il2CppClass *element_class, uint32_t rank)
    {
        CallIl2CppFun2(il2cpp_array_class_get, element_class, rank);
    }
    
    uint32_t il2cpp_array_length(Il2CppArray* array)
    {
        CallIl2CppFun1(il2cpp_array_length, array);
    }
    
    uint32_t il2cpp_array_get_byte_length(Il2CppArray *array)
    {
        CallIl2CppFun1(il2cpp_array_get_byte_length, array);
    }
    
    Il2CppArray* il2cpp_array_new(Il2CppClass *elementTypeInfo, il2cpp_array_size_t length)
    {
        CallIl2CppFun2(il2cpp_array_new, elementTypeInfo, length);
    }
    
    Il2CppArray* il2cpp_array_new_specific(Il2CppClass *arrayTypeInfo, il2cpp_array_size_t length)
    {
        CallIl2CppFun2(il2cpp_array_new_specific, arrayTypeInfo, length);
    }
    
    Il2CppArray* il2cpp_array_new_full(Il2CppClass *array_class, il2cpp_array_size_t *lengths, il2cpp_array_size_t *lower_bounds)
    {
        CallIl2CppFun3(il2cpp_array_new_full, array_class, lengths, lower_bounds);
    }
    
    Il2CppClass* il2cpp_bounded_array_class_get(Il2CppClass *element_class, uint32_t rank, bool bounded)
    {
        CallIl2CppFun3(il2cpp_bounded_array_class_get, element_class, rank, bounded);
    }
    
    int il2cpp_array_element_size(const Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_array_element_size, klass);
    }
    
    // assembly
    const Il2CppImage* il2cpp_assembly_get_image(const Il2CppAssembly *assembly)
    {
        CallIl2CppFun1(il2cpp_assembly_get_image, assembly);
    }
    
    // class
    
    const Il2CppType* il2cpp_class_enum_basetype(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_enum_basetype, klass);
    }
    
    Il2CppClass* il2cpp_class_from_system_type(Il2CppReflectionType *type)
    {
        CallIl2CppFun1(il2cpp_class_from_system_type, type);
    }
    
    bool il2cpp_class_is_generic(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_is_generic, klass);
    }
    
    bool il2cpp_class_is_inflated(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_is_inflated, klass);
    }
    
    bool il2cpp_class_is_assignable_from(Il2CppClass *klass, Il2CppClass *oklass)
    {
        CallIl2CppFun2(il2cpp_class_is_assignable_from, klass, oklass);
    }
    
    bool il2cpp_class_is_subclass_of(Il2CppClass *klass, Il2CppClass *klassc, bool check_interfaces)
    {
        CallIl2CppFun3(il2cpp_class_is_subclass_of, klass, klassc, check_interfaces);
    }
    
    bool il2cpp_class_has_parent(Il2CppClass *klass, Il2CppClass *klassc)
    {
        CallIl2CppFun2(il2cpp_class_has_parent, klass, klassc);
    }
    
    Il2CppClass* il2cpp_class_from_il2cpp_type(const Il2CppType* type)
    {
        CallIl2CppFun1(il2cpp_class_from_il2cpp_type, type);
    }
    
    Il2CppClass* il2cpp_class_from_name(const Il2CppImage* image, const char* namespaze, const char *name)
    {
        CallIl2CppFun3(il2cpp_class_from_name, image, namespaze, name);
    }
    
    Il2CppClass* il2cpp_class_get_element_class(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_element_class, klass);
    }
    
    const EventInfo* il2cpp_class_get_events(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_events, klass, iter);
    }
    
    FieldInfo* il2cpp_class_get_fields(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_fields, klass, iter);
    }
    
    Il2CppClass* il2cpp_class_get_nested_types(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_nested_types, klass, iter);
    }
    
    Il2CppClass* il2cpp_class_get_interfaces(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_interfaces, klass, iter);
    }
    
    const PropertyInfo* il2cpp_class_get_properties(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_properties, klass, iter);
    }
    
    const PropertyInfo* il2cpp_class_get_property_from_name(Il2CppClass *klass, const char *name)
    {
        CallIl2CppFun2(il2cpp_class_get_property_from_name, klass, name);
    }
    
    FieldInfo* il2cpp_class_get_field_from_name(Il2CppClass* klass, const char *name)
    {
        CallIl2CppFun2(il2cpp_class_get_field_from_name, klass, name);
    }
    
    const MethodInfo* il2cpp_class_get_methods(Il2CppClass *klass, void* *iter)
    {
        CallIl2CppFun2(il2cpp_class_get_methods, klass, iter);
    }
    
    const MethodInfo* il2cpp_class_get_method_from_name(Il2CppClass *klass, const char* name, int argsCount)
    {
        CallIl2CppFun3(il2cpp_class_get_method_from_name, klass, name, argsCount);
    }
    
    const char* il2cpp_class_get_name(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_name, klass);
    }
    
    const char* il2cpp_class_get_namespace(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_namespace, klass);
    }
    
    Il2CppClass* il2cpp_class_get_parent(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_parent, klass);
    }
    
    Il2CppClass* il2cpp_class_get_declaring_type(Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_class_get_declaring_type, klass);
    }
    
    int32_t il2cpp_class_instance_size(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_instance_size, klass);
    }
    
    size_t il2cpp_class_num_fields(const Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_class_num_fields, klass);
    }
    
    bool il2cpp_class_is_valuetype(const Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_class_is_valuetype, klass);
    }
    
    bool il2cpp_class_is_blittable(const Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_class_is_blittable, klass);
    }
    
    int32_t il2cpp_class_value_size(Il2CppClass *klass, uint32_t *align)
    {
        CallIl2CppFun2(il2cpp_class_value_size, klass, align);
    }
    
    int il2cpp_class_get_flags(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_flags, klass);
    }
    
    bool il2cpp_class_is_abstract(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_is_abstract, klass);
    }
    
    bool il2cpp_class_is_interface(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_is_interface, klass);
    }
    
    int il2cpp_class_array_element_size(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_array_element_size, klass);
    }
    
    Il2CppClass* il2cpp_class_from_type(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_class_from_type, type);
    }
    
    const Il2CppType* il2cpp_class_get_type(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_type, klass);
    }
    
    uint32_t il2cpp_class_get_type_token(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_type_token, klass);
    }
    
    bool il2cpp_class_has_attribute(Il2CppClass *klass, Il2CppClass *attr_class)
    {
        CallIl2CppFun2(il2cpp_class_has_attribute, klass, attr_class);
    }
    
    bool il2cpp_class_has_references(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_has_references, klass);
    }
    
    bool il2cpp_class_is_enum(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_is_enum, klass);
    }
    
    const Il2CppImage* il2cpp_class_get_image(Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_class_get_image, klass);
    }
    
    const char *il2cpp_class_get_assemblyname(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_assemblyname, klass);
    }
    
    int il2cpp_class_get_rank(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_rank, klass);
    }
    
    // testing only
    size_t il2cpp_class_get_bitmap_size(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_class_get_bitmap_size, klass);
    }
    
    void il2cpp_class_get_bitmap(Il2CppClass *klass, size_t* bitmap)
    {
        CallIl2CppFun2(il2cpp_class_get_bitmap, klass, bitmap);
    }
    
    bool il2cpp_stats_dump_to_file(const char *path)
    {
        CallIl2CppFun1(il2cpp_stats_dump_to_file, path);
    }
    
    uint64_t il2cpp_stats_get_value(Il2CppStat stat)
    {
        CallIl2CppFun1(il2cpp_stats_get_value, stat);
    }
    
    // domain
    Il2CppDomain* il2cpp_domain_get()
    {
        CallIl2CppFun0(il2cpp_domain_get);
    }
    
    const Il2CppAssembly* il2cpp_domain_assembly_open(Il2CppDomain *domain, const char *name)
    {
        CallIl2CppFun2(il2cpp_domain_assembly_open, domain, name);
    }
    
    const Il2CppAssembly** il2cpp_domain_get_assemblies(const Il2CppDomain* domain, size_t* size)
    {
        CallIl2CppFun2(il2cpp_domain_get_assemblies, domain, size);
    }
    
    // exception
    
    void il2cpp_raise_exception(Il2CppException* exc)
    {
        CallIl2CppFun1(il2cpp_raise_exception, exc);
    }
    
    Il2CppException* il2cpp_exception_from_name_msg(const Il2CppImage* image, const char *name_space, const char *name, const char *msg)
    {
        CallIl2CppFun4(il2cpp_exception_from_name_msg, image, name_space, name, msg);
    }
    
    Il2CppException* il2cpp_get_exception_argument_null(const char *arg)
    {
        CallIl2CppFun1(il2cpp_get_exception_argument_null, arg);
    }
    
    void il2cpp_format_exception(const Il2CppException* ex, char* message, int message_size)
    {
        CallIl2CppFun3(il2cpp_format_exception, ex, message, message_size);
    }
    
    void il2cpp_format_stack_trace(const Il2CppException* ex, char* output, int output_size)
    {
        CallIl2CppFun3(il2cpp_format_stack_trace, ex, output, output_size);
    }
    
    void il2cpp_unhandled_exception(Il2CppException* exc)
    {
        CallIl2CppFun1(il2cpp_unhandled_exception, exc);
    }
    
    // field
    
    const char* il2cpp_field_get_name(FieldInfo *field)
    {
        CallIl2CppFun1(il2cpp_field_get_name, field);
    }
    
    int il2cpp_field_get_flags(FieldInfo *field)
    {
        CallIl2CppFun1(il2cpp_field_get_flags, field);
    }
    
    Il2CppClass* il2cpp_field_get_parent(FieldInfo *field)
    {
        CallIl2CppFun1(il2cpp_field_get_parent, field);
    }
    
    size_t il2cpp_field_get_offset(FieldInfo *field)
    {
        CallIl2CppFun1(il2cpp_field_get_offset, field);
    }
    
    const Il2CppType* il2cpp_field_get_type(FieldInfo *field)
    {
        CallIl2CppFun1(il2cpp_field_get_type, field);
    }
    
    void il2cpp_field_get_value(Il2CppObject *obj, FieldInfo *field, void *value)
    {
        CallIl2CppFun3(il2cpp_field_get_value, obj, field, value);
    }
    
    Il2CppObject* il2cpp_field_get_value_object(FieldInfo *field, Il2CppObject *obj)
    {
        CallIl2CppFun2(il2cpp_field_get_value_object, field, obj);
    }
    
    bool il2cpp_field_has_attribute(FieldInfo *field, Il2CppClass *attr_class)
    {
        CallIl2CppFun2(il2cpp_field_has_attribute, field, attr_class);
    }
    
    void il2cpp_field_set_value(Il2CppObject *obj, FieldInfo *field, void *value)
    {
        CallIl2CppFun3(il2cpp_field_set_value, obj, field, value);
    }
    
    void il2cpp_field_set_value_object(Il2CppObject* objectInstance, FieldInfo* field, Il2CppObject* value)
    {
        CallIl2CppFun3(il2cpp_field_set_value_object, objectInstance, field, value);
    }
    
    void il2cpp_field_static_get_value(FieldInfo *field, void *value)
    {
        CallIl2CppFun2(il2cpp_field_static_get_value, field, value);
    }
    
    void il2cpp_field_static_set_value(FieldInfo *field, void *value)
    {
        CallIl2CppFun2(il2cpp_field_static_set_value, field, value);
    }
    
    // gc
    void il2cpp_gc_collect(int maxGenerations)
    {
        CallIl2CppFun1(il2cpp_gc_collect, maxGenerations);
    }
    
    int32_t il2cpp_gc_collect_a_little()
    {
        CallIl2CppFun0(il2cpp_gc_collect_a_little);
    }
    
    void il2cpp_gc_enable()
    {
        CallIl2CppFun0(il2cpp_gc_enable);
    }
    
    void il2cpp_gc_disable()
    {
        CallIl2CppFun0(il2cpp_gc_disable);
    }
    
    bool il2cpp_gc_is_disabled()
    {
        CallIl2CppFun0(il2cpp_gc_is_disabled);
    }
    
    int64_t il2cpp_gc_get_used_size()
    {
        CallIl2CppFun0(il2cpp_gc_get_used_size);
    }
    
    int64_t il2cpp_gc_get_heap_size()
    {
        CallIl2CppFun0(il2cpp_gc_get_heap_size);
    }
    
    // gchandle
    
    uint32_t il2cpp_gchandle_new(Il2CppObject *obj, bool pinned)
    {
        CallIl2CppFun2(il2cpp_gchandle_new, obj, pinned);
    }
    
    uint32_t il2cpp_gchandle_new_weakref(Il2CppObject *obj, bool track_resurrection)
    {
        CallIl2CppFun2(il2cpp_gchandle_new_weakref, obj, track_resurrection);
    }
    
    Il2CppObject* il2cpp_gchandle_get_target(uint32_t gchandle)
    {
        CallIl2CppFun1(il2cpp_gchandle_get_target, gchandle);
    }
    
    void il2cpp_gc_wbarrier_set_field(Il2CppObject *obj, void **targetAddress, void *object)
    {
        CallIl2CppFun3(il2cpp_gc_wbarrier_set_field, obj, targetAddress, object);
    }
    
    void il2cpp_gchandle_free(uint32_t gchandle)
    {
        CallIl2CppFun1(il2cpp_gchandle_free, gchandle);
    }
    
    // liveness
    
    void* il2cpp_unity_liveness_calculation_begin(Il2CppClass* filter, int max_object_count, il2cpp_register_object_callback callback, void* userdata, il2cpp_WorldChangedCallback onWorldStarted, il2cpp_WorldChangedCallback onWorldStopped)
    {
        CallIl2CppFun6(il2cpp_unity_liveness_calculation_begin, filter,
                       max_object_count,
                       callback,
                       userdata,
                       onWorldStarted,
                       onWorldStopped
        );
    }
    
    void il2cpp_unity_liveness_calculation_end(void* state)
    {
        CallIl2CppFun1(il2cpp_unity_liveness_calculation_end, state);
    }
    
    void il2cpp_unity_liveness_calculation_from_root(Il2CppObject* root, void* state)
    {
        CallIl2CppFun2(il2cpp_unity_liveness_calculation_from_root, root, state);
    }
    
    void il2cpp_unity_liveness_calculation_from_statics(void* state)
    {
        CallIl2CppFun1(il2cpp_unity_liveness_calculation_from_statics, state);
    }
    
    // method
    
    const Il2CppType* il2cpp_method_get_return_type(const MethodInfo* method)
    {
        CallIl2CppFun1(il2cpp_method_get_return_type, method);
    }
    
    const MethodInfo* il2cpp_method_get_from_reflection(const Il2CppReflectionMethod *method)
    {
        CallIl2CppFun1(il2cpp_method_get_from_reflection, method);
    }
    
    Il2CppReflectionMethod* il2cpp_method_get_object(const MethodInfo *method, Il2CppClass *refclass)
    {
        CallIl2CppFun2(il2cpp_method_get_object, method, refclass);
    }
    
    const char* il2cpp_method_get_name(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_get_name, method);
    }
    
    bool il2cpp_method_is_generic(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_is_generic, method);
    }
    
    bool il2cpp_method_is_inflated(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_is_inflated, method);
    }
    
    bool il2cpp_method_is_instance(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_is_instance, method);
    }
    
    uint32_t il2cpp_method_get_param_count(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_get_param_count, method);
    }
    
    const Il2CppType* il2cpp_method_get_param(const MethodInfo *method, uint32_t index)
    {
        CallIl2CppFun2(il2cpp_method_get_param, method, index);
    }
    
    Il2CppClass* il2cpp_method_get_class(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_get_class, method);
    }
    
    bool il2cpp_method_has_attribute(const MethodInfo *method, Il2CppClass *attr_class)
    {
        CallIl2CppFun2(il2cpp_method_has_attribute, method, attr_class);
    }
    
    Il2CppClass* il2cpp_method_get_declaring_type(const MethodInfo* method)
    {
        CallIl2CppFun1(il2cpp_method_get_declaring_type, method);
    }
    
    uint32_t il2cpp_method_get_flags(const MethodInfo *method, uint32_t *iflags)
    {
        CallIl2CppFun2(il2cpp_method_get_flags, method, iflags);
    }
    
    uint32_t il2cpp_method_get_token(const MethodInfo *method)
    {
        CallIl2CppFun1(il2cpp_method_get_token, method);
    }
    
    const char *il2cpp_method_get_param_name(const MethodInfo *method, uint32_t index)
    {
        CallIl2CppFun2(il2cpp_method_get_param_name, method, index);
    }
    
    void il2cpp_profiler_install(Il2CppProfiler *prof, Il2CppProfileFunc shutdown_callback)
    {
        CallIl2CppFun2(il2cpp_profiler_install, prof, shutdown_callback);
    }
    
    void il2cpp_profiler_set_events(Il2CppProfileFlags events)
    {
        CallIl2CppFun1(il2cpp_profiler_set_events, events);
    }
    
    void il2cpp_profiler_install_enter_leave(Il2CppProfileMethodFunc enter, Il2CppProfileMethodFunc fleave)
    {
        CallIl2CppFun2(il2cpp_profiler_install_enter_leave, enter, fleave);
    }
    
    void il2cpp_profiler_install_allocation(Il2CppProfileAllocFunc callback)
    {
        CallIl2CppFun1(il2cpp_profiler_install_allocation, callback);
    }
    
    void il2cpp_profiler_install_gc(Il2CppProfileGCFunc callback, Il2CppProfileGCResizeFunc heap_resize_callback)
    {
        CallIl2CppFun2(il2cpp_profiler_install_gc, callback, heap_resize_callback);
    }
    
    void il2cpp_profiler_install_fileio(Il2CppProfileFileIOFunc callback)
    {
        CallIl2CppFun1(il2cpp_profiler_install_fileio, callback);
    }
    
    void il2cpp_profiler_install_thread(Il2CppProfileThreadFunc start, Il2CppProfileThreadFunc end)
    {
        CallIl2CppFun2(il2cpp_profiler_install_thread, start, end);
    }
    
    
    const char* il2cpp_property_get_name(PropertyInfo *prop)
    {
        CallIl2CppFun1(il2cpp_property_get_name, prop);
    }
    
    const MethodInfo* il2cpp_property_get_get_method(PropertyInfo *prop)
    {
        CallIl2CppFun1(il2cpp_property_get_get_method, prop);
    }
    
    const MethodInfo* il2cpp_property_get_set_method(PropertyInfo *prop)
    {
        CallIl2CppFun1(il2cpp_property_get_set_method, prop);
    }
    
    Il2CppClass* il2cpp_property_get_parent(PropertyInfo *prop)
    {
        CallIl2CppFun1(il2cpp_property_get_parent, prop);
    }
    
    uint32_t il2cpp_property_get_flags(PropertyInfo *prop)
    {
        CallIl2CppFun1(il2cpp_property_get_flags, prop);
    }
    
    // object
    
    Il2CppClass* il2cpp_object_get_class(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_object_get_class, obj);
    }
    
    uint32_t il2cpp_object_get_size(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_object_get_size, obj);
    }
    
    const MethodInfo* il2cpp_object_get_virtual_method(Il2CppObject *obj, const MethodInfo *method)
    {
        CallIl2CppFun2(il2cpp_object_get_virtual_method, obj, method);
    }
    
    Il2CppObject* il2cpp_object_new(const Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_object_new, klass);
    }
    
    void* il2cpp_object_unbox(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_object_unbox, obj);
    }
    
    Il2CppObject* il2cpp_value_box(Il2CppClass *klass, void* data)
    {
        CallIl2CppFun2(il2cpp_value_box, klass, data);
    }
    
    // monitor
    void il2cpp_monitor_enter(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_monitor_enter, obj);
    }
    
    bool il2cpp_monitor_try_enter(Il2CppObject* obj, uint32_t timeout)
    {
        CallIl2CppFun2(il2cpp_monitor_try_enter, obj, timeout);
    }
    
    void il2cpp_monitor_exit(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_monitor_exit, obj);
    }
    
    void il2cpp_monitor_pulse(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_monitor_pulse, obj);
    }
    
    void il2cpp_monitor_pulse_all(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_monitor_pulse_all, obj);
    }
    
    void il2cpp_monitor_wait(Il2CppObject* obj)
    {
        CallIl2CppFun1(il2cpp_monitor_wait, obj);
    }
    
    bool il2cpp_monitor_try_wait(Il2CppObject* obj, uint32_t timeout)
    {
        CallIl2CppFun2(il2cpp_monitor_try_wait, obj, timeout);
    }
    
    // runtime
    
    Il2CppObject* il2cpp_runtime_invoke_convert_args(const MethodInfo *method, void *obj, Il2CppObject **params, int paramCount, Il2CppException **exc)
    {
        CallIl2CppFun5(il2cpp_runtime_invoke_convert_args, method, obj, params, paramCount, exc);
    }
    
    Il2CppObject* il2cpp_runtime_invoke(const MethodInfo *method,
                                        void *obj, void **params, Il2CppException **exc)
    {
        CallIl2CppFun4(il2cpp_runtime_invoke, method, obj, params, exc);
    }
    
    void il2cpp_runtime_class_init(Il2CppClass* klass)
    {
        CallIl2CppFun1(il2cpp_runtime_class_init, klass);
    }
    
    void il2cpp_runtime_object_init(Il2CppObject *obj)
    {
        CallIl2CppFun1(il2cpp_runtime_object_init, obj);
    }
    
    void il2cpp_runtime_object_init_exception(Il2CppObject *obj, Il2CppException **exc)
    {
        CallIl2CppFun2(il2cpp_runtime_object_init_exception, obj, exc);
    }
    
    void il2cpp_runtime_unhandled_exception_policy_set(Il2CppRuntimeUnhandledExceptionPolicy value)
    {
        CallIl2CppFun1(il2cpp_runtime_unhandled_exception_policy_set, value);
    }
    
    // string
    
    int32_t il2cpp_string_length(Il2CppString* str)
    {
        CallIl2CppFun1(il2cpp_string_length, str);
    }
    
    Il2CppChar* il2cpp_string_chars(Il2CppString* str)
    {
        CallIl2CppFun1(il2cpp_string_chars, str);
    }
    
    // Same as il2cpp_string_new_wrapper, because other normally takes a domain
    Il2CppString* il2cpp_string_new(const char* str)
    {
        CallIl2CppFun1(il2cpp_string_new, str);
    }
    
    Il2CppString* il2cpp_string_new_wrapper(const char* str)
    {
        CallIl2CppFun1(il2cpp_string_new_wrapper, str);
    }
    
    Il2CppString* il2cpp_string_new_utf16(const Il2CppChar *text, int32_t len)
    {
        CallIl2CppFun2(il2cpp_string_new_utf16, text, len);
    }
    
    Il2CppString* il2cpp_string_new_len(const char* str, uint32_t length)
    {
        CallIl2CppFun2(il2cpp_string_new_len, str, length);
    }
    
    Il2CppString* il2cpp_string_intern(Il2CppString* str)
    {
        CallIl2CppFun1(il2cpp_string_intern, str);
    }
    
    Il2CppString* il2cpp_string_is_interned(Il2CppString* str)
    {
        CallIl2CppFun1(il2cpp_string_is_interned, str);
    }
    
    // thread
    
    Il2CppThread *il2cpp_thread_current()
    {
        CallIl2CppFun0(il2cpp_thread_current);
    }
    
    Il2CppThread *il2cpp_thread_attach(Il2CppDomain *domain)
    {
        CallIl2CppFun1(il2cpp_thread_attach, domain);
    }
    
    void il2cpp_thread_detach(Il2CppThread *thread)
    {
        CallIl2CppFun1(il2cpp_thread_detach, thread);
    }
    
    Il2CppThread **il2cpp_thread_get_all_attached_threads(size_t *size)
    {
        CallIl2CppFun1(il2cpp_thread_get_all_attached_threads, size);
    }
    
    bool il2cpp_is_vm_thread(Il2CppThread *thread)
    {
        CallIl2CppFun1(il2cpp_is_vm_thread, thread);
    }
    
    // stacktrace
    
    void il2cpp_current_thread_walk_frame_stack(Il2CppFrameWalkFunc func, void* user_data)
    {
        CallIl2CppFun2(il2cpp_current_thread_walk_frame_stack, func, user_data);
    }
    
    void il2cpp_thread_walk_frame_stack(Il2CppThread *thread, Il2CppFrameWalkFunc func, void *user_data)
    {
        CallIl2CppFun3(il2cpp_thread_walk_frame_stack, thread, func, user_data);
    }
    
    bool il2cpp_current_thread_get_top_frame(Il2CppStackFrameInfo* frame)
    {
        CallIl2CppFun1(il2cpp_current_thread_get_top_frame, frame);
    }
    
    bool il2cpp_thread_get_top_frame(Il2CppThread* thread, Il2CppStackFrameInfo* frame)
    {
        CallIl2CppFun2(il2cpp_thread_get_top_frame, thread, frame);
    }
    
    bool il2cpp_current_thread_get_frame_at(int32_t offset, Il2CppStackFrameInfo* frame)
    {
        CallIl2CppFun2(il2cpp_current_thread_get_frame_at, offset, frame);
    }
    
    bool il2cpp_thread_get_frame_at(Il2CppThread* thread, int32_t offset, Il2CppStackFrameInfo* frame)
    {
        CallIl2CppFun3(il2cpp_thread_get_frame_at, thread, offset, frame);
    }
    
    int32_t il2cpp_current_thread_get_stack_depth()
    {
        CallIl2CppFun0(il2cpp_current_thread_get_stack_depth);
    }
    
    int32_t il2cpp_thread_get_stack_depth(Il2CppThread *thread)
    {
        CallIl2CppFun1(il2cpp_thread_get_stack_depth, thread);
    }
    
    // type
    
    Il2CppObject* il2cpp_type_get_object(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_get_object, type);
    }
    
    int il2cpp_type_get_type(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_get_type, type);
    }
    
    Il2CppClass* il2cpp_type_get_class_or_element_class(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_get_class_or_element_class, type);
    }
    
    char* il2cpp_type_get_name(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_get_name, type);
    }
    
    char* il2cpp_type_get_assembly_qualified_name(const Il2CppType * type)
    {
        CallIl2CppFun1(il2cpp_type_get_assembly_qualified_name, type);
    }
    
    bool il2cpp_type_is_byref(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_is_byref, type);
    }
    
    uint32_t il2cpp_type_get_attrs(const Il2CppType *type)
    {
        CallIl2CppFun1(il2cpp_type_get_attrs, type);
    }
    
    bool il2cpp_type_equals(const Il2CppType* type, const Il2CppType *otherType)
    {
        CallIl2CppFun2(il2cpp_type_equals, type, otherType);
    }
    
    // image
    
    const Il2CppAssembly* il2cpp_image_get_assembly(const Il2CppImage *image)
    {
        CallIl2CppFun1(il2cpp_image_get_assembly, image);
    }
    
    const char* il2cpp_image_get_name(const Il2CppImage *image)
    {
        CallIl2CppFun1(il2cpp_image_get_name, image);
    }
    
    const char* il2cpp_image_get_filename(const Il2CppImage *image)
    {
        CallIl2CppFun1(il2cpp_image_get_filename, image);
    }
    
    const MethodInfo* il2cpp_image_get_entry_point(const Il2CppImage *image)
    {
        CallIl2CppFun1(il2cpp_image_get_entry_point, image);
    }
    
    size_t il2cpp_image_get_class_count(const Il2CppImage * image)
    {
        CallIl2CppFun1(il2cpp_image_get_class_count, image);
    }
    
    const Il2CppClass* il2cpp_image_get_class(const Il2CppImage * image, size_t index)
    {
        CallIl2CppFun2(il2cpp_image_get_class, image, index);
    }
    
    Il2CppManagedMemorySnapshot* il2cpp_capture_memory_snapshot()
    {
        CallIl2CppFun0(il2cpp_capture_memory_snapshot);
    }
    
    void il2cpp_free_captured_memory_snapshot(Il2CppManagedMemorySnapshot* snapshot)
    {
        CallIl2CppFun1(il2cpp_free_captured_memory_snapshot, snapshot);
    }
    
    void il2cpp_set_find_plugin_callback(Il2CppSetFindPlugInCallback method)
    {
        CallIl2CppFun1(il2cpp_set_find_plugin_callback, method);
    }
    
    // Logging
    
    void il2cpp_register_log_callback(Il2CppLogCallback method)
    {
        CallIl2CppFun1(il2cpp_register_log_callback, method);
    }
    
    // Debugger
    void il2cpp_debugger_set_agent_options(const char* options)
    {
        CallIl2CppFun1(il2cpp_debugger_set_agent_options, options);
    }
    
    bool il2cpp_is_debugger_attached()
    {
        CallIl2CppFun0(il2cpp_is_debugger_attached);
    }
    
    void il2cpp_unity_install_unitytls_interface(const void* unitytlsInterfaceStruct)
    {
        CallIl2CppFun1(il2cpp_unity_install_unitytls_interface, unitytlsInterfaceStruct);
    }
    
    // Custom Attributes
    Il2CppCustomAttrInfo* il2cpp_custom_attrs_from_class(Il2CppClass *klass)
    {
        CallIl2CppFun1(il2cpp_custom_attrs_from_class, klass);
    }
    
    Il2CppCustomAttrInfo* il2cpp_custom_attrs_from_method(const MethodInfo * method)
    {
        CallIl2CppFun1(il2cpp_custom_attrs_from_method, method);
    }
    
    bool il2cpp_custom_attrs_has_attr(Il2CppCustomAttrInfo *ainfo, Il2CppClass *attr_klass)
    {
        CallIl2CppFun2(il2cpp_custom_attrs_has_attr, ainfo, attr_klass);
    }
    
    Il2CppObject* il2cpp_custom_attrs_get_attr(Il2CppCustomAttrInfo *ainfo, Il2CppClass *attr_klass)
    {
        CallIl2CppFun2(il2cpp_custom_attrs_get_attr, ainfo, attr_klass);
    }
    
    Il2CppArray*  il2cpp_custom_attrs_construct(Il2CppCustomAttrInfo *ainfo)
    {
        CallIl2CppFun1(il2cpp_custom_attrs_construct, ainfo);
    }
    
    void il2cpp_custom_attrs_free(Il2CppCustomAttrInfo *ainfo)
    {
        // nothing to free, we cache everything
        CallIl2CppFun1(il2cpp_custom_attrs_free, ainfo);
    }
    
    
    

    3.在unity打包好apk后,解包然后把包里的libil2cpp.so重命名为libil2cpp_.so,把我们的跳板命名为libil2cpp.so.在跳板函数中载入原来的libil2cpp.so

    
    void InitUpdate(const char* ilpath, const char* pMetaPath)
    {
        void* pIl2cppModule = dlopen(ilpath, RTLD_LOCAL);
        if(pIl2cppModule == nullptr)
        {
            LOGD("il2cpp:%s can't load", ilpath);
            return;
        }
        if(pMetaPath != nullptr)
        {
            char* dupMetaPath = strdup(pMetaPath);
            UpdateMetaFun pSet_meta_update_path = (UpdateMetaFun)dlsym(pIl2cppModule, "il2cpp_set_update_meta_filename");
            if(pSet_meta_update_path != nullptr)
            {
                pSet_meta_update_path(dupMetaPath);
            }
        }
    
    #define GETFUNADDR(funname) g_##funname = dlsym(pIl2cppModule, ""#funname);
        GETFUNADDR(il2cpp_class_from_type)
        GETFUNADDR(il2cpp_class_is_valuetype)
        GETFUNADDR(il2cpp_domain_get)
        GETFUNADDR(il2cpp_monitor_enter)
        GETFUNADDR(il2cpp_monitor_exit)
        GETFUNADDR(il2cpp_object_unbox)
        GETFUNADDR(il2cpp_runtime_invoke)
        GETFUNADDR(il2cpp_gc_wbarrier_set_field)
        GETFUNADDR(il2cpp_add_internal_call)
        GETFUNADDR(il2cpp_alloc)
        GETFUNADDR(il2cpp_array_class_get)
        GETFUNADDR(il2cpp_array_element_size)
        GETFUNADDR(il2cpp_array_get_byte_length)
        GETFUNADDR(il2cpp_array_length)
        GETFUNADDR(il2cpp_array_new)
        GETFUNADDR(il2cpp_array_new_full)
        GETFUNADDR(il2cpp_array_new_specific)
        GETFUNADDR(il2cpp_assembly_get_image)
        GETFUNADDR(il2cpp_bounded_array_class_get)
        GETFUNADDR(il2cpp_capture_memory_snapshot)
        GETFUNADDR(il2cpp_class_array_element_size)
        GETFUNADDR(il2cpp_class_enum_basetype)
        GETFUNADDR(il2cpp_class_from_il2cpp_type)
        GETFUNADDR(il2cpp_class_from_name)
        GETFUNADDR(il2cpp_class_from_system_type)
        GETFUNADDR(il2cpp_class_get_assemblyname)
        GETFUNADDR(il2cpp_class_get_bitmap)
        GETFUNADDR(il2cpp_class_get_bitmap_size)
        GETFUNADDR(il2cpp_class_get_declaring_type)
        GETFUNADDR(il2cpp_class_get_element_class)
        GETFUNADDR(il2cpp_class_get_events)
        GETFUNADDR(il2cpp_class_get_field_from_name)
        GETFUNADDR(il2cpp_class_get_fields)
        GETFUNADDR(il2cpp_class_get_flags)
        GETFUNADDR(il2cpp_class_get_image)
        GETFUNADDR(il2cpp_class_get_interfaces)
        GETFUNADDR(il2cpp_class_get_method_from_name)
        GETFUNADDR(il2cpp_class_get_methods)
        GETFUNADDR(il2cpp_class_get_name)
        GETFUNADDR(il2cpp_class_get_namespace)
        GETFUNADDR(il2cpp_class_get_nested_types)
        GETFUNADDR(il2cpp_class_get_parent)
        GETFUNADDR(il2cpp_class_get_properties)
        GETFUNADDR(il2cpp_class_get_property_from_name)
        GETFUNADDR(il2cpp_class_get_rank)
        GETFUNADDR(il2cpp_class_get_type)
        GETFUNADDR(il2cpp_class_get_type_token)
        GETFUNADDR(il2cpp_class_has_attribute)
        GETFUNADDR(il2cpp_class_has_parent)
        GETFUNADDR(il2cpp_class_has_references)
        GETFUNADDR(il2cpp_class_instance_size)
        GETFUNADDR(il2cpp_class_is_abstract)
        GETFUNADDR(il2cpp_class_is_assignable_from)
        GETFUNADDR(il2cpp_class_is_blittable)
        GETFUNADDR(il2cpp_class_is_enum)
        GETFUNADDR(il2cpp_class_is_generic)
        GETFUNADDR(il2cpp_class_is_inflated)
        GETFUNADDR(il2cpp_class_is_interface)
        GETFUNADDR(il2cpp_class_is_subclass_of)
        GETFUNADDR(il2cpp_class_num_fields)
        GETFUNADDR(il2cpp_class_value_size)
        GETFUNADDR(il2cpp_current_thread_get_frame_at)
        GETFUNADDR(il2cpp_current_thread_get_stack_depth)
        GETFUNADDR(il2cpp_current_thread_get_top_frame)
        GETFUNADDR(il2cpp_current_thread_walk_frame_stack)
        GETFUNADDR(il2cpp_custom_attrs_construct)
        GETFUNADDR(il2cpp_custom_attrs_free)
        GETFUNADDR(il2cpp_custom_attrs_from_class)
        GETFUNADDR(il2cpp_custom_attrs_from_method)
        GETFUNADDR(il2cpp_custom_attrs_get_attr)
        GETFUNADDR(il2cpp_custom_attrs_has_attr)
        GETFUNADDR(il2cpp_debugger_set_agent_options)
        GETFUNADDR(il2cpp_domain_assembly_open)
        GETFUNADDR(il2cpp_domain_get_assemblies)
        GETFUNADDR(il2cpp_exception_from_name_msg)
        GETFUNADDR(il2cpp_field_get_flags)
        GETFUNADDR(il2cpp_field_get_name)
        GETFUNADDR(il2cpp_field_get_offset)
        GETFUNADDR(il2cpp_field_get_parent)
        GETFUNADDR(il2cpp_field_get_type)
        GETFUNADDR(il2cpp_field_get_value)
        GETFUNADDR(il2cpp_field_get_value_object)
        GETFUNADDR(il2cpp_field_has_attribute)
        GETFUNADDR(il2cpp_field_set_value)
        GETFUNADDR(il2cpp_field_set_value_object)
        GETFUNADDR(il2cpp_field_static_get_value)
        GETFUNADDR(il2cpp_field_static_set_value)
        GETFUNADDR(il2cpp_format_exception)
        GETFUNADDR(il2cpp_format_stack_trace)
        GETFUNADDR(il2cpp_free)
        GETFUNADDR(il2cpp_free_captured_memory_snapshot)
        GETFUNADDR(il2cpp_gc_collect)
        GETFUNADDR(il2cpp_gc_collect_a_little)
        GETFUNADDR(il2cpp_gc_disable)
        GETFUNADDR(il2cpp_gc_enable)
        GETFUNADDR(il2cpp_gc_get_heap_size)
        GETFUNADDR(il2cpp_gc_get_used_size)
        GETFUNADDR(il2cpp_gc_is_disabled)
        GETFUNADDR(il2cpp_gchandle_free)
        GETFUNADDR(il2cpp_gchandle_get_target)
        GETFUNADDR(il2cpp_gchandle_new)
        GETFUNADDR(il2cpp_gchandle_new_weakref)
        GETFUNADDR(il2cpp_get_corlib)
        GETFUNADDR(il2cpp_get_exception_argument_null)
        GETFUNADDR(il2cpp_image_get_assembly)
        GETFUNADDR(il2cpp_image_get_class)
        GETFUNADDR(il2cpp_image_get_class_count)
        GETFUNADDR(il2cpp_image_get_entry_point)
        GETFUNADDR(il2cpp_image_get_filename)
        GETFUNADDR(il2cpp_image_get_name)
        GETFUNADDR(il2cpp_init)
        GETFUNADDR(il2cpp_init_utf16)
        GETFUNADDR(il2cpp_is_debugger_attached)
        GETFUNADDR(il2cpp_is_vm_thread)
        GETFUNADDR(il2cpp_method_get_class)
        GETFUNADDR(il2cpp_method_get_declaring_type)
        GETFUNADDR(il2cpp_method_get_flags)
        GETFUNADDR(il2cpp_method_get_from_reflection)
        GETFUNADDR(il2cpp_method_get_name)
        GETFUNADDR(il2cpp_method_get_object)
        GETFUNADDR(il2cpp_method_get_param)
        GETFUNADDR(il2cpp_method_get_param_count)
        GETFUNADDR(il2cpp_method_get_param_name)
        GETFUNADDR(il2cpp_method_get_return_type)
        GETFUNADDR(il2cpp_method_get_token)
        GETFUNADDR(il2cpp_method_has_attribute)
        GETFUNADDR(il2cpp_method_is_generic)
        GETFUNADDR(il2cpp_method_is_inflated)
        GETFUNADDR(il2cpp_method_is_instance)
        GETFUNADDR(il2cpp_monitor_pulse)
        GETFUNADDR(il2cpp_monitor_pulse_all)
        GETFUNADDR(il2cpp_monitor_try_enter)
        GETFUNADDR(il2cpp_monitor_try_wait)
        GETFUNADDR(il2cpp_monitor_wait)
        GETFUNADDR(il2cpp_object_get_class)
        GETFUNADDR(il2cpp_object_get_size)
        GETFUNADDR(il2cpp_object_get_virtual_method)
        GETFUNADDR(il2cpp_object_new)
        GETFUNADDR(il2cpp_profiler_install)
        GETFUNADDR(il2cpp_profiler_install_allocation)
        GETFUNADDR(il2cpp_profiler_install_enter_leave)
        GETFUNADDR(il2cpp_profiler_install_fileio)
        GETFUNADDR(il2cpp_profiler_install_gc)
        GETFUNADDR(il2cpp_profiler_install_thread)
        GETFUNADDR(il2cpp_profiler_set_events)
        GETFUNADDR(il2cpp_property_get_flags)
        GETFUNADDR(il2cpp_property_get_get_method)
        GETFUNADDR(il2cpp_property_get_name)
        GETFUNADDR(il2cpp_property_get_parent)
        GETFUNADDR(il2cpp_property_get_set_method)
        GETFUNADDR(il2cpp_raise_exception)
        GETFUNADDR(il2cpp_register_log_callback)
        GETFUNADDR(il2cpp_resolve_icall)
        GETFUNADDR(il2cpp_runtime_class_init)
        GETFUNADDR(il2cpp_runtime_invoke_convert_args)
        GETFUNADDR(il2cpp_runtime_object_init)
        GETFUNADDR(il2cpp_runtime_object_init_exception)
        GETFUNADDR(il2cpp_runtime_unhandled_exception_policy_set)
        GETFUNADDR(il2cpp_set_commandline_arguments)
        GETFUNADDR(il2cpp_set_commandline_arguments_utf16)
        GETFUNADDR(il2cpp_set_config)
        GETFUNADDR(il2cpp_set_config_dir)
        GETFUNADDR(il2cpp_set_config_utf16)
        GETFUNADDR(il2cpp_set_data_dir)
        GETFUNADDR(il2cpp_set_find_plugin_callback)
        GETFUNADDR(il2cpp_set_memory_callbacks)
        GETFUNADDR(il2cpp_set_temp_dir)
        GETFUNADDR(il2cpp_shutdown)
        GETFUNADDR(il2cpp_stats_dump_to_file)
        GETFUNADDR(il2cpp_stats_get_value)
        GETFUNADDR(il2cpp_string_chars)
        GETFUNADDR(il2cpp_string_intern)
        GETFUNADDR(il2cpp_string_is_interned)
        GETFUNADDR(il2cpp_string_length)
        GETFUNADDR(il2cpp_string_new)
        GETFUNADDR(il2cpp_string_new_len)
        GETFUNADDR(il2cpp_string_new_utf16)
        GETFUNADDR(il2cpp_string_new_wrapper)
        GETFUNADDR(il2cpp_thread_attach)
        GETFUNADDR(il2cpp_thread_current)
        GETFUNADDR(il2cpp_thread_detach)
        GETFUNADDR(il2cpp_thread_get_all_attached_threads)
        GETFUNADDR(il2cpp_thread_get_frame_at)
        GETFUNADDR(il2cpp_thread_get_stack_depth)
        GETFUNADDR(il2cpp_thread_get_top_frame)
        GETFUNADDR(il2cpp_thread_walk_frame_stack)
        GETFUNADDR(il2cpp_type_equals)
        GETFUNADDR(il2cpp_type_get_assembly_qualified_name)
        GETFUNADDR(il2cpp_type_get_attrs)
        GETFUNADDR(il2cpp_type_get_class_or_element_class)
        GETFUNADDR(il2cpp_type_get_name)
        GETFUNADDR(il2cpp_type_get_object)
        GETFUNADDR(il2cpp_type_get_type)
        GETFUNADDR(il2cpp_type_is_byref)
        GETFUNADDR(il2cpp_unhandled_exception)
        GETFUNADDR(il2cpp_unity_install_unitytls_interface)
        GETFUNADDR(il2cpp_unity_liveness_calculation_begin)
        GETFUNADDR(il2cpp_unity_liveness_calculation_end)
        GETFUNADDR(il2cpp_unity_liveness_calculation_from_root)
        GETFUNADDR(il2cpp_unity_liveness_calculation_from_statics)
        GETFUNADDR(il2cpp_value_box)
    }
    
    

    至此,libil2cpp.so处理完毕

    global-metadata.dat文件热更

    加载global-metadata.data是通过函数void* MetadataLoader::LoadMetadataFile(const char* fileName),
     通过修改修改引擎下的MetadataLoader.cpp,实现读取自定义路径的global-metadata.data达到热更目的。
    #include "il2cpp-config.h"
    #include "MetadataLoader.h"
    #include "os/File.h"
    #include "os/Mutex.h"
    #include "utils/MemoryMappedFile.h"
    #include "utils/PathUtils.h"
    #include "utils/Runtime.h"
    #ifdef ANDROID
    #include <android/log.h>
    #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "YY" ,__VA_ARGS__)
    #else
    #define LOGD(...)
    #endif
    
    using namespace il2cpp::os;
    using namespace il2cpp::vm;
    const char* g_updated_meta_filename = NULL;
    #if defined(__cplusplus)
    extern "C"
    {
    #endif // __cplusplus
    IL2CPP_EXPORT void il2cpp_set_update_meta_filename(const char* filename)
    {	
    	LOGD("set updated_meta_filename:%s", filename);
    	g_updated_meta_filename = filename;
    }
    #if defined(__cplusplus)
    }
    #endif // __cplusplus
    void* MetadataLoader::LoadMetadataFile(const char* fileName)
    {	
        std::string resourcesDirectory = utils::PathUtils::Combine(utils::Runtime::GetDataDir(), utils::StringView<char>("Metadata"));
        std::string resourceFilePath = utils::PathUtils::Combine(resourcesDirectory, utils::StringView<char>(fileName, strlen(fileName)));	
        int error = 1;
        FileHandle* handle = NULL;
    	if (g_updated_meta_filename != NULL)
    	{
    		LOGD("load g_updated_meta_filename:%s", g_updated_meta_filename);
    		handle = File::Open(g_updated_meta_filename, kFileModeOpen, kFileAccessRead, kFileShareRead, kFileOptionsNone, &error);	
    		if (error != 0)
    		{
    			LOGD("load g_updated_meta_filename failed, try local metafile:%s", g_updated_meta_filename);
    		}
    		else
    		{
    			LOGD("load g_updated_meta_filename success:%s", g_updated_meta_filename);
    		}
    	}
    	if (error != 0)
    	{		
    		handle = File::Open(resourceFilePath, kFileModeOpen, kFileAccessRead, kFileShareRead, kFileOptionsNone, &error);
    		if (error != 0)
    		{
    			LOGD("LoadMetadataFile file:%s", resourceFilePath.c_str());
    			return NULL;
    		}
    	}
        void* fileBuffer = utils::MemoryMappedFile::Map(handle);
    
        File::Close(handle, &error);
        if (error != 0)
        {
            utils::MemoryMappedFile::Unmap(fileBuffer);
            fileBuffer = NULL;
            return NULL;
        }
    
        return fileBuffer;
    }
    

    完整的工程实例

    https://github.com/yy405145590/il2cpphotfix

    展开全文
  • 在github上的zxing C++库,二维码解码,用CMAKE进行编译 可用于嵌入式平台。
  • Dev-Cpp 5.4.0

    热门讨论 2013-04-25 21:35:07
    很小巧很强大的一个C/C++编译器,安装时间不到1分钟,我平时在图书馆的电脑上经常使用,比visual C++ 6.0好多了。 欢迎有需要的朋友下载,真心推荐。
  • c++并发编程中英文双版本内带书源码! c++并发编程是不可多得的好书,在c++并发编程指导方面,下载的你肯定不会失望。(为何一定要积分???)
  • cppcheck的安装与使用

    千次阅读 2021-03-25 16:29:07
    一、cppcheck安装 环境:Ubuntu20.04,gcc-9.3.0/gcc-7.5.0 1、方法一:apt源安装cppcheck(推荐,无需编译安装,自动配置环境变量) sudoaptinstallcppcheck 查看版本情况 cppcheck --version ...

    一、cppcheck安装

    环境:Ubuntu20.04,gcc-9.3.0/gcc-7.5.0

    1、方法一:apt源安装cppcheck(推荐,无需编译安装,自动配置环境变量)

    sudo apt install cppcheck

    查看版本情况

    cppcheck --version

    2、方法二:编译安装cppcheck

    http://cppcheck.net/官网下载cppcheck源码包(.tar.gz),github下载也可

    首先,解压cppcheck压缩包

    sudo tar -zxvf cppcheck-2.3.tar.gz

    解压完成之后,进入cppcheck文件夹

    cd cppcheck-2.3/

    可以看到,cppcheck包含CMakeLists.txt,可以使用CMake编译

    我们先创建一个build的文件夹,进入build的文件夹

    mkdir build && cd build

    下面进行编译,我这里gcc版本为9.3.0,经测试7.5.0也没问题

    首先使用cmake ..命令将CMakeLists.txt转换为make所需要的makefile

    cmake ..

    然后,通过make开始编译,-j是代表jobs,表示使用多少个线程进行编译

    make -j 8

    编译完成,进入bin目录下查看是否生成cppcheck的可执行文件

    cd bin && ll

     

    总用量 70912

    drwxr-xr-x  2 inspur inspur     4096 3月  25 14:15 ./

    drwxr-xr-x 11 inspur inspur     4096 3月  25 14:15 ../

    -rwxrwxr-x  1 inspur inspur 72185664 3月  25 14:15 cppcheck*

    ok,编译安装完成!当然也可以将可执行文件添加到环境变量中使用,方便操作,操作如下。

    sudo vim /etc/profile

    然后点击i键进行编辑状态,文件末尾输入

    export CPPCHECK_HOME=编译生成可执行文件的目录,例如:/home/xxx/software/cppcheck-2.3/build/bin

    按下Esc,输入:wq保存,然后执行source  /etc/profile,即可直接使用cppcheck进行相关操作

    二、cppcheck的使用

    简述:cppcheck 是一种 C/C++ 代码缺陷静态检查工具。不同于 C/C++ 编译器及很多其它分析工具,它不检查代码中的语法错误。Cppcheck 只检查编译器检查不出来的 bug 类型,其目的是检查代码中真正的错误。

    部分操作介绍,如需更多操作说明,请使用cppcheck --help进行查看

    1、检查某一个c/c++文件

    cppcheck file.c

    2、检查文件夹中的所有文件

    cppcheck path

    cppcheck将递归检查path文件夹下所有源文件

    3、启用消息

    默认情况下,只显示错误消息,可以通过–enable命令启用更多检查

    启用警告消息:

    cppcheck --enable=warning file.c

    启用性能消息:

    cppcheck --enable=performance file.c

    启用信息消息:

    cppcheck --enable=information file.c

    由于历史原因 --enable=style 可以启用警告、性能、可移植性和样式信息。当使用旧 XML 格式时,这些都由 style 表示:

    cppcheck --enable=style file.c

    启用警告和性能消息:

    cppcheck --enable=warning,performance file.c

    启用unusedFunction检查

    cppcheck --enable=unusedFunction file.c

    启用所有消息:

    cppcheck --enable=all

    4、将检查结果保存到文件中

    cppcheck file.c 2> result.txt

    5、多线程检查

    cppcheck -j 4 path

    多线程检查时,不会对ubusedFunction进行检查

    6、CMake项目cppcheck检查的使用

    首先,在CMakeList.txt同目录下,通过cmake生成项目的compile_commands.json文件

    cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

    然后即可使用cppcheck对该项目进行检查

    cppcheck --project=compile_commands.json

    可通过重定向将检查结果导入到文件中

    7、屏蔽某种错误

    屏蔽syntax error: 命令行参数 --suppress=syntaxError

    cppcheck --suppress=memleak:src/file1.cpp src/

    8、使用suppressions.txt 统一屏蔽,--suppressions-list=suppressions.txt

    示例:

    noExplicitConstructor // suppress all noExplicitConstructor errors in all files

       

    // suppress memleak and exceptNew errors in the file src/file1.cpp

    memleak:src/file1.cpp

    exceptNew:src/file1.cpp

    格式:

    [error id]:[filename]:[line]

    [error id]:[filename2]

    [error id]

    三、常见错误修改

    (1)隐式构造问题

    示例: (style) Class 'Slice' has a constructor with 1 argument that is not explicit.

    解决方法:在Slice构造函数前加上explicit,使其必须显示构造,当然这种有时并非必须显示构造

    (2)变量未初始化问题

    示例:(warning) Member variable 'TableFileCreationInfo::file_size' is not initialized in the constructor.

    解决方法:在构造函数中加入变量初始值

    (3)变量/函数未使用问题

    示例:(style) Unused variable: output

    示例:(style) The function 'rocksmt_wal_iter_status' is never used.

    解决方法:考虑后期是否还需要,不需要的及时删除,需要的保留

    (4)raw loop问题

    示例:(style) Consider using std::fill algorithm instead of a raw loop. [useStlAlgorithm]

    示例:(style) Consider using std::transform algorithm instead of a raw loop. [useStlAlgorithm]

    解决办法:将循环便利替换为STL标准库算法函数

    (5)引用传递问题

    示例:(performance) Function parameter 'f' should be passed by reference.

    解决办法:在声明function时,能用引用传递的尽量使用引用传递,尽量避免值传递

    (6)const参数问题

    示例:(performance) Function parameter 's' should be passed by const reference. [passedByValue]

    解决办法:形参s前加上const,在函数中未被修改的变量,尽量声明为const

    展开全文
  • log4cpp 详解及使用操作

    千次阅读 2019-02-12 14:27:25
    Log4cpp是一个开源的C++类库,它提供了在C++程序中使用日志和跟踪调试的功能。使用log4cpp,可以很便利地将日志或者跟踪调试信息写入字符流、内存字符串队列、文件、回滚文件、调试器、Windows日志、本地syslog和...
  • 2、创建文件夹和cpp文件 可以是JNI 创建cpp 3、java里要有native方法声明 比如 //声明native方法 private native String jniTellMeWhy(String hiJni); //使用静态代码块引入cpp static { System.loadLibrary(...
  • vscode-cpp:我的cpp

    2021-02-08 13:29:28
    vscode-cpp 我的cpp文件。
  • CPP 获取目录下的文件

    千次阅读 2021-11-15 14:12:00
    CPP 获取目录下的文件 filesystem 标准库介绍 实现代码 CPP 获取目录下的文件 在 Python 中获取目录下的所有文件可以用 `os.listdir(path)` 实现,在CPP中有没有类似的方法呢?答案是肯定的。 filesystem 标准...
  • 文章目录一、前言二、下载IL2CppDumper三、Unity Demo工程四、IL2CPP打包五、拿到libil2cpp.so与global-metadata.dat六、执行Il2CppDumper.exe七、查看反编译后的文件1、dump.cs2、il2cpp.h3、script.json4、string...
  • Baekjoon_cpp:日本央行cpp播种
  • Ubuntu下cppcheck的安装和使用

    千次阅读 2022-03-22 08:39:54
    # DESTDIR 安装到的目的路径 # FILESDIR 实际安装路径为`...make -j8 FILESDIR=/usr/share/cppcheck DESTDIR= MATCHCOMPILER=yes sudo make install FILESDIR=/usr/share/cppcheck DESTDIR= MATCHCOMPILER=yes ...
  • leetcode_cpp

    2021-02-10 17:18:55
    leetcode C ++实践编译g++ filename.cpp unittest g++ filename.cpp -lgtest -lpthread TODO-安装Google Unit sudo apt-get install cmake libgtest-dev #include <gtest>
  • c++ 开发中利用yaml-cpp读写yaml配置文件

    万次阅读 多人点赞 2019-04-25 14:27:47
    在程序员的开发生涯中,读写配置文件必不可少。 配置文件有利于我们灵活配置工程,解决大量重复...今天的博文介绍的是如何在 C++ 开发中利用 yaml-cpp 开源库读写 yaml 配置文件。 如果有 Python 开发经验的同学...
  • android开发 引入cpp文件

    千次阅读 2022-02-11 10:26:25
    cpp文件夹下,放入CMakeLists.txt文件 和 cpp文件 配置 在模块位置,右击,选择Link C++ 运行报错 解决: 修改ndk版本 继续运行报错 解决: 直接点蓝字,升级gradle版本 继续运行报错 解决: 在模块的build....
  • ubuntu 安装log4cpp

    千次阅读 2022-04-24 23:08:18
    推荐一个零声学院免费公开课程,个人觉得老师讲得不错,分享给大家:[Linux,Nginx,ZeroMQ,MySQL,Redis,fastdfs,MongoDB,...下载地址:https://sourceforge.net/projects/log4cpp/files/latest/download 解...
  • 一些cpp程序
  • Log4cpp介绍及使用

    千次阅读 2018-03-07 20:58:01
    Log4cpp是一个开源的C++类库,它提供了在C++程序中使用日志和跟踪调试的功能。使用log4cpp,可以很便利地将日志或者跟踪调试信息写入字符流、内存字符串队列、文件、回滚文件、调试器、Windows日志、本地syslog和...
  • Dev-Cpp 5.4.0 MinGW 4.7.2 Setup

    热门讨论 2013-04-25 23:21:42
    感谢开发者提供这么优秀的C/C++开发工具 蓝桥杯可选比赛软件工具

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,347,990
精华内容 539,196
关键字:

cpp