Skip to content

Commit

Permalink
move vt_session to new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
clearbluejar committed Sep 7, 2023
1 parent 327a7fc commit 0f093bc
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 469 deletions.
37 changes: 0 additions & 37 deletions .vscode/tasks.json

This file was deleted.

3 changes: 1 addition & 2 deletions ghidriff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from .version_tracking_diff import VersionTrackingDiff
from .simple_diff import SimpleDiff
from .structural_graph_diff import StructualGraphDiff
from .auto_version_tracking_diff import AutoVersionTrackingDiff

__all__ = [
"GhidraDiffEngine", "SimpleDiff", "StructualGraphDiff", "VersionTrackingDiff", "AutoVersionTrackingDiff"
"GhidraDiffEngine", "SimpleDiff", "StructualGraphDiff", "VersionTrackingDiff"
]
174 changes: 0 additions & 174 deletions ghidriff/auto_version_tracking_diff.py

This file was deleted.

93 changes: 0 additions & 93 deletions ghidriff/correlators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,96 +10,6 @@
import ghidra
from ghidra_builtins import *

from ghidra.feature.vt.api.util import VTAbstractProgramCorrelator
from ghidra.feature.vt.api.main import VTProgramCorrelator
from ghidra.feature.vt.api.main import VTScore
from ghidra.framework.options import ToolOptions


@JImplements(VTProgramCorrelator, deferred=True)
class MyManualMatchProgramCorrelator:

MANUAL_SCORE = VTScore(1.0)
NAME = "TEST GUY"

def __init__(self, src_prog, dst_prog) -> None:

self.src_prog = src_prog
self.src_addrs = src_prog.getMemory()
self.dst_prog = dst_prog
self.dst_addrs = dst_prog.getMemory()
self.options = ToolOptions(self.NAME)

# /**
# * Performs the correlation between two programs looking for how well functions in one program
# * correlate to functions in another program.
# * @param session An existing manager that may contain previous results that may
# * influence this correlation.
# * @param monitor a task monitor for reporting progress during the correlation.
# * @return the match set created by this correlator used to store results.
# *
# * @throws CancelledException if the user cancels the correlation via the task monitor.
# */
# public VTMatchSet correlate(VTSession session, TaskMonitor monitor) throws CancelledException;

@JOverride
def correlate(self, matchSet, monitor):
print('do_correlate')

# /**
# * Return the name of the correlator.
# * @return the name of the correlator
# */
# public String getName();
@JOverride
def getName(self):
return self.NAME

# /**
# * Returns a options object populated with the options for this correlator instance.
# */
# public ToolOptions getOptions();
@JOverride
def getOptions(self):
return self.options

# /**
# * Returns the address set associated with this correlator instance.
# * @return the address set associated with this correlator instance.
# */
# public AddressSetView getSourceAddressSet();
@JOverride
def getSourceAddressSet(self):
return self.src_addrs

# /**
# * Returns the source program for this correlator instance.
# * @return the source program for this correlator instance.
# */
# public Program getSourceProgram();
@JOverride
def getSourceProgram(self):
return self.src_prog

# /**
# * Returns the destination program for this correlator instance.
# * @return the destination program for this correlator instance.
# */
# public Program getDestinationProgram();
@JOverride
def getDestinationProgram(self):
return self.dst_prog

# /**
# * Returns the address set associated with this correlator instance.
# * @return the address set associated with this correlator instance.
# */
# public AddressSetView getDestinationAddressSet();
@JOverride
def getDestinationAddressSet(self):
return self.dst_addrs


@JImplements(FunctionHasher, deferred=True)
class StructuralGraphHasher:
"""
Expand Down Expand Up @@ -574,9 +484,6 @@ class SwitchSigHasher:
@JOverride
def hash(self, func: 'ghidra.program.model.listing.Function', monitor: 'ghidra.util.task.TaskMonitor') -> int:

if "00680f84" in func.name:
print(func)

sig = func.getSignature().toString().replace(func.name, '')

func_switch_map = get_func_to_switch(func.getProgram())
Expand Down
Loading

0 comments on commit 0f093bc

Please sign in to comment.