We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 37b2829 + 90d1fc0 commit 20b2af5Copy full SHA for 20b2af5
1 file changed
lab5/antiasan.c
@@ -2,5 +2,11 @@
2
3
void antiasan(unsigned long addr)
4
{
5
-
+ // Calculate shadow memory address for gS (after gBadBuf)
6
+ unsigned long shadow_addr = ((addr + 0x87) >> 3) + 0x7fff8000;
7
+
8
+ // Mark 16 bytes of shadow memory as valid (covers gS[0x17] to gS[0x27])
9
+ for (int i = 0; i < 16; i++) {
10
+ *(char *)(shadow_addr + i) = 0;
11
+ }
12
}
0 commit comments