Skip to content

Commit e9329a8

Browse files
authored
Merge pull request #359 from mamie1031/lab5
[LAB5] 313581017
2 parents 1421a6a + a0e761c commit e9329a8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lab5/antiasan.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
#include <string.h>
2-
3-
void antiasan(unsigned long addr)
4-
{
1+
#include <stdint.h>
52

3+
void antiasan(unsigned long addr) {
4+
unsigned long gBadBuf = addr;
5+
unsigned long gS = gBadBuf + 0xC0;
6+
unsigned long shadow_base = 0x7fff8000; // ASAN shadow memory offset
7+
unsigned char *shadow_gS_end = (unsigned char *)((gS + sizeof(char) * 24) >> 3) + shadow_base;
8+
for (int i = 0; i < 5; i++) {
9+
shadow_gS_end[i] = 0;
10+
}
611
}

0 commit comments

Comments
 (0)