PeFindSection
Description
Find a section by name (first match; PE allows duplicates but they’re vanishingly rare).
Success
Returns a pointer to the matching PeSection, borrowed from self (valid until PeDeinit).
Failure
Returns NULL when no section matches.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Pe.c:560:
}
const PeSection *s = PeFindSection(&pe, ".debug");
bool ok = s != NULL && s->virtual_address == SECTION_VA && s->raw_offset == DEBUG_RAW_OFF;
ok = ok && PeFindSection(&pe, ".nope") == NULL;- In
Pe.c:562:
const PeSection *s = PeFindSection(&pe, ".debug");
bool ok = s != NULL && s->virtual_address == SECTION_VA && s->raw_offset == DEBUG_RAW_OFF;
ok = ok && PeFindSection(&pe, ".nope") == NULL;
PeDeinit(&pe);- In
Pe.c:1545:
return false;
}
const PeSection *s = PeFindSection(&pe, "ABCDEFGH");
bool ok = s != NULL && s->virtual_address == 0x2000 && s->raw_offset == 0x321;
ok = ok && PeFindSection(&pe, ".text") != NULL;- In
Pe.c:1547:
const PeSection *s = PeFindSection(&pe, "ABCDEFGH");
bool ok = s != NULL && s->virtual_address == 0x2000 && s->raw_offset == 0x321;
ok = ok && PeFindSection(&pe, ".text") != NULL;
ok = ok && PeFindSection(&pe, ".absent") == NULL;
PeDeinit(&pe);- In
Pe.c:1548:
bool ok = s != NULL && s->virtual_address == 0x2000 && s->raw_offset == 0x321;
ok = ok && PeFindSection(&pe, ".text") != NULL;
ok = ok && PeFindSection(&pe, ".absent") == NULL;
PeDeinit(&pe);
DefaultAllocatorDeinit(&alloc);- In
Pe.c:1588:
// The named sections resolve (sanity), but the empty name does not.
bool ok = PeFindSection(&pe, ".text") != NULL;
ok = ok && PeFindSection(&pe, ".rdata") != NULL;
ok = ok && PeFindSection(&pe, "") == NULL; // L580 upper bound
- In
Pe.c:1589:
// The named sections resolve (sanity), but the empty name does not.
bool ok = PeFindSection(&pe, ".text") != NULL;
ok = ok && PeFindSection(&pe, ".rdata") != NULL;
ok = ok && PeFindSection(&pe, "") == NULL; // L580 upper bound
- In
Pe.c:1590:
bool ok = PeFindSection(&pe, ".text") != NULL;
ok = ok && PeFindSection(&pe, ".rdata") != NULL;
ok = ok && PeFindSection(&pe, "") == NULL; // L580 upper bound
PeDeinit(&pe);
Last updated on