1 #include <stdio.h> 2 target_func(unsigned char * buf,int size)3int 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()30int main() { 31 32 target_func(data, 1024); 33 34 } 35 36