首页
社区
课程
招聘
[求助] Android inotify防dump
发表于: 2017-3-11 17:03 3987

[求助] Android inotify防dump

2017-3-11 17:03
3987

脱壳时会到/proc/pid/mem or /proc/pid/maps 下dump内存数据,故而访问mem/maps,网上找到的代码都是监控文件夹。但是应用启动时同样会解密DEX/SO,解密的过程也应该在mem/maps下进行,这时为什么不会触发IN_ACCESS/IN_OPEN事件?     

int read_event(int fd) {
    char buffer[16384] = {0};
    size_t index = 0;
    struct inotify_event *ptr_event;
    ssize_t r = read(fd, buffer, 16384);
    if (r <= 0) {
        return r;
    }
    while (index < r) {
        ptr_event = (struct inotify_event *) &buffer[index];
        //此处监控事件的读和打开,如果出现则直接结束进程
        if ((ptr_event->mask & IN_ACCESS) || (ptr_event->mask & IN_OPEN)) {
            //    LOGD("kill!!!!!\n");
            //事件出现则杀死父进程
            LOGE("hhhahahahahahahahahaahah");
            int ret = kill(getpid(), SIGKILL);
            //  LOGD("ret = %d", ret);
            return 0;
        }
        index += sizeof(struct inotify_event) + ptr_event->len;
    }
    return 0;
}

               


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 62
活跃值: (27)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
好眼熟的LOG输出,楼主有注意到使用了inotify机制的反调试都是在解密代码之后吗?
2017-3-11 18:25
0
雪    币: 6
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
toToC 好眼熟的LOG输出,楼主有注意到使用了inotify机制的反调试都是在解密代码之后吗?
我再细看下代码,多谢
2017-3-11 19:01
0
游客
登录 | 注册 方可回帖
返回