Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion packages/decepticon/decepticon/tools/reversing/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
for f in fm.getFunctions(True):
name = f.getName()
if not f.isThunk() and f.isExternal() is False:
addrs = [str(a) for a in f.getEntryPoint()]
print("fn {{}} @ {{}}".format(name, f.getEntryPoint()))

# Dump external imports (likely interesting APIs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from __future__ import annotations

from decepticon.tools.reversing.scripts import ghidra_recon_script


class TestGhidraReconScriptEntrypoint:
def test_no_iterable_getentrypoint(self) -> None:
src = ghidra_recon_script("/workspace/target")
assert "for a in f.getEntryPoint()" not in src

def test_addrs_variable_absent(self) -> None:
src = ghidra_recon_script("/workspace/target")
assert "addrs" not in src

def test_entrypoint_printed_once(self) -> None:
src = ghidra_recon_script("/workspace/target")
assert src.count("getEntryPoint()") == 1

def test_binary_path_substituted(self) -> None:
src = ghidra_recon_script("/tmp/malware.exe")
assert "/tmp/malware.exe" in src
Loading