Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <sys/mman.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <string.h>
- char *name = "libstlport.so";
- int main( void )
- {
- int fildes = open( name, O_RDWR );
- int size = 223260;
- void *map_address = mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fildes, 0);
- char ehdr[52] = { 0 };
- printf("map_addr %08X\n", map_address );
- memcpy (map_address + 0, ehdr, sizeof (ehdr));
- return 0;
- }
- /*
- > gcc test.c
- > ./a.out
- map_addr B7E68000
- Bus error
- >
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement