- 博客(4)
- 收藏
- 关注
原创 python生成一张颜色随机的png
https://www.w3.org/TR/PNG/#9Filterhttps://www.jianshu.com/p/e54afe270e39https://darka.github.io/posts/generating-png-in-python/https://stackoverflow.com/questions/8554282/creating-a-png-file-in-python#! /usr/bin/python3import zlibimport structimpor
2021-09-10 14:05:42
241
原创 [armv8] pa register
linux kenrel中可以通过PAR() 输出user& kernel space的buffer cache attrdriver中直接使用uaccess_save_and_enable()就可以读写user space的buffer int uflags = uaccess_save_and_enable();extern unsigned long PAR(unsigned long addr, int user); printk(KERN_EMERG"user par(0x%lx)
2021-07-19 16:27:44
117
原创 Android使用mmap/malloc + mprotect dump trash backtrace
linux使用mmap/malloc + mprotect debug memory trash上一篇文章介绍了linux中如何使用mprotect debug memory trash,在Android lib中的使用也是一样,只是dump_stack要稍微处理一下添加dumpLog.cpp#include <utils/CallStack.h>extern "C" void sig_dumpStack(void);void sig_dumpStack(void){ and
2021-07-19 16:23:47
346
1
原创 linux使用mmap/malloc + mprotect debug memory trash
有些情况下malloc的memory被trash了,但是分析code看不出问题来,可以使用asan和valgrind等静态检查工具协助分析,也可以直接使用mprotect将数据框起来做读写保护,然后捕捉SIGSEGV信号,在信号处理函数中dumpstack来看是哪里trash了这块memory.#include <unistd.h>#include <sys/mman.h>void * mmap(void *start, size_t length, int prot , in
2021-07-19 16:20:06
378
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人