Some new really cool results of my coding session:
Code: Select all
ptrEntry= (struct slabEntry_t *)(kernelArgs->kernelMemEnd + 0x1000 - sizeof(struct slabEntry_t));
ptrEntry->prev= 0;
ptrEntry->next= 0;
printf("partial: %#08X, free: %#08X, entry: %#08X\n",slabDesc->partial,slabDesc->partial->free,ptrEntry);
ptrEntry->free= kernelArgs->kernelMemEnd;
printf("partial: %#08X, free: %#08X, entry: %#08X\n",slabDesc->partial,slabDesc->partial->free,ptrEntry);
ptrEntry->used= 0;
ptrEntry->base= kernelArgs->kernelMemEnd;
Result:
Code: Select all
partial: 0xC010BFEC, free: 0xC010B080, entry: 0xC010CFEC
partial: 0xC010BFEC, free: 0xC010C000, entry: 0XC010CFEC
So my question is, how can a pointer change something at which it doesn´t point? The thing is, that it could be a problem with gcc, because the value which changed is pointed by the old value in the pointer.
I will have a look at the assembly output of this code, but maybe I also don´t see something there.