Comments (3)
I have to check how we can handle BytesIO from Python to C++.
For PE and ELF you can use a sequence of bytes:
import lief
raw = None
with open("/bin/ls", 'rb') as f:
raw = f.read()
binary = lief.ELF.parse(raw)
print(binary)
from lief.
Thanks!
from lief.
As mentioned in #832, BytesIO is currently not working for lief.PE.parse
because BytesIO
objects do not have an attribute called raw
(i.e. they do not provide an underlying RawIOBase
object) and apparently, they do not implement the RawIOBase
interface themselves either, because they do not have a readall
method.
from lief.
Related Issues (20)
- Adding same sections to same PE produces different builds HOT 2
- use lief.ELF.parse( ) parse 32bit-ARM ELF samples: Can't parse section #00 The .shstr index is out of range of the section table Segment #4 has a physical size larger than the current stream size (27700 > 8884). The content will be truncated with the stream size. Segment #4 has a corrupted file offset (0x3000)
- Failure to build from source using Python instructions HOT 2
- binary->name in machd_reader. c has not been initialized, causing program crashes or random printing of large amounts of data HOT 1
- Regression: MemoryError: std::bad_alloc after v0.12.3 HOT 4
- Unable to add arbitrary addresses as exported functions HOT 3
- How to execute code before main entry point (using __mod_init_func)?
- Long section names in PE HOT 2
- installed by pip missing many attributes HOT 1
- Protections numbers meaning in Mach-O HOT 1
- `lief.PE.parse' function throws an out-of-range exception
- Python API missing `set_resources()` HOT 3
- Two issues in pe_reader (examples/c/pe_reader.c) HOT 1
- Symbol lookup error when swapping symbols name HOT 1
- Test binaries are not available HOT 1
- error: no declaration matches βLIEF::read_out_of_bound::read_out_of_bound(uint64_t) HOT 1
- Support for Rust demangle HOT 2
- Allocation-size-too-big in LIEF::MachO::init_c_sections
- Using std::isprint to determine may miss some strings HOT 1
- More pre-compilation targets for rust bindings HOT 2
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 lief.