Skip to content

PE/COFF: Do not try to parse indirect section name in PE #487

@kkent030315

Description

@kkent030315

Current version of goblin parses section names as indirect even on PE. The indirect section name is only a feature in COFF so we should avoid parsing it when it's PE and instead parse the name in UTF-8.

pub fn name_offset(&self) -> error::Result<Option<usize>> {
// Based on https://github.com/llvm-mirror/llvm/blob/af7b1832a03ab6486c42a40d21695b2c03b2d8a3/lib/Object/COFFObjectFile.cpp#L1054
if self.name[0] == b'/' {
let idx: usize = if self.name[1] == b'/' {
let b64idx = self.name.pread::<&str>(2)?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions