nwmonster / applysig Goto Github PK
View Code? Open in Web Editor NEWApply IDA FLIRT signatures for Ghidra
License: GNU Lesser General Public License v3.0
Apply IDA FLIRT signatures for Ghidra
License: GNU Lesser General Public License v3.0
I noticed there are several outstanding pull requests. Is this script still being maintained? Thanks for your efforts, this is a fantastic script.
I took the liberty of patching the relevant code a bit quickly to find the problem:
while funk is not None:
funk_start = int(funk.entryPoint.toString(), 16)
funk_end = get_function_end(funk)
print(funk_end)
print(type(funk_end))
funk_buf = getBytes(parseAddress(hex(funk_start).strip('L')), (funk_end - funk_start + 0x100))
#print('%x - %x' % (funk_start, funk_end))
match_function(flirt, funk_buf, funk_start, funk_rename)
funk = getFunctionAfter(funk)
Output:
ApplySig.py> Running...
Load File:/home/cocaine/Downloads/generated/n64-sdk-1.2/n64-sdk-1.2.sig
Parse Flirt File.....
Name: n64-sdk-1.2
Count: 295
Apply Signatures.....
532676819
<type 'int'>
532677207
<type 'int'>
532678179
<type 'int'>
532678207
<type 'int'>
2751464787
<type 'long'>
Traceback (most recent call last):
File "/home/cocaine/bin/Ghidra_Scripts/ApplySig.py", line 729, in <module>
apply_sig(flirt)
File "/home/cocaine/bin/Ghidra_Scripts/ApplySig.py", line 713, in apply_sig
funk_buf = getBytes(parseAddress(hex(funk_start).strip('L')), (funk_end - funk_start + 0x100))
TypeError: getBytes(): 2nd arg can't be coerced to int
ApplySig.py> Finished!
This reveals that funk_end is not guaranteed to be constrained to an int, and getBytes() clearly does not want to take a long as input.
This appears to be relevant when working on N64 titles when trying to apply the n64 SDK signatures to eliminate standard library calls.
Line 42:
if version >= 9:
read_u16le(f) #unknow
If I remove the "=" it works
The demangler will not demangle symbols/labels applied with SourceType.USER_DEFINED. Setting to any other level will resolve this.
Will you add more documentation? ;)
Uncaught Exception!
java.lang.NullPointerException
at org.python.core.Py.dispatchToChecker(Py.java:2490)
at org.python.core.Py.isInstance(Py.java:2347)
at org.python.core.builtin.isinstance(builtin.java:712)
at org.python.core.Py.exceptionToString(Py.java:1372)
at org.python.core.Py.exceptionToBytes(Py.java:1339)
at org.python.core.Py.displayException(Py.java:1316)
at org.python.core.PyException.printStackTrace(PyException.java:89)
at docking.DockingErrorDisplay.buildStackTrace(DockingErrorDisplay.java:146)
at docking.DockingErrorDisplay.createErrorDialog(DockingErrorDisplay.java:114)
at docking.DockingErrorDisplay.doShowDialog(DockingErrorDisplay.java:98)
at docking.DockingErrorDisplay.lambda$showDialog$0(DockingErrorDisplay.java:91)
at docking.DockingErrorDisplay$$Lambda$444/0000000000000000.run(Unknown Source)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:704)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Script fails to run on ghidra 9.1.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.