Skip to content

xdl_addr查找了错误的符号信息 #25

Open
@XMDS

Description

@XMDS

代码:

__attribute__((target("arm"))) __attribute__((noinline)) void Test()
{
    LOGI("Test called");
}

static void (*old_Test)() = nullptr;
__attribute__((target("arm"))) void proxy_Test()
{
    LOG(INFO, "proxy_Test1 called");
    return old_Test();
}

__attribute__((constructor)) void Init()
{

    xdl_info_t i;
    void* c = nullptr;
    xdl_addr((void*)Test, &i, &c);
    LOGI("Test addr: %p, name: %s, size: %d\n",i.dli_saddr, i.dli_sname, i.dli_ssize);
    xdl_addr_clean(&c);
}

输出:

10-11 13:21:44.744  8898  8898 I HookTest: Test addr: 0xb8c70225, name: _Z12proxy_mallocj, size: 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions