Skip to content
Open
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
8 changes: 4 additions & 4 deletions ApplySig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from __future__ import print_function
from ghidra.framework.model import DomainFile
from ghidra.program.model.symbol import SourceType

from ghidra.util import Msg

from java.lang import IllegalArgumentException
Expand Down Expand Up @@ -429,7 +430,7 @@ def parse_header(f):
if version >= 8:
pattern_size = read_u16le(f)

if version >= 9:
if version > 9:
read_u16le(f) #unknow

library_name = f.read(library_name_len)
Expand Down Expand Up @@ -695,6 +696,7 @@ def get_function_end(funk):
def funk_rename(addr, funk):
global rename_cnt
name = funk.name

if name != '?':
funk = getFunctionAt(parseAddress(hex(addr).strip('L')))
funk.setName(name, SourceType.USER_DEFINED)
Expand All @@ -703,10 +705,8 @@ def funk_rename(addr, funk):

def apply_sig(flirt):
funk = getFirstFunction()
#print(funk.entryPoint
#print(get_function_end(funk))
while funk is not None:
funk_start = int(funk.entryPoint.toString(), 16)
funk_start = funk.getEntryPoint()
funk_end = get_function_end(funk)
funk_buf = getBytes(parseAddress(hex(funk_start).strip('L')), funk_end - funk_start + 0x100)
#print('%x - %x' % (funk_start, funk_end))
Expand Down