Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

游戏没有libil2cpp.so #203

Open
enenH opened this issue Jul 2, 2024 · 1 comment
Open

游戏没有libil2cpp.so #203

enenH opened this issue Jul 2, 2024 · 1 comment

Comments

@enenH
Copy link

enenH commented Jul 2, 2024

像使命召唤国服 发现是把il2cpp.so的内容融合进了libunity.so

@enenH
Copy link
Author

enenH commented Jul 2, 2024

void hack_start(const char* game_data_dir) {
    bool load = false;
    bool check_have_il2cpp = false;
    for (int i = 0; i < 10; i++) {
        void* handle = xdl_open("libil2cpp.so", 0);
        if (handle) {
            load = true;
            il2cpp_api_init(handle);
            il2cpp_dump(game_data_dir);
            break;
        } else {
            if (!check_have_il2cpp) {
                void* libunity = xdl_open("libunity.so", 0);
                if (libunity) {
                    xdl_info_t info;
                    xdl_info(libunity, XDL_DI_DLINFO, &info);
                    std::string lib_path = info.dli_fname;
                    lib_path = lib_path.substr(0, lib_path.find_last_of('/'));
                    lib_path += "/libil2cpp.so";
                    LOGI("libil2cpp.so path %s", lib_path.data());
                    if (access(lib_path.data(), F_OK) == -1) {
                        LOGI("game not have libil2cpp.so,use default libunity.so");
                        load = true;
                        il2cpp_api_init(libunity);
                        il2cpp_dump(game_data_dir);
                        xdl_close(libunity);
                        break;
                    }
                    check_have_il2cpp = true;
                    xdl_close(libunity);
                }
            }

            sleep(1);
        }
    }
    if (!load) {
        LOGI("libil2cpp.so not found in thread %d", gettid());
    }
}

使用此代码可以解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant