Giter VIP home page Giter VIP logo

Comments (3)

DavidBuchanan314 avatar DavidBuchanan314 commented on August 25, 2024

Ok so the binary I was loading was the exefs main of 0100000000001010 (LibAppletLns), from fw version 16.0.3.

I commented out these three lines and was able to get the binary loaded:

long pltStart = this.pltEntries.get(0).off;
long pltEnd = this.pltEntries.get(this.pltEntries.size() - 1).off + 0x10;
this.memBlockHelper.addSection(".plt", pltStart, pltStart, pltEnd - pltStart, true, false, false);

Presumably, there were 0 plt entries, but the code assumes that there's always at least one. I suppose a proper solution would be to only create the .plt section if there's 1 or more plt entries? But maybe there's something more subtle going on here, and the plt entries just aren't being detected properly?

from ghidra-switch-loader.

TSRBerry avatar TSRBerry commented on August 25, 2024

Usually if there are no plt entries it should already abort here:

if (pltRelocs.isEmpty())
{
Msg.info(this, "No plt relocations found.");
return;
}

The assumption that at least one entry exists after the while loop should probably still be removed. I'm curious what's happening here, I'll try to investigate that later (since that's a great excuse to actually learn more about the format).

from ghidra-switch-loader.

TSRBerry avatar TSRBerry commented on August 25, 2024

Okay actually I can't figure out much. I don't know enough about how ELF files are structured and how NSO files work.

The only hunch I have is that it might be related to the fact that the sdk binary is almost completely empty.
But I think the more interesting bit might be that the IDA loader assumes the same thing:
https://github.com/Atmosphere-NX/Atmosphere/blob/8b88351cb46afab3907e395f40733854fd8de0cf/utilities/nxo64.py#L420-L422

Since these sections in the Ghidra and the IDA plugin are almost identical, but neither of them are well documented, I'm not sure if this was done intentionally.
I'd also like to know what all these magic numbers mean, but I feel like that's currently still too hard for me to figure out.

from ghidra-switch-loader.

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.