forked from spinpx/afl_pin_mode
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mini.c
54 lines (43 loc) · 931 Bytes
/
mini.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "stdio.h"
#include "stdint.h"
#include "stdlib.h"
#include "string.h"
int main (int argc, char** argv) {
if (argc < 2) return 0;
FILE *fp;
char buf[255];
size_t ret;
fp = fopen(argv[1], "rb");
if (!fp) {
printf("st err\n");
return 0;
}
int len = 20;
//dfsan_read_label(&(len), sizeof *buf);
ret = fread(buf, sizeof *buf, len, fp);
fclose(fp);
if (ret < len) {
printf("input fail \n");
return 0;
}
uint16_t x = 0;
int32_t y = 0;
int32_t z = 0;
uint32_t a = 0;
memcpy(&x, buf + 1, 2); // x 0 - 1
memcpy(&y, buf + 4, 4); // y 4 - 7
memcpy(&z, buf + 10, 4); // 10 - 13
memcpy(&a, buf + 14, 4); // 14 - 17
if (x > 12300 &&
x < 12350 &&
z < -100000000 &&
z > -100000005 &&
z != -100000003 &&
y >= 987654321 &&
y <= 987654325 &&
a == 123456789) {
printf("hey, you hit it \n");
abort();
}
return 0;
}