Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerL-Y committed Aug 25, 2024
1 parent 10b9958 commit b568cab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ func (fuzzer *Fuzzer) updateChoiceTableWithLLM(programs []*prog.Prog) {
if fuzzer.ctLLMReady {
// TODO llm: add target function to syscall analyze here
var llmFedSyscallNames []string
fuzzer.Logf(0, "UpdateChoiceTable using LLM comm content")
data, err := os.ReadFile(fuzzer.llm_comm_content_file)
if err != nil {
fmt.Println("Error reading file:", err)
}
syscall_lines := strings.Split(string(data), "\n")

for _, llm_syscall := range syscall_lines {
if llm_syscall != "" {
llmFedSyscallNames = append(llmFedSyscallNames, llm_syscall)
Expand Down Expand Up @@ -407,6 +408,7 @@ func (fuzzer *Fuzzer) ChoiceTable() *prog.ChoiceTable {
}
str_content := string(comm_content)
if strings.Contains(str_content, "1") {
fuzzer.Logf(0, "Set LLM enabled")
fuzzer.ctLLMReady = true
}
}
Expand Down
5 changes: 3 additions & 2 deletions scripts/process_close_cov_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

close_addr2funcname_and_filepath = dict()

project_root = "/home/clexma/Desktop/fox3/fuzzing/"
def parse_func2addr_info():
func2addr_info_path = "../linuxRepo/line2addr/func2addr_info.txt"
func2addr_info_path = project_root + "linuxRepo/line2addr/func2addr_info.txt"
curr_func_name = ""
curr_file_path = ""
addr_info_file = open(func2addr_info_path, "r+")
Expand Down Expand Up @@ -38,7 +39,7 @@ def parse_func2addr_info():


def collect_close_cov_info():
close_cov_raw_files = open("./close_cov_result.txt")
close_cov_raw_files = open( project_root + "syzkaller/close_cov_result.txt")
# 1 for call sequence, 2 for args and 3 for close points
collecting_mode = -1
call_sequence = []
Expand Down
2 changes: 1 addition & 1 deletion scripts/process_cov_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
stripped_call_sequence = call_sequence.replace("\n", "").strip()
stripped_arg_sequence = arg_sequence.replace("\n", "").strip()
stripped_addresses_input = addresses_input.replace("\n", "").strip()
if stripped_addresses_input != "" or stripped_arg_sequence != "" or stripped_call_sequence != "":
if (stripped_addresses_input != "" or stripped_arg_sequence != "" or stripped_call_sequence != "") and contain_close_points:
final_write_result = "----- call sequence\n" + call_sequence +\
"----- arg sequence\n" + arg_sequence +\
"----- close points covered\n" + addresses_input
Expand Down

0 comments on commit b568cab

Please sign in to comment.