Comments (5)
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.
I am reopening the issue so that we don't forget.
from b2r2.
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.
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.
Thanks for the suggestion. I'll do as you said, while I wait for the next release :)
from b2r2.
Related Issues (20)
- Error in parse export for DLL profapi.dll HOT 5
- InterJmp pretty-printing HOT 2
- x86/64 lifting loop instruction HOT 7
- Incorrect disassembly HOT 2
- [BinHandler] Error in section reading HOT 11
- Error in parse EAT HOT 2
- Error in getRawOffset HOT 2
- Bug in GetSymbols HOT 7
- Behavior change of FormatDetector.Detect() HOT 4
- pcmpistri lifting infine loop HOT 4
- [Question] Any plan for supporting a SMT? HOT 2
- ARMv7: incorrect disassembly of VCVT HOT 6
- Improve function detection algorithm HOT 2
- Updates? HOT 1
- [Question] Dose the newest version B2R2 v0.5.0 support python? HOT 4
- [Question] Question on analyzing the ARMv8 aarch32 binary HOT 1
- [Question] Assembling LowUIR to Assembly (x86/x64/...) HOT 1
- Error when import function does not exist in wasm binary HOT 3
- Does the B2R2 support PPC32 or Sparc? HOT 2
- Does it take three to four seconds for each instruction to be decompiled? Is there any way to improve the efficiency? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from b2r2.