Skip to content

Update init.py #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions inc/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def get_filename_by_path(path): # 根据路径获取文件名
return filename


def get_poc_modole_list(): # 调用此函数获取 /pocs 下的全部 poc
def get_poc_modole_list(default_path=""): # 默认调用此函数获取 /pocs 下的全部 poc,及根据传入路径获取文件夹全部poc
poc_module_list = []
current_path = os.path.abspath('.')
pocs_base_path = os.path.join(current_path, 'pocs')
pocs_base_path = os.path.join(current_path, "pocs" + default_path)
poc_path_list = get_dir_files(pocs_base_path)
for poc_path in poc_path_list:
poc_path = poc_path.replace(current_path, '')
Expand All @@ -56,6 +56,10 @@ def get_poc_modole_list(): # 调用此函数获取 /pocs 下的全


def get_poc_modole_list_by_search(search_keys_list): # 此函数通过搜索poc文件名调用相应的poc, 传入poc文件名列表, 返回由poc对象的列表
for search_key in search_keys_list:
if "/" in search_key:
poc_module_list = get_poc_modole_list(search_key)
return poc_module_list
search_flag = True
poc_modole_list = []
current_path = os.path.abspath('.')
Expand Down