From e4acc0c47caadd24ea7f586036a087fb91d33c73 Mon Sep 17 00:00:00 2001 From: ElNiak Date: Mon, 3 Jun 2024 23:48:21 +0200 Subject: [PATCH] add doc starting bloc --- .github/dependabot.yml | 23 + .../workflows/.pre-commit-config.yaml | 0 .github/workflows/pr-generate-docs.yaml | 28 + Makefile | 7 + README.md | 1 + doc/generate_doc.py | 119 +++ doc/mkgendocs.yaml | 861 ++++++++++++++++++ docs/sources/index.md | 73 ++ .../application/ClassifierApp.md | 37 + .../application/SemaClassifier.md | 8 + .../sema_scdg/application/SCDGApp.md | 37 + .../sema_scdg/application/SemaSCDG.md | 42 + .../windows/custom_package/MapViewOfFile.md | 25 + .../windows/custom_package/VirtualAlloc.md | 25 + .../windows/custom_package/VirtualAllocEx.md | 23 + .../sema_scdg/application/sandboxes/main.md | 10 + .../application/sandboxes/vm/kvm/main.md | 10 + .../sema_scdg/application/scdg_tests.md | 11 + .../sema_web_app/application/SemaServer.md | 8 + mkdocs.yaml | 26 + requirements.txt | 6 + 21 files changed, 1380 insertions(+) create mode 100644 .github/dependabot.yml rename .pre-commit-config.yaml => .github/workflows/.pre-commit-config.yaml (100%) create mode 100644 .github/workflows/pr-generate-docs.yaml create mode 100644 Makefile create mode 100644 doc/generate_doc.py create mode 100644 doc/mkgendocs.yaml create mode 100644 docs/sources/index.md create mode 100644 docs/sources/sema-toolchain/sema_classifier/application/ClassifierApp.md create mode 100644 docs/sources/sema-toolchain/sema_classifier/application/SemaClassifier.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/SCDGApp.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/SemaSCDG.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/sandboxes/main.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.md create mode 100644 docs/sources/sema-toolchain/sema_scdg/application/scdg_tests.md create mode 100644 docs/sources/sema-toolchain/sema_web_app/application/SemaServer.md create mode 100644 mkdocs.yaml create mode 100644 requirements.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..dd347eab1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "sema-toolchain/sema_scdg/requirement.txt" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "docker" # See documentation for possible values + directory: "sema-toolchain/sema_scdg/Dockerfile." # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "pip" # See documentation for possible values + directory: "sema-toolchain/sema_classifier/requirement.txt" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "docker" # See documentation for possible values + directory: "sema-toolchain/sema_classifier/Dockerfile." # Location of package manifests + schedule: + interval: "weekly" diff --git a/.pre-commit-config.yaml b/.github/workflows/.pre-commit-config.yaml similarity index 100% rename from .pre-commit-config.yaml rename to .github/workflows/.pre-commit-config.yaml diff --git a/.github/workflows/pr-generate-docs.yaml b/.github/workflows/pr-generate-docs.yaml new file mode 100644 index 000000000..2b9464d93 --- /dev/null +++ b/.github/workflows/pr-generate-docs.yaml @@ -0,0 +1,28 @@ +name: Documentation Generation +on: + pull_request: + branches: + - "production" + paths: + - "**.py" + +permissions: + contents: write + +jobs: + doc-generation: + name: Documentation Generation + runs-on: "ubuntu-latest" + steps: + - name: "Checkout code" + uses: "actions/checkout@v3" + - name: "Generate docs" + run: | + pip install -r requirements.txt + make gen-docs + mkdocs gh-deploy --force --clean + mv sources docs + - name: "Commit generated documentation" + uses: "stefanzweifel/git-auto-commit-action@v4" + with: + commit_message: "Updating documentation" diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..04d54e71e --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +gen-docs: + python3 ./doc/generate_doc.py + gendocs --config doc/mkgendocs.yaml + +mkdocs: + make gen-docs + mkdocs serve \ No newline at end of file diff --git a/README.md b/README.md index 0a23145fc..d390349de 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ ``` +[![Documentation Built by gendocs](https://img.shields.io/badge/docs%20by-gendocs-blue.svg)](https://gendocs.readthedocs.io/en/latest/) ### Toolchain architecture diff --git a/doc/generate_doc.py b/doc/generate_doc.py new file mode 100644 index 000000000..5d63e1740 --- /dev/null +++ b/doc/generate_doc.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +"""Generate mkgendocs.yaml from python files by iterating over files and functions.""" + +import os + +import yaml +import re + + +def get_mkgendocs_config(): + """ + Get the mkgendocs configuration file. + + Raises: + FileNotFoundError: If mkgendocs.yaml is not found + YAMLError: If there is an error parsing mkgendocs.yaml + + Returns: + mkgendocs configuration + + """ + try: + with open("doc/mkgendocs.yaml", encoding="UTF-8") as mkgendocs_config: + return yaml.safe_load(mkgendocs_config) + except FileNotFoundError as error_message: + print("mkgendocs.yaml not found") + raise FileNotFoundError from error_message + except yaml.YAMLError as error_message: + raise yaml.YAMLError() from error_message + + +# Function to get a list of python files in a directory +def get_python_files(directory): + """ + Get a list of python files in a directory. + + Args: + directory: Directory to search + + Returns: + List of python files + """ + python_files = [] + for root, dirs, files in os.walk(directory): + for file in files: + if file.endswith(".py") and ( + not root.startswith("./tests") + and not file.startswith("_") + and not root.startswith("./build") + ): + python_files.append(os.path.join(root, file)) + return python_files + + +def get_file_functions(filename): + """ + Get the functions in a file. + + Args: + filename: The name of the file to parse for functions. + + Returns: + List of functions + + """ + if "ivy" in filename: + print("No ivy documentation generated") + return [] + if "submodules" in filename: + print("No submodules documentation generated") + return [] + with open(filename, encoding="UTF-8") as file: + content = file.read() + if "print " in content: + print(f"Python 2 {filename} skipping") + return [] + with open(filename, encoding="UTF-8") as file: + lines = file.readlines() + functions = [] + # TODO fix + # for line in lines: + # if re.match(r"^\s*def\s+\w+\s*\(", line): + # function_name = re.search(r"def\s+(\w+)\s*\(", line).group(1) + # functions.append(function_name) + for line in lines: + if line.startswith("def"): + functions.append(line.split(" ")[1].split("(")[0]) + return functions + +def main(): + """Generate configuration for mkgendocs to build documentation.""" + print("Starting doc generation") + mkgendocs_config = get_mkgendocs_config() + new_pages = [] + + print("Getting a list of functions in python files..") + python_files = get_python_files(".") + for python_file in python_files: + functions = get_file_functions(python_file) + if len(functions) > 0: + print("Functions found, adding " + python_file) + new_pages.append( + { + "page": python_file.replace(".py", ".md").replace("./", ""), + "source": python_file, + "functions": functions, + } + ) + else: + print("No functions found, skipping " + python_file) + + mkgendocs_config["pages"] = new_pages + + with open("doc/mkgendocs.yaml", "w", encoding="UTF-8") as mkgendocs_config_file: + yaml.dump(mkgendocs_config, mkgendocs_config_file) + + +if __name__ == "__main__": + main() diff --git a/doc/mkgendocs.yaml b/doc/mkgendocs.yaml new file mode 100644 index 000000000..218def5f3 --- /dev/null +++ b/doc/mkgendocs.yaml @@ -0,0 +1,861 @@ +pages: +- functions: + - main + page: sema-toolchain/sema_classifier/application/SemaClassifier.md + source: ./sema-toolchain/sema_classifier/application/SemaClassifier.py +- functions: + - run_classifier + - get_args_request + - parse_class_args + - get_args + page: sema-toolchain/sema_classifier/application/ClassifierApp.md + source: ./sema-toolchain/sema_classifier/application/ClassifierApp.py +- functions: + - run_scdg + - get_args_request + - parse_json_request + - get_args + page: sema-toolchain/sema_scdg/application/SCDGApp.md + source: ./sema-toolchain/sema_scdg/application/SCDGApp.py +- functions: + - __handle_exception + - __process_folder + - start_scdg + page: sema-toolchain/sema_scdg/application/SemaSCDG.md + source: ./sema-toolchain/sema_scdg/application/SemaSCDG.py +- functions: + - compare_graphs + page: sema-toolchain/sema_scdg/application/scdg_tests.md + source: ./sema-toolchain/sema_scdg/application/scdg_tests.py +- functions: + - convert_prot + - deconvert_prot + page: sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.md + source: ./sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.py +- functions: + - convert_prot + - deconvert_prot + page: sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.md + source: ./sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.py +- functions: + - convert_prot + - deconvert_prot + page: sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.md + source: ./sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.py +- functions: + - main + page: sema-toolchain/sema_scdg/application/sandboxes/main.md + source: ./sema-toolchain/sema_scdg/application/sandboxes/main.py +- functions: + - main + page: sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.md + source: ./sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.py +- functions: + - main + page: sema-toolchain/sema_web_app/application/SemaServer.md + source: ./sema-toolchain/sema_web_app/application/SemaServer.py +- functions: + - Z3_set_error_handler + - Z3_solver_propagate_init + - Z3_solver_propagate_final + - Z3_solver_propagate_fixed + - Z3_solver_propagate_eq + - Z3_solver_propagate_diseq + - Z3_optimize_register_model_eh + - Z3_global_param_set + - Z3_global_param_reset_all + - Z3_global_param_get + - Z3_mk_config + - Z3_del_config + - Z3_set_param_value + - Z3_mk_context + - Z3_mk_context_rc + - Z3_del_context + - Z3_inc_ref + - Z3_dec_ref + - Z3_update_param_value + - Z3_interrupt + - Z3_mk_params + - Z3_params_inc_ref + - Z3_params_dec_ref + - Z3_params_set_bool + - Z3_params_set_uint + - Z3_params_set_double + - Z3_params_set_symbol + - Z3_params_to_string + - Z3_params_to_string_bytes + - Z3_params_validate + - Z3_param_descrs_inc_ref + - Z3_param_descrs_dec_ref + - Z3_param_descrs_get_kind + - Z3_param_descrs_size + - Z3_param_descrs_get_name + - Z3_param_descrs_get_documentation + - Z3_param_descrs_get_documentation_bytes + - Z3_param_descrs_to_string + - Z3_param_descrs_to_string_bytes + - Z3_mk_int_symbol + - Z3_mk_string_symbol + - Z3_mk_uninterpreted_sort + - Z3_mk_bool_sort + - Z3_mk_int_sort + - Z3_mk_real_sort + - Z3_mk_bv_sort + - Z3_mk_finite_domain_sort + - Z3_mk_array_sort + - Z3_mk_array_sort_n + - Z3_mk_tuple_sort + - Z3_mk_enumeration_sort + - Z3_mk_list_sort + - Z3_mk_constructor + - Z3_del_constructor + - Z3_mk_datatype + - Z3_mk_constructor_list + - Z3_del_constructor_list + - Z3_mk_datatypes + - Z3_query_constructor + - Z3_mk_func_decl + - Z3_mk_app + - Z3_mk_const + - Z3_mk_fresh_func_decl + - Z3_mk_fresh_const + - Z3_mk_rec_func_decl + - Z3_add_rec_def + - Z3_mk_true + - Z3_mk_false + - Z3_mk_eq + - Z3_mk_distinct + - Z3_mk_not + - Z3_mk_ite + - Z3_mk_iff + - Z3_mk_implies + - Z3_mk_xor + - Z3_mk_and + - Z3_mk_or + - Z3_mk_add + - Z3_mk_mul + - Z3_mk_sub + - Z3_mk_unary_minus + - Z3_mk_div + - Z3_mk_mod + - Z3_mk_rem + - Z3_mk_power + - Z3_mk_lt + - Z3_mk_le + - Z3_mk_gt + - Z3_mk_ge + - Z3_mk_divides + - Z3_mk_int2real + - Z3_mk_real2int + - Z3_mk_is_int + - Z3_mk_bvnot + - Z3_mk_bvredand + - Z3_mk_bvredor + - Z3_mk_bvand + - Z3_mk_bvor + - Z3_mk_bvxor + - Z3_mk_bvnand + - Z3_mk_bvnor + - Z3_mk_bvxnor + - Z3_mk_bvneg + - Z3_mk_bvadd + - Z3_mk_bvsub + - Z3_mk_bvmul + - Z3_mk_bvudiv + - Z3_mk_bvsdiv + - Z3_mk_bvurem + - Z3_mk_bvsrem + - Z3_mk_bvsmod + - Z3_mk_bvult + - Z3_mk_bvslt + - Z3_mk_bvule + - Z3_mk_bvsle + - Z3_mk_bvuge + - Z3_mk_bvsge + - Z3_mk_bvugt + - Z3_mk_bvsgt + - Z3_mk_concat + - Z3_mk_extract + - Z3_mk_sign_ext + - Z3_mk_zero_ext + - Z3_mk_repeat + - Z3_mk_bvshl + - Z3_mk_bvlshr + - Z3_mk_bvashr + - Z3_mk_rotate_left + - Z3_mk_rotate_right + - Z3_mk_ext_rotate_left + - Z3_mk_ext_rotate_right + - Z3_mk_int2bv + - Z3_mk_bv2int + - Z3_mk_bvadd_no_overflow + - Z3_mk_bvadd_no_underflow + - Z3_mk_bvsub_no_overflow + - Z3_mk_bvsub_no_underflow + - Z3_mk_bvsdiv_no_overflow + - Z3_mk_bvneg_no_overflow + - Z3_mk_bvmul_no_overflow + - Z3_mk_bvmul_no_underflow + - Z3_mk_select + - Z3_mk_select_n + - Z3_mk_store + - Z3_mk_store_n + - Z3_mk_const_array + - Z3_mk_map + - Z3_mk_array_default + - Z3_mk_as_array + - Z3_mk_set_has_size + - Z3_mk_set_sort + - Z3_mk_empty_set + - Z3_mk_full_set + - Z3_mk_set_add + - Z3_mk_set_del + - Z3_mk_set_union + - Z3_mk_set_intersect + - Z3_mk_set_difference + - Z3_mk_set_complement + - Z3_mk_set_member + - Z3_mk_set_subset + - Z3_mk_array_ext + - Z3_mk_numeral + - Z3_mk_real + - Z3_mk_int + - Z3_mk_unsigned_int + - Z3_mk_int64 + - Z3_mk_unsigned_int64 + - Z3_mk_bv_numeral + - Z3_mk_seq_sort + - Z3_is_seq_sort + - Z3_get_seq_sort_basis + - Z3_mk_re_sort + - Z3_is_re_sort + - Z3_get_re_sort_basis + - Z3_mk_string_sort + - Z3_mk_char_sort + - Z3_is_string_sort + - Z3_is_char_sort + - Z3_mk_string + - Z3_mk_lstring + - Z3_mk_u32string + - Z3_is_string + - Z3_get_string + - Z3_get_string_bytes + - Z3_get_lstring + - Z3_get_string_length + - Z3_get_string_contents + - Z3_mk_seq_empty + - Z3_mk_seq_unit + - Z3_mk_seq_concat + - Z3_mk_seq_prefix + - Z3_mk_seq_suffix + - Z3_mk_seq_contains + - Z3_mk_str_lt + - Z3_mk_str_le + - Z3_mk_seq_extract + - Z3_mk_seq_replace + - Z3_mk_seq_at + - Z3_mk_seq_nth + - Z3_mk_seq_length + - Z3_mk_seq_index + - Z3_mk_seq_last_index + - Z3_mk_str_to_int + - Z3_mk_int_to_str + - Z3_mk_string_to_code + - Z3_mk_string_from_code + - Z3_mk_ubv_to_str + - Z3_mk_sbv_to_str + - Z3_mk_seq_to_re + - Z3_mk_seq_in_re + - Z3_mk_re_plus + - Z3_mk_re_star + - Z3_mk_re_option + - Z3_mk_re_union + - Z3_mk_re_concat + - Z3_mk_re_range + - Z3_mk_re_allchar + - Z3_mk_re_loop + - Z3_mk_re_power + - Z3_mk_re_intersect + - Z3_mk_re_complement + - Z3_mk_re_diff + - Z3_mk_re_empty + - Z3_mk_re_full + - Z3_mk_char + - Z3_mk_char_le + - Z3_mk_char_to_int + - Z3_mk_char_to_bv + - Z3_mk_char_from_bv + - Z3_mk_char_is_digit + - Z3_mk_linear_order + - Z3_mk_partial_order + - Z3_mk_piecewise_linear_order + - Z3_mk_tree_order + - Z3_mk_transitive_closure + - Z3_mk_pattern + - Z3_mk_bound + - Z3_mk_forall + - Z3_mk_exists + - Z3_mk_quantifier + - Z3_mk_quantifier_ex + - Z3_mk_forall_const + - Z3_mk_exists_const + - Z3_mk_quantifier_const + - Z3_mk_quantifier_const_ex + - Z3_mk_lambda + - Z3_mk_lambda_const + - Z3_get_symbol_kind + - Z3_get_symbol_int + - Z3_get_symbol_string + - Z3_get_symbol_string_bytes + - Z3_get_sort_name + - Z3_get_sort_id + - Z3_sort_to_ast + - Z3_is_eq_sort + - Z3_get_sort_kind + - Z3_get_bv_sort_size + - Z3_get_finite_domain_sort_size + - Z3_get_array_sort_domain + - Z3_get_array_sort_domain_n + - Z3_get_array_sort_range + - Z3_get_tuple_sort_mk_decl + - Z3_get_tuple_sort_num_fields + - Z3_get_tuple_sort_field_decl + - Z3_get_datatype_sort_num_constructors + - Z3_get_datatype_sort_constructor + - Z3_get_datatype_sort_recognizer + - Z3_get_datatype_sort_constructor_accessor + - Z3_datatype_update_field + - Z3_get_relation_arity + - Z3_get_relation_column + - Z3_mk_atmost + - Z3_mk_atleast + - Z3_mk_pble + - Z3_mk_pbge + - Z3_mk_pbeq + - Z3_func_decl_to_ast + - Z3_is_eq_func_decl + - Z3_get_func_decl_id + - Z3_get_decl_name + - Z3_get_decl_kind + - Z3_get_domain_size + - Z3_get_arity + - Z3_get_domain + - Z3_get_range + - Z3_get_decl_num_parameters + - Z3_get_decl_parameter_kind + - Z3_get_decl_int_parameter + - Z3_get_decl_double_parameter + - Z3_get_decl_symbol_parameter + - Z3_get_decl_sort_parameter + - Z3_get_decl_ast_parameter + - Z3_get_decl_func_decl_parameter + - Z3_get_decl_rational_parameter + - Z3_get_decl_rational_parameter_bytes + - Z3_app_to_ast + - Z3_get_app_decl + - Z3_get_app_num_args + - Z3_get_app_arg + - Z3_is_eq_ast + - Z3_get_ast_id + - Z3_get_ast_hash + - Z3_get_sort + - Z3_is_well_sorted + - Z3_get_bool_value + - Z3_get_ast_kind + - Z3_is_app + - Z3_is_numeral_ast + - Z3_is_algebraic_number + - Z3_to_app + - Z3_to_func_decl + - Z3_get_numeral_string + - Z3_get_numeral_string_bytes + - Z3_get_numeral_binary_string + - Z3_get_numeral_binary_string_bytes + - Z3_get_numeral_decimal_string + - Z3_get_numeral_decimal_string_bytes + - Z3_get_numeral_double + - Z3_get_numerator + - Z3_get_denominator + - Z3_get_numeral_small + - Z3_get_numeral_int + - Z3_get_numeral_uint + - Z3_get_numeral_uint64 + - Z3_get_numeral_int64 + - Z3_get_numeral_rational_int64 + - Z3_get_algebraic_number_lower + - Z3_get_algebraic_number_upper + - Z3_pattern_to_ast + - Z3_get_pattern_num_terms + - Z3_get_pattern + - Z3_get_index_value + - Z3_is_quantifier_forall + - Z3_is_quantifier_exists + - Z3_is_lambda + - Z3_get_quantifier_weight + - Z3_get_quantifier_num_patterns + - Z3_get_quantifier_pattern_ast + - Z3_get_quantifier_num_no_patterns + - Z3_get_quantifier_no_pattern_ast + - Z3_get_quantifier_num_bound + - Z3_get_quantifier_bound_name + - Z3_get_quantifier_bound_sort + - Z3_get_quantifier_body + - Z3_simplify + - Z3_simplify_ex + - Z3_simplify_get_help + - Z3_simplify_get_help_bytes + - Z3_simplify_get_param_descrs + - Z3_update_term + - Z3_substitute + - Z3_substitute_vars + - Z3_translate + - Z3_mk_model + - Z3_model_inc_ref + - Z3_model_dec_ref + - Z3_model_eval + - Z3_model_get_const_interp + - Z3_model_has_interp + - Z3_model_get_func_interp + - Z3_model_get_num_consts + - Z3_model_get_const_decl + - Z3_model_get_num_funcs + - Z3_model_get_func_decl + - Z3_model_get_num_sorts + - Z3_model_get_sort + - Z3_model_get_sort_universe + - Z3_model_translate + - Z3_is_as_array + - Z3_get_as_array_func_decl + - Z3_add_func_interp + - Z3_add_const_interp + - Z3_func_interp_inc_ref + - Z3_func_interp_dec_ref + - Z3_func_interp_get_num_entries + - Z3_func_interp_get_entry + - Z3_func_interp_get_else + - Z3_func_interp_set_else + - Z3_func_interp_get_arity + - Z3_func_interp_add_entry + - Z3_func_entry_inc_ref + - Z3_func_entry_dec_ref + - Z3_func_entry_get_value + - Z3_func_entry_get_num_args + - Z3_func_entry_get_arg + - Z3_open_log + - Z3_append_log + - Z3_close_log + - Z3_toggle_warning_messages + - Z3_set_ast_print_mode + - Z3_ast_to_string + - Z3_ast_to_string_bytes + - Z3_pattern_to_string + - Z3_pattern_to_string_bytes + - Z3_sort_to_string + - Z3_sort_to_string_bytes + - Z3_func_decl_to_string + - Z3_func_decl_to_string_bytes + - Z3_model_to_string + - Z3_model_to_string_bytes + - Z3_benchmark_to_smtlib_string + - Z3_benchmark_to_smtlib_string_bytes + - Z3_parse_smtlib2_string + - Z3_parse_smtlib2_file + - Z3_eval_smtlib2_string + - Z3_eval_smtlib2_string_bytes + - Z3_get_error_code + - Z3_set_error + - Z3_get_error_msg + - Z3_get_error_msg_bytes + - Z3_get_version + - Z3_get_full_version + - Z3_get_full_version_bytes + - Z3_enable_trace + - Z3_disable_trace + - Z3_reset_memory + - Z3_finalize_memory + - Z3_mk_goal + - Z3_goal_inc_ref + - Z3_goal_dec_ref + - Z3_goal_precision + - Z3_goal_assert + - Z3_goal_inconsistent + - Z3_goal_depth + - Z3_goal_reset + - Z3_goal_size + - Z3_goal_formula + - Z3_goal_num_exprs + - Z3_goal_is_decided_sat + - Z3_goal_is_decided_unsat + - Z3_goal_translate + - Z3_goal_convert_model + - Z3_goal_to_string + - Z3_goal_to_string_bytes + - Z3_goal_to_dimacs_string + - Z3_goal_to_dimacs_string_bytes + - Z3_mk_tactic + - Z3_tactic_inc_ref + - Z3_tactic_dec_ref + - Z3_mk_probe + - Z3_probe_inc_ref + - Z3_probe_dec_ref + - Z3_tactic_and_then + - Z3_tactic_or_else + - Z3_tactic_par_or + - Z3_tactic_par_and_then + - Z3_tactic_try_for + - Z3_tactic_when + - Z3_tactic_cond + - Z3_tactic_repeat + - Z3_tactic_skip + - Z3_tactic_fail + - Z3_tactic_fail_if + - Z3_tactic_fail_if_not_decided + - Z3_tactic_using_params + - Z3_probe_const + - Z3_probe_lt + - Z3_probe_gt + - Z3_probe_le + - Z3_probe_ge + - Z3_probe_eq + - Z3_probe_and + - Z3_probe_or + - Z3_probe_not + - Z3_get_num_tactics + - Z3_get_tactic_name + - Z3_get_tactic_name_bytes + - Z3_get_num_probes + - Z3_get_probe_name + - Z3_get_probe_name_bytes + - Z3_tactic_get_help + - Z3_tactic_get_help_bytes + - Z3_tactic_get_param_descrs + - Z3_tactic_get_descr + - Z3_tactic_get_descr_bytes + - Z3_probe_get_descr + - Z3_probe_get_descr_bytes + - Z3_probe_apply + - Z3_tactic_apply + - Z3_tactic_apply_ex + - Z3_apply_result_inc_ref + - Z3_apply_result_dec_ref + - Z3_apply_result_to_string + - Z3_apply_result_to_string_bytes + - Z3_apply_result_get_num_subgoals + - Z3_apply_result_get_subgoal + - Z3_mk_solver + - Z3_mk_simple_solver + - Z3_mk_solver_for_logic + - Z3_mk_solver_from_tactic + - Z3_solver_translate + - Z3_solver_import_model_converter + - Z3_solver_get_help + - Z3_solver_get_help_bytes + - Z3_solver_get_param_descrs + - Z3_solver_set_params + - Z3_solver_inc_ref + - Z3_solver_dec_ref + - Z3_solver_interrupt + - Z3_solver_push + - Z3_solver_pop + - Z3_solver_reset + - Z3_solver_get_num_scopes + - Z3_solver_assert + - Z3_solver_assert_and_track + - Z3_solver_from_file + - Z3_solver_from_string + - Z3_solver_get_assertions + - Z3_solver_get_units + - Z3_solver_get_trail + - Z3_solver_get_non_units + - Z3_solver_get_levels + - Z3_solver_propagate_declare + - Z3_solver_propagate_register + - Z3_solver_propagate_register_cb + - Z3_solver_propagate_consequence + - Z3_solver_check + - Z3_solver_check_assumptions + - Z3_get_implied_equalities + - Z3_solver_get_consequences + - Z3_solver_cube + - Z3_solver_get_model + - Z3_solver_get_proof + - Z3_solver_get_unsat_core + - Z3_solver_get_reason_unknown + - Z3_solver_get_reason_unknown_bytes + - Z3_solver_get_statistics + - Z3_solver_to_string + - Z3_solver_to_string_bytes + - Z3_solver_to_dimacs_string + - Z3_solver_to_dimacs_string_bytes + - Z3_stats_to_string + - Z3_stats_to_string_bytes + - Z3_stats_inc_ref + - Z3_stats_dec_ref + - Z3_stats_size + - Z3_stats_get_key + - Z3_stats_get_key_bytes + - Z3_stats_is_uint + - Z3_stats_is_double + - Z3_stats_get_uint_value + - Z3_stats_get_double_value + - Z3_get_estimated_alloc_size + - Z3_mk_ast_vector + - Z3_ast_vector_inc_ref + - Z3_ast_vector_dec_ref + - Z3_ast_vector_size + - Z3_ast_vector_get + - Z3_ast_vector_set + - Z3_ast_vector_resize + - Z3_ast_vector_push + - Z3_ast_vector_translate + - Z3_ast_vector_to_string + - Z3_ast_vector_to_string_bytes + - Z3_mk_ast_map + - Z3_ast_map_inc_ref + - Z3_ast_map_dec_ref + - Z3_ast_map_contains + - Z3_ast_map_find + - Z3_ast_map_insert + - Z3_ast_map_erase + - Z3_ast_map_reset + - Z3_ast_map_size + - Z3_ast_map_keys + - Z3_ast_map_to_string + - Z3_ast_map_to_string_bytes + - Z3_algebraic_is_value + - Z3_algebraic_is_pos + - Z3_algebraic_is_neg + - Z3_algebraic_is_zero + - Z3_algebraic_sign + - Z3_algebraic_add + - Z3_algebraic_sub + - Z3_algebraic_mul + - Z3_algebraic_div + - Z3_algebraic_root + - Z3_algebraic_power + - Z3_algebraic_lt + - Z3_algebraic_gt + - Z3_algebraic_le + - Z3_algebraic_ge + - Z3_algebraic_eq + - Z3_algebraic_neq + - Z3_algebraic_roots + - Z3_algebraic_eval + - Z3_algebraic_get_poly + - Z3_algebraic_get_i + - Z3_polynomial_subresultants + - Z3_rcf_del + - Z3_rcf_mk_rational + - Z3_rcf_mk_small_int + - Z3_rcf_mk_pi + - Z3_rcf_mk_e + - Z3_rcf_mk_infinitesimal + - Z3_rcf_mk_roots + - Z3_rcf_add + - Z3_rcf_sub + - Z3_rcf_mul + - Z3_rcf_div + - Z3_rcf_neg + - Z3_rcf_inv + - Z3_rcf_power + - Z3_rcf_lt + - Z3_rcf_gt + - Z3_rcf_le + - Z3_rcf_ge + - Z3_rcf_eq + - Z3_rcf_neq + - Z3_rcf_num_to_string + - Z3_rcf_num_to_string_bytes + - Z3_rcf_num_to_decimal_string + - Z3_rcf_num_to_decimal_string_bytes + - Z3_rcf_get_numerator_denominator + - Z3_mk_fixedpoint + - Z3_fixedpoint_inc_ref + - Z3_fixedpoint_dec_ref + - Z3_fixedpoint_add_rule + - Z3_fixedpoint_add_fact + - Z3_fixedpoint_assert + - Z3_fixedpoint_query + - Z3_fixedpoint_query_relations + - Z3_fixedpoint_get_answer + - Z3_fixedpoint_get_reason_unknown + - Z3_fixedpoint_get_reason_unknown_bytes + - Z3_fixedpoint_update_rule + - Z3_fixedpoint_get_num_levels + - Z3_fixedpoint_get_cover_delta + - Z3_fixedpoint_add_cover + - Z3_fixedpoint_get_statistics + - Z3_fixedpoint_register_relation + - Z3_fixedpoint_set_predicate_representation + - Z3_fixedpoint_get_rules + - Z3_fixedpoint_get_assertions + - Z3_fixedpoint_set_params + - Z3_fixedpoint_get_help + - Z3_fixedpoint_get_help_bytes + - Z3_fixedpoint_get_param_descrs + - Z3_fixedpoint_to_string + - Z3_fixedpoint_to_string_bytes + - Z3_fixedpoint_from_string + - Z3_fixedpoint_from_file + - Z3_mk_optimize + - Z3_optimize_inc_ref + - Z3_optimize_dec_ref + - Z3_optimize_assert + - Z3_optimize_assert_and_track + - Z3_optimize_assert_soft + - Z3_optimize_maximize + - Z3_optimize_minimize + - Z3_optimize_push + - Z3_optimize_pop + - Z3_optimize_check + - Z3_optimize_get_reason_unknown + - Z3_optimize_get_reason_unknown_bytes + - Z3_optimize_get_model + - Z3_optimize_get_unsat_core + - Z3_optimize_set_params + - Z3_optimize_get_param_descrs + - Z3_optimize_get_lower + - Z3_optimize_get_upper + - Z3_optimize_get_lower_as_vector + - Z3_optimize_get_upper_as_vector + - Z3_optimize_to_string + - Z3_optimize_to_string_bytes + - Z3_optimize_from_string + - Z3_optimize_from_file + - Z3_optimize_get_help + - Z3_optimize_get_help_bytes + - Z3_optimize_get_statistics + - Z3_optimize_get_assertions + - Z3_optimize_get_objectives + - Z3_mk_fpa_rounding_mode_sort + - Z3_mk_fpa_round_nearest_ties_to_even + - Z3_mk_fpa_rne + - Z3_mk_fpa_round_nearest_ties_to_away + - Z3_mk_fpa_rna + - Z3_mk_fpa_round_toward_positive + - Z3_mk_fpa_rtp + - Z3_mk_fpa_round_toward_negative + - Z3_mk_fpa_rtn + - Z3_mk_fpa_round_toward_zero + - Z3_mk_fpa_rtz + - Z3_mk_fpa_sort + - Z3_mk_fpa_sort_half + - Z3_mk_fpa_sort_16 + - Z3_mk_fpa_sort_single + - Z3_mk_fpa_sort_32 + - Z3_mk_fpa_sort_double + - Z3_mk_fpa_sort_64 + - Z3_mk_fpa_sort_quadruple + - Z3_mk_fpa_sort_128 + - Z3_mk_fpa_nan + - Z3_mk_fpa_inf + - Z3_mk_fpa_zero + - Z3_mk_fpa_fp + - Z3_mk_fpa_numeral_float + - Z3_mk_fpa_numeral_double + - Z3_mk_fpa_numeral_int + - Z3_mk_fpa_numeral_int_uint + - Z3_mk_fpa_numeral_int64_uint64 + - Z3_mk_fpa_abs + - Z3_mk_fpa_neg + - Z3_mk_fpa_add + - Z3_mk_fpa_sub + - Z3_mk_fpa_mul + - Z3_mk_fpa_div + - Z3_mk_fpa_fma + - Z3_mk_fpa_sqrt + - Z3_mk_fpa_rem + - Z3_mk_fpa_round_to_integral + - Z3_mk_fpa_min + - Z3_mk_fpa_max + - Z3_mk_fpa_leq + - Z3_mk_fpa_lt + - Z3_mk_fpa_geq + - Z3_mk_fpa_gt + - Z3_mk_fpa_eq + - Z3_mk_fpa_is_normal + - Z3_mk_fpa_is_subnormal + - Z3_mk_fpa_is_zero + - Z3_mk_fpa_is_infinite + - Z3_mk_fpa_is_nan + - Z3_mk_fpa_is_negative + - Z3_mk_fpa_is_positive + - Z3_mk_fpa_to_fp_bv + - Z3_mk_fpa_to_fp_float + - Z3_mk_fpa_to_fp_real + - Z3_mk_fpa_to_fp_signed + - Z3_mk_fpa_to_fp_unsigned + - Z3_mk_fpa_to_ubv + - Z3_mk_fpa_to_sbv + - Z3_mk_fpa_to_real + - Z3_fpa_get_ebits + - Z3_fpa_get_sbits + - Z3_fpa_is_numeral_nan + - Z3_fpa_is_numeral_inf + - Z3_fpa_is_numeral_zero + - Z3_fpa_is_numeral_normal + - Z3_fpa_is_numeral_subnormal + - Z3_fpa_is_numeral_positive + - Z3_fpa_is_numeral_negative + - Z3_fpa_get_numeral_sign_bv + - Z3_fpa_get_numeral_significand_bv + - Z3_fpa_get_numeral_sign + - Z3_fpa_get_numeral_significand_string + - Z3_fpa_get_numeral_significand_string_bytes + - Z3_fpa_get_numeral_significand_uint64 + - Z3_fpa_get_numeral_exponent_string + - Z3_fpa_get_numeral_exponent_string_bytes + - Z3_fpa_get_numeral_exponent_int64 + - Z3_fpa_get_numeral_exponent_bv + - Z3_mk_fpa_to_ieee_bv + - Z3_mk_fpa_to_fp_int_real + - Z3_fixedpoint_query_from_lvl + - Z3_fixedpoint_get_ground_sat_answer + - Z3_fixedpoint_get_rules_along_trace + - Z3_fixedpoint_get_rule_names_along_trace + - Z3_fixedpoint_add_invariant + - Z3_fixedpoint_get_reachable + - Z3_qe_model_project + - Z3_qe_model_project_skolem + - Z3_model_extrapolate + - Z3_qe_lite + page: sema-toolchain/penv-fix/z3/z3core.md + source: ./sema-toolchain/penv-fix/z3/z3core.py +- functions: + - refine_locs_with_struct_type + - register_default_cc + - register_syscall_cc + page: sema-toolchain/penv-fix/angr/calling_conventions.md + source: ./sema-toolchain/penv-fix/angr/calling_conventions.py +- functions: + - _dict_merge + page: sema-toolchain/penv-fix/angr/stack_pointer_tracker.md + source: ./sema-toolchain/penv-fix/angr/stack_pointer_tracker.py +- functions: + - ppcg_dirtyhelper_MFTB + - ppc32g_dirtyhelper_MFSPR_287 + - amd64g_dirtyhelper_RDTSC + - amd64g_dirtyhelper_CPUID_baseline + - amd64g_create_mxcsr + - amd64g_dirtyhelper_XSAVE_COMPONENT_1_EXCLUDING_XMMREGS + - amd64g_check_ldmxcsr + - amd64g_dirtyhelper_XRSTOR_COMPONENT_1_EXCLUDING_XMMREGS + - CORRECT_amd64g_dirtyhelper_CPUID_avx_and_cx16 + - amd64g_dirtyhelper_IN + - amd64g_dirtyhelper_OUT + - amd64g_dirtyhelper_SxDT + - x86g_dirtyhelper_CPUID_sse0 + - x86g_dirtyhelper_CPUID_sse3 + - CORRECT_x86g_dirtyhelper_CPUID_sse2 + - x86g_dirtyhelper_IN + - x86g_dirtyhelper_OUT + - x86g_dirtyhelper_SxDT + - x86g_dirtyhelper_LGDT_LIDT + - x86g_dirtyhelper_FINIT + - x86g_dirtyhelper_write_cr0 + - x86g_dirtyhelper_loadF80le + - x86g_dirtyhelper_storeF80le + - x86g_dirtyhelper_RDMSR + - x86g_dirtyhelper_XGETBV + page: sema-toolchain/penv-fix/angr/dirty.md + source: ./sema-toolchain/penv-fix/angr/dirty.py diff --git a/docs/sources/index.md b/docs/sources/index.md new file mode 100644 index 000000000..d390349de --- /dev/null +++ b/docs/sources/index.md @@ -0,0 +1,73 @@ +# :skull_and_crossbones: SEMA :skull_and_crossbones: - ToolChain using Symbolic Execution for Malware Analysis. + +``` + ██████ ▓█████ ███▄ ▄███▓ ▄▄▄ +▒██ ▒ ▓█ ▀ ▓██▒▀█▀ ██▒▒████▄ +░ ▓██▄ ▒███ ▓██ ▓██░▒██ ▀█▄ + ▒ ██▒▒▓█ ▄ ▒██ ▒██ ░██▄▄▄▄██ +▒██████▒▒░▒████▒▒██▒ ░██▒ ▓█ ▓██▒ +▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ▒░ ░ ░ ▒▒ ▓▒█░ +░ ░▒ ░ ░ ░ ░ ░░ ░ ░ ▒ ▒▒ ░ +░ ░ ░ ░ ░ ░ ░ ▒ + ░ ░ ░ ░ ░ ░ + +``` + +[![Documentation Built by gendocs](https://img.shields.io/badge/docs%20by-gendocs-blue.svg)](https://gendocs.readthedocs.io/en/latest/) + +### Toolchain architecture + + +Our toolchain is represented in the following figure and works as follows: + +- A collection of labelled binaries from different malware families is collected and used as the input of the toolchain. +- **Angr**, a framework for symbolic execution, is used to execute binaries symbolically and extract execution traces. For this purpose, different heuristics have been developed to optimize symbolic execution. +- Several execution traces (i.e., API calls used and their arguments) corresponding to one binary are extracted with Angr and gathered together using several graph heuristics to construct a SCDG. +- These resulting SCDGs are then used as input to graph mining to extract common graphs between SCDGs of the same family and create a signature. +- Finally, when a new sample has to be classified, its SCDG is built and compared with SCDGs of known families using a simple similarity metric. + +![Toolchain Illustration](./doc/images/SEMA_illustration.png) + +This repository contains a first version of a SCDG extractor. During the symbolic analysis of a binary, all system calls and their arguments found are recorded. After some stop conditions for symbolic analysis, a graph is built as follows: Nodes are system calls recorded, edges show that some arguments are shared between calls. + +When a new sample has to be evaluated, its SCDG is first built as described previously. Then, `gspan` is applied to extract the biggest common subgraph and a similarity score is evaluated to decide if the graph is considered as part of the family or not. The similarity score `S` between graph `G'` and `G''` is computed as follows: +Since `G''` is a subgraph of `G'`, this is calculating how much `G'` appears in `G''`. +Another classifier we use is the Support Vector Machine (`SVM`) with INRIA graph kernel or the Weisfeiler-Lehman extension graph kernel. + +A web application is available and is called SemaWebApp. It allows to manage the launch of experiments on SemaSCDG and/or SemaClassifier. + +### Documentation + +* Complete README of the entire toolchain : ![Sema README](./doc/README.md) + +* SCDG README : ![SCDG README](./sema-toolchain/sema_scdg/README.md) + +* Classifier README : ![Classifier README](./sema-toolchain/sema_classifier/README.md) + +* Web app README : ![Web app README](./sema-toolchain/sema_web_app/README.md) + +* A Makefile is provided to ease the usage of the toolchain, run ```make help``` for more information about the available commands + +### Credentials + +Main authors of the projects: + +* **Charles-Henry Bertrand Van Ouytsel** (UCLouvain) + +* **Christophe Crochet** (UCLouvain) + +* **Khanh Huu The Dam** (UCLouvain) + +* **Oreins Manon** (UCLouvain) + +Under the supervision and with the support of **Fabrizio Biondi** (Avast) + +Under the supervision and with the support of our professor **Axel Legay** (UCLouvain) (:heart:) + +### Linked papers + +* [Analysis and classification of malware based on symbolic execution and machine learning](https://dial.uclouvain.be/pr/boreal/object/boreal:285757) + +* [Tool Paper - SEMA: Symbolic Execution Toolchain for Malware Analysis](https://doi.org/10.1007/978-3-031-31108-6\_5) + +* [On Exploiting Symbolic Execution to Improve the Analysis of RAT Samples with angr](https://dial.uclouvain.be/pr/boreal/object/boreal%3A280744/datastream/PDF_01/view) diff --git a/docs/sources/sema-toolchain/sema_classifier/application/ClassifierApp.md b/docs/sources/sema-toolchain/sema_classifier/application/ClassifierApp.md new file mode 100644 index 000000000..8c605eea3 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_classifier/application/ClassifierApp.md @@ -0,0 +1,37 @@ +# + + +### run_classifier +```python +.run_classifier() +``` + + +---- + + +### get_args_request +```python +.get_args_request() +``` + + +---- + + +### parse_class_args +```python +.parse_class_args( + user_data, args_parser +) +``` + + +---- + + +### get_args +```python +.get_args() +``` + diff --git a/docs/sources/sema-toolchain/sema_classifier/application/SemaClassifier.md b/docs/sources/sema-toolchain/sema_classifier/application/SemaClassifier.md new file mode 100644 index 000000000..fc7ee11ad --- /dev/null +++ b/docs/sources/sema-toolchain/sema_classifier/application/SemaClassifier.md @@ -0,0 +1,8 @@ +# + + +### main +```python +.main() +``` + diff --git a/docs/sources/sema-toolchain/sema_scdg/application/SCDGApp.md b/docs/sources/sema-toolchain/sema_scdg/application/SCDGApp.md new file mode 100644 index 000000000..531ba76e8 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/SCDGApp.md @@ -0,0 +1,37 @@ +# + + +### run_scdg +```python +.run_scdg() +``` + + +---- + + +### get_args_request +```python +.get_args_request() +``` + + +---- + + +### parse_json_request +```python +.parse_json_request( + user_data +) +``` + + +---- + + +### get_args +```python +.get_args() +``` + diff --git a/docs/sources/sema-toolchain/sema_scdg/application/SemaSCDG.md b/docs/sources/sema-toolchain/sema_scdg/application/SemaSCDG.md new file mode 100644 index 000000000..11ef6902c --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/SemaSCDG.md @@ -0,0 +1,42 @@ +# + + +### __handle_exception +```python +.__handle_exception( + e, sema_scdg, crashed_samples +) +``` + +--- +Handles exceptions during the binary analysis process. + +This function manages different types of exceptions, logs errors, ends the analysis run, and keeps track of crashed samples. + +---- + + +### __process_folder +```python +.__process_folder( + folder, sema_scdg, crashed_samples +) +``` + +--- +Processes files in a folder for building the System Call Dependency Graph (SCDG). + +This function iterates through files in a folder, sets up the analysis environment for each file, runs the analysis, handles exceptions, and updates progress. + +---- + + +### start_scdg +```python +.start_scdg() +``` + +--- +Starts the System Call Dependency Graph (SCDG) analysis process. + +This function initiates the analysis by determining whether to analyze a single binary or multiple binaries in a folder, running the analysis, handling exceptions, and reporting any crashed samples. diff --git a/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.md b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.md new file mode 100644 index 000000000..ec57763da --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/MapViewOfFile.md @@ -0,0 +1,25 @@ +# + + +### convert_prot +```python +.convert_prot( + prot +) +``` + +--- +Convert from a windows memory protection constant to an angr bitmask + +---- + + +### deconvert_prot +```python +.deconvert_prot( + prot +) +``` + +--- +Convert from a angr bitmask to a windows memory protection constant diff --git a/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.md b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.md new file mode 100644 index 000000000..ec57763da --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAlloc.md @@ -0,0 +1,25 @@ +# + + +### convert_prot +```python +.convert_prot( + prot +) +``` + +--- +Convert from a windows memory protection constant to an angr bitmask + +---- + + +### deconvert_prot +```python +.deconvert_prot( + prot +) +``` + +--- +Convert from a angr bitmask to a windows memory protection constant diff --git a/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.md b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.md new file mode 100644 index 000000000..8427e0d92 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/procedures/windows/custom_package/VirtualAllocEx.md @@ -0,0 +1,23 @@ +# + + +### convert_prot +```python +.convert_prot( + prot +) +``` + + +---- + + +### deconvert_prot +```python +.deconvert_prot( + prot +) +``` + +--- +Convert from a angr bitmask to a windows memory protection constant diff --git a/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/main.md b/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/main.md new file mode 100644 index 000000000..ec6e97623 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/main.md @@ -0,0 +1,10 @@ +# + + +### main +```python +.main() +``` + +--- +Echo the input arguments to standard output diff --git a/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.md b/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.md new file mode 100644 index 000000000..ec6e97623 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/sandboxes/vm/kvm/main.md @@ -0,0 +1,10 @@ +# + + +### main +```python +.main() +``` + +--- +Echo the input arguments to standard output diff --git a/docs/sources/sema-toolchain/sema_scdg/application/scdg_tests.md b/docs/sources/sema-toolchain/sema_scdg/application/scdg_tests.md new file mode 100644 index 000000000..11d285325 --- /dev/null +++ b/docs/sources/sema-toolchain/sema_scdg/application/scdg_tests.md @@ -0,0 +1,11 @@ +# + + +### compare_graphs +```python +.compare_graphs( + graph1_path, graph2_path, csv_path1, csv_path2, exploration_timeout, + prod = False +) +``` + diff --git a/docs/sources/sema-toolchain/sema_web_app/application/SemaServer.md b/docs/sources/sema-toolchain/sema_web_app/application/SemaServer.md new file mode 100644 index 000000000..fc7ee11ad --- /dev/null +++ b/docs/sources/sema-toolchain/sema_web_app/application/SemaServer.md @@ -0,0 +1,8 @@ +# + + +### main +```python +.main() +``` + diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 000000000..21abef29e --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,26 @@ +site_name: Panther Documentation +theme: + name: material + palette: + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference +markdown_extensions: + - attr_list + - pymdownx.emoji: + emoji_index: !!python/name:pymdownx.emoji.gemoji + emoji_generator: !!python/name:pymdownx.emoji.to_alt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..33a489dd6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +mkgendocs == 0.9.2 +mkdocs-material == 9.1.15 +mkdocs == 1.5.0 +PyYAML == 6.0.1 +pymdown-extensions +mkdocs-material-extensions \ No newline at end of file