Comments (5)
Could you be more precise about the API you would like ?
from lief.
I'd like to be able to do things like that:
for key, value in pe.resources_manager.version.string_file_info.langcode_items[0].items():
print(key, value)
But in general, having such APIs for everything that looks like a dictionary in the whole project would be great.
from lief.
Well actually the underlying C++ container is a std::map
: include/LIEF/PE/resources/LangCodeItem.hpp#L96 and the translation to Python (thanks to pybind11) is performed with a dict
like. The conversion to collections.abc.MutableMapping
is not trivial
But you can iterate over the items
property as follow:
for k, v in pe.resources_manager.version.string_file_info.langcode_items[0].items.items():
print(k, v)
from lief.
Hmmm, yeah, I get the problem.
The list of tuples if fine for me to get the data out, but if you want to edit it at some point, it will be tricky.
from lief.
FYI, I create my dict this way:
dict(pe.resources_manager.version.string_file_info.langcode_items[0].items)
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.