Skip to content

Commit 20b2af5

Browse files
authored
Merge pull request #366 from yungen-lu/lab5
[LAB5] 313551077
2 parents 37b2829 + 90d1fc0 commit 20b2af5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lab5/antiasan.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22

33
void antiasan(unsigned long addr)
44
{
5-
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+
}
612
}

0 commit comments

Comments
 (0)