Git Product home page Git Product logo

Comments (12)

astrelsky avatar astrelsky commented on July 21, 2024

In the python terminal with the .dylib opened what does currentProgram.getCompilerSpec().getCompilerSpecID().getIdAsString() produce?

The method GnuUtils.isGnuCompiler() should be what is being used to check this. The analyzers would be disabled if it returns false.

Edit: please forgive me it appears I misread the issue. May you attach a .dynlib I may use to investigate?

from ghidra-cpp-class-analyzer.

ILOVEPIE avatar ILOVEPIE commented on July 21, 2024

from ghidra-cpp-class-analyzer.

uyjulian avatar uyjulian commented on July 21, 2024

from ghidra-cpp-class-analyzer.

ILOVEPIE avatar ILOVEPIE commented on July 21, 2024

Nothing shows up in the class hierarchy tree is the issue I've been having. It appears the analyzers somewhat work as the methods are recognized as class member functions when you look at the names but the class hierarchy isn't generated for some reason.

from ghidra-cpp-class-analyzer.

astrelsky avatar astrelsky commented on July 21, 2024

Nothing shows up in the class hierarchy tree is the issue I've been having. It appears the analyzers somewhat work as the methods are recognized as class member functions when you look at the names but the class hierarchy isn't generated for some reason.

I'm going to try to take a look this weekend. I have limited access to internet resources though so I won't make any promises.

from ghidra-cpp-class-analyzer.

astrelsky avatar astrelsky commented on July 21, 2024

So, the good news is that it appears to be a minor issue with how external symbols are being handled. I should have a solution shortly.

from ghidra-cpp-class-analyzer.

astrelsky avatar astrelsky commented on July 21, 2024

@ILOVEPIE if you can build the extension may you try the master branch please?

from ghidra-cpp-class-analyzer.

ILOVEPIE avatar ILOVEPIE commented on July 21, 2024

sure i'll need a little bit of time to do so as im a little busy atm

from ghidra-cpp-class-analyzer.

astrelsky avatar astrelsky commented on July 21, 2024

sure i'll need a little bit of time to do so as im a little busy atm

Not a problem, there's no rush.

from ghidra-cpp-class-analyzer.

ammaraskar avatar ammaraskar commented on July 21, 2024

Hey, I recently ran into a similar issue and just stepped through the extension through a debugger. I found that getTypeInfo was returning null and ended up making a quick hacky change that seemed to help run the analyzer on a mac-gcc binary. Sadly this is just a binary I have so I can't make a small reproducible example right now.

The code change for reference if this helps you get a clue as to what might be happening or helps someone else on mac.

diff --git a/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java b/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
index bb9961e..2912d8a 100644
--- a/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
+++ b/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
@@ -214,6 +214,9 @@ public class TypeInfoUtils {
                        if (reloc.getSymbolName().startsWith(VtableModel.MANGLED_PREFIX)) {
                                return reloc.getSymbolName().substring(VtableModel.MANGLED_PREFIX.length());
                        }
+                       if (reloc.getSymbolName().startsWith("_" + VtableModel.MANGLED_PREFIX)) {
+                               return reloc.getSymbolName().substring(("_" + VtableModel.MANGLED_PREFIX).length());
+                       }
                        Address relocationAddress = getAbsoluteAddress(program, address);
                        if (relocationAddress == null || relocationAddress.getOffset() == 0) {
                                return "";

from ghidra-cpp-class-analyzer.

astrelsky avatar astrelsky commented on July 21, 2024

Hey, I recently ran into a similar issue and just stepped through the extension through a debugger. I found that getTypeInfo was returning null and ended up making a quick hacky change that seemed to help run the analyzer on a mac-gcc binary. Sadly this is just a binary I have so I can't make a small reproducible example right now.

The code change for reference if this helps you get a clue as to what might be happening or helps someone else on mac.

diff --git a/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java b/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
index bb9961e..2912d8a 100644
--- a/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
+++ b/src/main/java/ghidra/app/cmd/data/rtti/gcc/TypeInfoUtils.java
@@ -214,6 +214,9 @@ public class TypeInfoUtils {
                        if (reloc.getSymbolName().startsWith(VtableModel.MANGLED_PREFIX)) {
                                return reloc.getSymbolName().substring(VtableModel.MANGLED_PREFIX.length());
                        }
+                       if (reloc.getSymbolName().startsWith("_" + VtableModel.MANGLED_PREFIX)) {
+                               return reloc.getSymbolName().substring(("_" + VtableModel.MANGLED_PREFIX).length());
+                       }
                        Address relocationAddress = getAbsoluteAddress(program, address);
                        if (relocationAddress == null || relocationAddress.getOffset() == 0) {
                                return "";

That's odd that there are two underscores. I see no problem with this hack fix from a quick glance.

from ghidra-cpp-class-analyzer.

ILOVEPIE avatar ILOVEPIE commented on July 21, 2024

from ghidra-cpp-class-analyzer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.