zoukankan      html  css  js  c++  java
  • Android memory dump

    1.读取指定pid和内存地址的字符:

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <sys/ptrace.h>
    #include <errno.h>
    #include <dirent.h>
    
    int pid = 17919;
    long int addr = 0x12CBC270;
    
    int main(int argc, void **argv)
    {
        int ret = 0;
        char data = 0;
    
        printf("start...
    ");
    
        ret = ptrace(PTRACE_ATTACH, pid, 0, 0);
    
        if(ret == -1)
        {
            printf("ptrace fail,exit
    ");
            return 1;
        }
    
        waitpid(pid, NULL, 0);
    
        data = ptrace(PTRACE_PEEKDATA, pid, addr, NULL);
    
        printf("addr:%08lX data:%02X
    ",addr,data);
    
        ptrace(PTRACE_DETACH, pid, NULL, NULL);  
    
        return 0;
    }

    链接资料:

  • 相关阅读:
    svn上传文件钩子
    linux服务器版svn安装
    csp-s模拟55
    csp-s模拟54
    csp-s模拟53
    csp-s模拟52
    csp-s模拟51
    csp-s模拟50
    csp-s模拟49
    csp-s模拟48
  • 原文地址:https://www.cnblogs.com/guanglun/p/9340138.html
Copyright © 2011-2022 走看看