Skip to content

Commit 48de44b

Browse files
Lab5: 完成 antiasan 解毒 redzone 實作
1 parent c32547b commit 48de44b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lab5/antiasan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
#include <string.h>
1+
// antiasan.c
2+
#include "antiasan.h"
3+
#include <sanitizer/asan_interface.h>
24

35
void antiasan(unsigned long addr)
46
{
7+
void *start = (void*)(addr - 0x20);
8+
size_t len = 0x200; // 解毒 0x200 bytes(512 bytes),足夠覆蓋所有紅區
59

10+
__asan_unpoison_memory_region(start, len);
611
}

0 commit comments

Comments
 (0)