Skip to content

Commit 7629090

Browse files
committed
fix(pe): Require sections during CLR parsing
The CLR parsing logic relies on the presence of the section headers. Enable section parsing if CLR option is present.
1 parent 32c294f commit 7629090

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/pe/parser.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ func parse(path string, data []byte, options ...Option) (*PE, error) {
305305
p.EntryPoint = format.UintToHex(uint64(oh32.AddressOfEntryPoint))
306306
}
307307

308+
// CLR directory parsing piggybacks on sections
309+
if opts.parseCLR {
310+
opts.parseSections = true
311+
}
312+
308313
// parse section header
309314
if opts.parseSections || opts.parseResources {
310315
err = pe.ParseSectionHeader()

0 commit comments

Comments
 (0)