MCPcopy Create free account
hub / github.com/dobin/SuperMega / project

Function project

app/views_project.py:46–145  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

44
45@views_project.route("/project/<name>")
46def project(name):
47 project_setting = storage.get_project_setting(name)
48 if project_setting == None:
49 logger.error("Project {} not found".format(name))
50 return redirect("/projects", code=302)
51 #project_setting.print()
52
53 is_built = False
54 if os.path.exists(project_setting.get_inject_exe_out()):
55 is_built = True
56
57 exports = []
58 is_64 = False
59 is_dotnet = False
60 code_sect_size = 0
61 data_sect_size = 0
62 data_sect_largest_gap_size = 0
63 payload_len = 0
64 unresolved_dlls = []
65 has_remote = False
66 has_rodata_section = False
67
68 if config.get("avred_server") != "":
69 has_remote = True
70
71 # payload / shellcode
72 if project_setting.get_payload_path() != None:
73 payload_len = os.path.getsize(project_setting.get_payload_path())
74
75 # injectable / exe
76 if project_setting.get_inject_exe_in() != None and os.path.exists(project_setting.get_inject_exe_in()):
77 superpe = SuperPe(project_setting.get_inject_exe_in())
78 #if not superpe.is_64():
79 # # return 500
80 # return "Error: Binary {} is not 64bit".format(project.settings.get_inject_exe_in()), 500
81
82 is_64 = superpe.is_64()
83 is_dotnet = superpe.is_dotnet()
84 if superpe.is_dll():
85 exports = superpe.get_exports_full()
86 code_sect_size = superpe.get_code_section().Misc_VirtualSize
87 rdata_section = superpe.get_section_by_name(".rdata")
88 if rdata_section != None:
89 data_sect_size = rdata_section.virt_size
90 else:
91 logger.warning("No .rdata section found in {}".format(project_setting.get_inject_exe_in()))
92
93 has_rodata_section = superpe.has_rodata_section()
94 if has_rodata_section:
95 data_sect_largest_gap_size = superpe.get_rdata_rangemanager().find_largest_gap()
96 unresolved_dlls = pe.dllresolver.unresolved_dlls(superpe)
97
98 project_dir = os.path.dirname(os.getcwd() + "\\" + project_setting.project_path)
99 log_files = get_logfiles(project_setting.project_path)
100 injectables = list_files_and_sizes(PATH_INJECTABLES)
101 shellcodes = list_files_and_sizes(PATH_SHELLCODES)
102
103 carrier_names = get_template_names()

Callers

nothing calls this directly

Calls 15

is_64Method · 0.95
is_dotnetMethod · 0.95
is_dllMethod · 0.95
get_exports_fullMethod · 0.95
get_code_sectionMethod · 0.95
get_section_by_nameMethod · 0.95
has_rodata_sectionMethod · 0.95
SuperPeClass · 0.90
get_template_namesFunction · 0.90
get_logfilesFunction · 0.85
list_files_and_sizesFunction · 0.85

Tested by

no test coverage detected