Commit 1f2f551
authored
fix: naming for fuzz target discovery (#24)
The naming method for the insertion file has changed from print1 to .bak.py, modified the find target method, and the way to find the function names for inserting print statements.
* Upload the python project Fuzz test script
valid_projects.txt: Python project list
script_fuzz_py_final.sh: Single project test script
script_fuzz_py_batch_final.sh: Batch projects test script
* feat: Add OSS-Fuzz submodule tracking main branch
* chore: Switch oss-fuzz submodule to personal fork
* Switch oss-fuzz submodule to personal fork
* move the valid_project file
* move the .py file
* create build_oss_fuzz.py
* create run_fuzz_target.py
* split the pool.py into build_oss_fuzz and run_fuzz_target
* delete the .sh files
* translate to english
* fuzz_runner_pool.py:74
* edit stdout
* 添加空值检查
* modify stdout, delete pool.py
* indentation level check
* Remove build log write files
* Remove build log write files
* use logging mdule
* use precise logging
* use logging
* use precise exception log info
* correct type problems
* correct some mistakes
* correct some mistakes
* correct
* modify discover fuzz target
* modify the oss-fuzz dir
* Redirect the output to an empty device without retaining any output
* add always yes
* split the build script
* split the build script
* build scripts test successfully
* build.py
* collect targets first and then run
* list, tuple, ptional
* list,tuple,optional
* translate
* build_fuzz.py, run_fuzz_all_target.py
* correct
* original
* record input
* Fatal error in main program: cannot unpack non-iterable NoneType object
* name 'target_functions' is not defined
fuzz_util_instrumented.py does not seem to exist
* 准备大改
* create modify file script add"print(data)" to each fuzz_.py
* build_fuzzer script
* modify tuple dict list
* remove stdout stderr in build fuzz
* test successfully
* rename run fuzz ds to run fuzz print1
* add print(data ) to fuzz target and rename the file with "_print1"
* oss -fuzz change
* rename the print1.py
* modify the exegesis
* modify
* modify log name
* type error
* list dict tuple
* type error
* construct errors module
* run_command module
* combine the run_command instrument to one file
* remove the run_command
* modify
* mytype check
* mytype
* mytype
* mytype
* translate
* remove run command
* timeout - shell instrument
* correct in out error and return Popen directly
* ready to change from rust script
* 修改build_image
* y/n
* correct repo_id and repo_name in main
* test build_image 构建日志
* add build_fuzzer
* fuzz and testgen
* correct run_one_target
* fuzz ok
* transform
* testgen need to ^ help: add `;` here
* test successful
* example output project
* type error
* English ver
* delete privious scripts
* python template
* python template
* correct the template
* ver2 wrong template
* ok
* testgen file change into copy the original and then add input_data =b""
* only read b' ' inputs
* remove transform
* clean the inputs and testgen
* set max_file
* max input file
* input b""
* modify the method of writing files into PIPE
* use max total time; remove size monitor
* 修改并行错误, 写入方法还是直接写入文件 延时控制为max total time
* 补充日志输出
* 模板生成成功
* testgen完成
* 删除冗余, 修改代码
* 更换为未删除冗余版本
* template插入data=b""
函数header改为test_()
* translation
* A complete script for building the processes of build_image, build_fuzzer, fuzz, transform, and testgen, suitable for Python projects.
* delete some imports
* use ASTfor transform and testgen
* use AST
* Set up command line arguments
* use fire
* use FIre
* black formatter
* deal the data after closing the file
* when doing line-matching, check for # This is a test template in the line
* when doing line-matching, check for # This is a test template in the line
* delete UnicodeDecodeError
* apply transformations on the original unmodified fuzz targets.
* put all AST related class/module/function in another file and import from there.
* put all AST related class/module/function in another file and import from there.
* translation
* use relative address
* use relative address
* remove the class outside of the function
* add tuple's type
* Properly handle indentation and process data after the file is closed.
* correct tne relative path
* add black to requirements.txt
* 修改添加print()的命名方式, 函数匹配选择识别atheris.Setup()的第二个参数,目前还不准确
* 此脚本会读取 data/valid_projects.txt中的项目列表
对于每个项目,在 fuzz/oss-fuzz/projects目录中查找对应项目文件夹
删除所有 _print1.py和 .bak.py结尾的文件
处理剩余的 .py文件:
创建备份文件(.bak.py)
查找 atheris.Setup()语句并提取第二个参数(函数签名)
在该函数中添加 print(data)语句
保持原文件名不变
* correct the source file name as .bak.py
* 寻找fuzz target 排除了一些常见的工具列表
* 添加了符合条件的python项目名单(有Dockerfile, .yaml language = python, build.sh, 有.py 文件)
* black format1 parent dc8785c commit 1f2f551
File tree
4 files changed
+163
-63
lines changed- data
- fuzz
4 files changed
+163
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
| |||
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | | - | |
102 | 106 | | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| |||
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| 151 | + | |
145 | 152 | | |
146 | 153 | | |
147 | 154 | | |
| |||
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| 210 | + | |
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| |||
208 | 216 | | |
209 | 217 | | |
210 | 218 | | |
| 219 | + | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
| |||
220 | 229 | | |
221 | 230 | | |
222 | 231 | | |
| 232 | + | |
223 | 233 | | |
224 | 234 | | |
225 | 235 | | |
| |||
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
| 243 | + | |
233 | 244 | | |
234 | 245 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
105 | 130 | | |
106 | 131 | | |
107 | 132 | | |
108 | 133 | | |
109 | | - | |
110 | 134 | | |
111 | | - | |
112 | 135 | | |
| 136 | + | |
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
| |||
222 | 246 | | |
223 | 247 | | |
224 | 248 | | |
225 | | - | |
| 249 | + | |
226 | 250 | | |
227 | 251 | | |
228 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | | - | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
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 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
43 | 13 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 14 | + | |
| 15 | + | |
51 | 16 | | |
52 | 17 | | |
53 | | - | |
54 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
55 | 22 | | |
56 | 23 | | |
57 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
58 | 28 | | |
59 | | - | |
| 29 | + | |
60 | 30 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
67 | 133 | | |
68 | | - | |
69 | | - | |
70 | 134 | | |
71 | 135 | | |
72 | | - | |
| 136 | + | |
| 137 | + | |
0 commit comments