mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-05 11:35:26 +00:00
Use RzPVector
for rz_bin_object_get_sections
/segments
(#3281)
* Use `RzPVector` for `rz_bin_object_get_sections`/`segments` * Bump rizin submodule to latest
This commit is contained in:
parent
33882a2e15
commit
aabf442348
2
rizin
2
rizin
@ -1 +1 @@
|
|||||||
Subproject commit f5ca4b96310efb7e38100076580d854b5aaf3248
|
Subproject commit ce88bbed49d1142fa33a57afee2ccfa62694f23b
|
@ -3422,7 +3422,7 @@ QList<SectionDescription> CutterCore::getAllSections()
|
|||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
RzList *sects = rz_bin_object_get_sections(o);
|
RzPVector *sects = rz_bin_object_get_sections(o);
|
||||||
if (!sects) {
|
if (!sects) {
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
@ -3431,9 +3431,7 @@ QList<SectionDescription> CutterCore::getAllSections()
|
|||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
rz_list_push(hashnames, rz_str_new("entropy"));
|
rz_list_push(hashnames, rz_str_new("entropy"));
|
||||||
RzListIter *it;
|
for (const auto § : CutterPVector<RzBinSection>(sects)) {
|
||||||
RzBinSection *sect;
|
|
||||||
CutterRzListForeach (sects, it, RzBinSection, sect) {
|
|
||||||
if (RZ_STR_ISEMPTY(sect->name))
|
if (RZ_STR_ISEMPTY(sect->name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3456,7 +3454,7 @@ QList<SectionDescription> CutterCore::getAllSections()
|
|||||||
|
|
||||||
sections << section;
|
sections << section;
|
||||||
}
|
}
|
||||||
rz_list_free(sects);
|
rz_pvector_free(sects);
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3470,15 +3468,14 @@ QStringList CutterCore::getSectionList()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RzList *sects = rz_bin_object_get_sections(o);
|
RzPVector *sects = rz_bin_object_get_sections(o);
|
||||||
if (!sects) {
|
if (!sects) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
RzListIter *it;
|
for (const auto § : CutterPVector<RzBinSection>(sects)) {
|
||||||
RzBinSection *sect;
|
|
||||||
CutterRzListForeach (sects, it, RzBinSection, sect) {
|
|
||||||
ret << sect->name;
|
ret << sect->name;
|
||||||
}
|
}
|
||||||
|
rz_pvector_free(sects);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3494,15 +3491,13 @@ QList<SegmentDescription> CutterCore::getAllSegments()
|
|||||||
if (!bf) {
|
if (!bf) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
RzList *segments = rz_bin_object_get_segments(bf->o);
|
RzPVector *segments = rz_bin_object_get_segments(bf->o);
|
||||||
if (!segments) {
|
if (!segments) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
RzBinSection *segment;
|
|
||||||
RzListIter *iter;
|
|
||||||
QList<SegmentDescription> ret;
|
QList<SegmentDescription> ret;
|
||||||
CutterRzListForeach (segments, iter, RzBinSection, segment) {
|
for (const auto &segment : CutterPVector<RzBinSection>(segments)) {
|
||||||
SegmentDescription segDesc;
|
SegmentDescription segDesc;
|
||||||
segDesc.name = segment->name;
|
segDesc.name = segment->name;
|
||||||
segDesc.vaddr = segment->vaddr;
|
segDesc.vaddr = segment->vaddr;
|
||||||
@ -3512,7 +3507,7 @@ QList<SegmentDescription> CutterCore::getAllSegments()
|
|||||||
segDesc.perm = perms_str(segment->perm);
|
segDesc.perm = perms_str(segment->perm);
|
||||||
ret << segDesc;
|
ret << segDesc;
|
||||||
}
|
}
|
||||||
rz_list_free(segments);
|
rz_pvector_free(segments);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user