Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- script_extractor.c.orig 2015-09-20 14:11:25.896712635 +0200
- +++ script_extractor.c 2015-09-20 14:43:05.564760650 +0200
- @@ -34,13 +34,13 @@
- fd = open("/dev/mem", O_RDONLY);
- size = SCRIPT_SIZE;
- - if (argc)
- + if (argc > 1)
- size = atoi(argv[1]);
- addr = (char *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, SCRIPT_START);
- - for (i = 0; i < SCRIPT_SIZE; i++)
- + for (i = 0; i < size; i++)
- putchar(addr[i]);
- - munmap(NULL, SCRIPT_SIZE);
- + munmap(addr, size);
- close(fd);
- return 0;
- ----%----
- root@polaris-inet:/data/local/tmp # ./script_extractor $((0x10000)) > test.a
- root@polaris-inet:/data/local/tmp # ./script_extractor $((0x20000)) > test.b
- root@polaris-inet:/data/local/tmp # ./script_extractor > test.c
- root@polaris-inet:/data/local/tmp # ls -al test.?
- -rw-rw-rw- root root 65536 1970-01-02 17:34 test.a
- -rw-rw-rw- root root 131072 1970-01-02 17:34 test.b
- -rw-rw-rw- root root 131072 1970-01-02 17:34 test.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement