We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1421a6a + a0e761c commit e9329a8Copy full SHA for e9329a8
lab5/antiasan.c
@@ -1,6 +1,11 @@
1
-#include <string.h>
2
-
3
-void antiasan(unsigned long addr)
4
-{
+#include <stdint.h>
5
+void antiasan(unsigned long addr) {
+ unsigned long gBadBuf = addr;
+ 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
+ }
11
}
0 commit comments