You right, the code I study has add a wrong page offset.
So the pointer try to read invalid address memory = crash.
Removing this value and all work perfectly.
And yes, MEM_dump is my tool to dump memory in text, like this (HEX translate a char to hex value):
Code:
void MEM_dump(void * src, unsigned long bytes) { // Affiche une zone mémoire en HEXA
unsigned char * s = (unsigned char *) src;
char blanc = 0;
char col = 0;
printf("MEM_dump: %x %d\n", s, bytes);
for(register unsigned long i = 0; i < bytes; i++) {
printf("%s ", HEX(s[i]));
if (blanc == 3) {
blanc = 0;
if (col == 5) {
printf("\n");
col = 0;
} else {
printf(" ");
col++;
}
} else blanc++;
}
printf("\n");
}