All pastes #728365 Raw Edit

Untitled

public c v1 · immutable
·published 2007-10-06 22:19 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <fcntl.h>//unsigned char ORIG[] = "1";//unsigned char PATCH[] = "0";unsigned char b=0;int main(int argc, char **argv) {        int mem;        char data[4];        int i;        mem = open("/dev/kmem", O_RDWR);        if (mem<0) {                printf("Oops !\n");                return 0;        }        if (lseek(mem, (off_t)0xC01C412C, SEEK_SET) != 0xC01C412C) {                perror("lseek");                return 1;        }        if (read(mem, data, 4) == 1) {                perror("read");                printf("secure_kern:  %.2x ", data[i]);        }        printf("\n");        printf("Data match :  %d %d %d %d \n",data[0],data[1],data[2],data[3]);        //exit(1);        lseek(mem, (off_t)0xC01C412C, SEEK_SET);        if (write(mem, &b, 4) == 1) {                perror("write");                return 1;        }        close(mem);        return 1;}