"C","C++","Java","Asm","Python","Go"
Anyway constexpr is the magic of cplusplus.
安卓内存读写驱动 linux kernel (Android) memory tool
License: MIT License
bool read_process_memory(pid_t pid, uintptr_t addr, void *buffer, size_t size)
{
struct task_struct *task;
struct mm_struct *mm;
struct pid *pid_struct;
phys_addr_t pa;
pid_struct = find_get_pid(pid);
if (!pid_struct) {
return false;
}
task = get_pid_task(pid_struct, PIDTYPE_PID);
if (!task) {
return false;
}
mm = get_task_mm(task);
if (!mm) {
return false;
}
mmput(mm);
while (size > 0) {
//当前页剩余字节
int diff = addr % PAGE_SIZE == 0 ? PAGE_SIZE :
PAGE_SIZE - addr % PAGE_SIZE;
if (size < diff) {
diff = size;
}
pa = translate_linear_address(mm, addr);
if (!pa) {
return false;
}
if (!read_physical_address(pa, buffer, diff)) {
return false;
}
size -= diff;
addr += diff;
buffer += diff;
}
return true;
}
make: 进入目录“/root/kernel_xiaomi_sm8350-miui/out”
CC [M] /root/kernel_xiaomi_sm8350-miui/drivers/wanbai/memory.o
AR [M] /root/kernel_xiaomi_sm8350-miui/drivers/wanbai/k.o
LTO [M] /root/kernel_xiaomi_sm8350-miui/drivers/wanbai/k.lto.o
Building modules, stage 2.
MODPOST 1 modules
ERROR: "valid_phys_addr_range" [/root/kernel_xiaomi_sm8350-miui/drivers/wanbai/k.ko] undefined!
make[2]: *** [../scripts/Makefile.modpost:113:__modpost] 错误 1
make[1]: *** [/root/kernel_xiaomi_sm8350-miui/Makefile:1809:modules] 错误 2
make: *** [../Makefile:190:sub-make] 错误 2
make: 离开目录“/root/kernel_xiaomi_sm8350-miui/out”
请问这怎么搞
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.