int index = atoi(argv[1]); char val = buf[index]; /* Clean up memory so we don't leak */ free(buf); return val; } """) if __package__ is None or __package__ == "": from fuzzingbook_utils import print_file else: from .fuzzingbook_utils import print_file if __name__ == "__main__": print_file("program.c") if __name__ == "__main__": import os os.system('clang -fsanitize=address -g -o program program.c') if __name__ == "__main__": import os os.system('./program 99; echo $?') if __name__ == "__main__": import os os.system('./program 110') if __name__ == "__main__": import os
if __name__ == "__main__": f.write(inspect.getsource(my_sqrt)) f.write('\n') f.write(inspect.getsource(my_sqrt_with_type_annotations)) f.write('\n') f.write("print(my_sqrt_with_type_annotations('123'))\n") f.flush() if __package__ is None or __package__ == "": from fuzzingbook_utils import print_file else: from .fuzzingbook_utils import print_file if __name__ == "__main__": print_file(f.name) import subprocess if __name__ == "__main__": result = subprocess.run(["mypy", "--strict", f.name], universal_newlines=True, stdout=subprocess.PIPE) del f # Delete temporary file if __name__ == "__main__": print(result.stdout) # ## Mining Type Specifications if __name__ == "__main__":
return 1; } } """ if __name__ == "__main__": with open("cgi_decode.c", "w") as f: f.write(cgi_c_code) if __package__ is None or __package__ == "": from fuzzingbook_utils import print_file else: from .fuzzingbook_utils import print_file if __name__ == "__main__": print_file("cgi_decode.c") if __name__ == "__main__": import os os.system('cc --coverage -o cgi_decode cgi_decode.c') if __name__ == "__main__": import os os.system("./cgi_decode 'Send+mail+to+me%40fuzzingbook.org'") if __name__ == "__main__": import os os.system('gcov cgi_decode.c') if __name__ == "__main__": lines = open('cgi_decode.c.gcov').readlines()
tool = fuzzingbook """ % token if __name__ == "__main__": with open(conf, "w") as file: file.write(fuzzmanagerconf) from pygments.lexers.configs import IniLexer if __package__ is None or __package__ == "": from fuzzingbook_utils import print_file else: from .fuzzingbook_utils import print_file if __name__ == "__main__": print_file(conf, lexer=IniLexer()) # ### Starting the Server if __name__ == "__main__": print('\n### Starting the Server') from multiprocessing import Process import subprocess def run_fuzzmanager(): def run_fuzzmanager_forever(): proc = subprocess.Popen( ['python', 'FuzzManager/server/manage.py', 'runserver'],