MCPcopy Index your code
hub / github.com/dobin/SuperMega / verify_shellcode

Function verify_shellcode

supermega.py:286–308  ·  view source on GitHub ↗
(shc_name)

Source from the content-addressed store, hash-verified

284
285
286def verify_shellcode(shc_name):
287 logger.info(" Verify shellcode: {}".format(shc_name))
288
289 # check if directory exists
290 if not os.path.exists(os.path.dirname(VerifyFilename)):
291 logger.info("Error, directory does not exist for: {}".format(VerifyFilename))
292 return
293
294 # remove indicator file
295 pathlib.Path(VerifyFilename).unlink(missing_ok=True)
296
297 run_process_checkret([
298 config.get("path_runshc"),
299 "{}".format(shc_name),
300 ], check=False)
301 time.sleep(SHC_VERIFY_SLEEP)
302 if os.path.isfile(VerifyFilename):
303 logger.info("---> Verify OK. Shellcode works (file was created)")
304 os.remove(VerifyFilename)
305 return True
306 else:
307 logger.error("---> Verify FAIL. Shellcode doesnt work (file was not created)")
308 return False
309
310
311if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

run_process_checkretFunction · 0.85
formatMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected