MCPcopy Create free account
hub / github.com/HexHive/NASS / get_shellcode

Method get_shellcode

tools/gef.py:6818–6831  ·  view source on GitHub ↗
(self, sid: int)

Source from the content-addressed store, hash-verified

6816 return
6817
6818 def get_shellcode(self, sid: int) -> None:
6819 info(f"Downloading shellcode id={sid}")
6820 res = http_get(self.get_url.format(sid))
6821 if res is None:
6822 err(f"Failed to fetch shellcode #{sid}")
6823 return
6824
6825 ok("Downloaded, written to disk...")
6826 with tempfile.NamedTemporaryFile(prefix="sc-", suffix=".txt", mode='w+b', delete=False, dir=gef.config["gef.tempdir"]) as fd:
6827 shellcode = res.split(b"<pre>")[1].split(b"</pre>")[0]
6828 shellcode = shellcode.replace(b"&quot;", b'"')
6829 fd.write(shellcode)
6830 ok(f"Shellcode written to '{fd.name}'")
6831 return
6832
6833
6834@register

Callers 1

do_invokeMethod · 0.95

Calls 5

infoFunction · 0.85
http_getFunction · 0.85
errFunction · 0.85
okFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected