diff --git a/pt/pt.h b/pt/pt.h index 82dcf5c..481be72 100644 --- a/pt/pt.h +++ b/pt/pt.h @@ -500,10 +500,12 @@ class pt_fuzzer { }; class fuzzer_config { +public: uint64_t perf_aux_size = DEFAULT_PERF_AUX_SZ; branch_info_mode_t branch_mode = TNT_MODE; public: - fuzzer_config(); + fuzzer_config() {load_config();} +protected: void load_config(); }; fuzzer_config& get_fuzzer_config(); diff --git a/pt/pt_decoder.cpp b/pt/pt_decoder.cpp index eebfa9b..2a5db9d 100644 --- a/pt/pt_decoder.cpp +++ b/pt/pt_decoder.cpp @@ -92,7 +92,7 @@ void load_config_file(std::map& config_kvs) { } void fuzzer_config::load_config() { - std::map& config_kvs; + std::map config_kvs; load_config_file(config_kvs); std::string branch_mode = config_kvs["BRANCH_MODE"]; @@ -133,7 +133,6 @@ void fuzzer_config::load_config() { fuzzer_config& get_fuzzer_config() { static fuzzer_config config; - config.load_config(); return config; } diff --git a/ptfuzzer.py b/ptfuzzer.py index 76df5ba..0ad4345 100755 --- a/ptfuzzer.py +++ b/ptfuzzer.py @@ -16,8 +16,9 @@ def load_config(): if f != None: for line in f.readlines(): pos = line.find('#') - print "pos = ", pos - line = line[0, pos] + #print "pos = ", pos + line = line[0:pos] + #print line line.strip() if len(line) == 0: continue @@ -34,6 +35,7 @@ def load_config(): mem_limit = None if conf.has_key("MEM_LIMIT"): mem_limit = int(conf["MEM_LIMIT"]) + print "config MEM_LIMIT to", mem_limit parser = argparse.ArgumentParser(description='Process arguements and bin name.') parser.add_argument('afl_args', type=str, help='arguements of AFL')