Git Product home page Git Product logo

Comments (4)

astrelsky avatar astrelsky commented on July 21, 2024

There are methods to check if a memory block is executable and if a block is read/write/volatile if this helps at all.

from ghidra_scripts.

fuzzywalls avatar fuzzywalls commented on July 21, 2024

That might be necessary, I'm not sure yet. Currently I'm experimenting with getFirstData, getLastData, getFirstFunction, and getLastFunction to find the necessary blocks and creating address ranges around those. Worked well for fixing up the code, but fixing up the data requires a little more processing.

from ghidra_scripts.

fuzzywalls avatar fuzzywalls commented on July 21, 2024

@astrelsky The getFirstX route was a dead end because there is no guarantee the functions will be in one contiguous block. I experimented with the permission methods you mentioned in an ARM binary. Single memory blocks contained code and data which means it was marked with execute and read permissions, so not a lot to go on with that. I was able to do something similar by using a memory manager function, getExecuteSet, it returned a range of what it considered code. This still contained some data, which introduces some false positives, but it is at least working. Going to try and lower the false positive rates a little now.

from ghidra_scripts.

astrelsky avatar astrelsky commented on July 21, 2024

@astrelsky The getFirstX route was a dead end because there is no guarantee the functions will be in one contiguous block. I experimented with the permission methods you mentioned in an ARM binary. Single memory blocks contained code and data which means it was marked with execute and read permissions, so not a lot to go on with that. I was able to do something similar by using a memory manager function, getExecuteSet, it returned a range of what it considered code. This still contained some data, which introduces some false positives, but it is at least working. Going to try and lower the false positive rates a little now.

You could probably filter them further by checking if at least one disassembled instruction already exists in the memory block. If the block isn't writeable then it is more likely to only contain instructions. It can still potentially have data though.

from ghidra_scripts.

Related Issues (16)

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.