xref: /aosp_15_r20/external/AFLplusplus/utils/qemu_persistent_hook/test.c (revision 08b48e0b10e97b33e7b60c5b6e2243bd915777f2)
1 #include <stdio.h>
2 
target_func(unsigned char * buf,int size)3 int target_func(unsigned char *buf, int size) {
4 
5   printf("buffer:%p, size:%d\n", buf, size);
6   switch (buf[0]) {
7 
8     case 1:
9       if (buf[1] == '\x44') { puts("a"); }
10       break;
11     case 0xff:
12       if (buf[2] == '\xff') {
13 
14         if (buf[1] == '\x44') { puts("b"); }
15 
16       }
17 
18       break;
19     default:
20       break;
21 
22   }
23 
24   return 1;
25 
26 }
27 
28 char data[1024];
29 
main()30 int main() {
31 
32   target_func(data, 1024);
33 
34 }
35 
36