Git Product home page Git Product logo

Comments (5)

sangkilc avatar sangkilc commented on May 2, 2024 1

As you described, we would like to make the handler immutable, and what you described is okay, but I would simply maintain the original buffer (byte []) somewhere in your code, and modify the buffer before you create a new handler. This way, you can eliminate the second step.

Originally, the UpdateCode function was designed to be used to parse dynamic execution traces where we can read a basic-block-level code chunk at a time. In this case, we need to frequently update the code, and creating a new handler was not a big deal. In your use case, however, creating a new BinHandler all the time will be largely redundant as you pointed out. Maybe we should create a mutable-version of BinHandler (something like MutableBinHandler).

from b2r2.

sangkilc avatar sangkilc commented on May 2, 2024 1

I am reopening the issue so that we don't forget.

from b2r2.

sangkilc avatar sangkilc commented on May 2, 2024 1

Please checkout: 40e7be6

You should now be able to modify the buffer by:

// hdl = BinHandler
hdl.FileInfo.BinReader.Bytes.[idx] <- byteValue

Or even by:

hdl.FileInfo.BinReader.Bytes <- newArray

from b2r2.

sangkilc avatar sangkilc commented on May 2, 2024

Actually, I think we can address your concern by modifying the BinReader class in such a way that it can have a setter. We are currently cleaning up the BinFile and BinReader module, so we will try to fix this issue in the next release. In the meantime, you can stick to your current strategy.

from b2r2.

enkomio avatar enkomio commented on May 2, 2024

Thanks for the suggestion. I'll do as you said, while I wait for the next release :)

from b2r2.

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.