sectionMapValuer returns map valuer with PE section data.
(segments []*BoundSegmentLiteral, section pe.Sec)
| 628 | |
| 629 | // sectionMapValuer returns map valuer with PE section data. |
| 630 | func (f *Foreach) sectionMapValuer(segments []*BoundSegmentLiteral, section pe.Sec) MapValuer { |
| 631 | var valuer = MapValuer{} |
| 632 | for _, seg := range segments { |
| 633 | key := seg.Value |
| 634 | switch seg.Segment { |
| 635 | case fields.NameSegment: |
| 636 | valuer[key] = section.Name |
| 637 | case fields.SizeSegment: |
| 638 | valuer[key] = section.Size |
| 639 | case fields.EntropySegment: |
| 640 | valuer[key] = section.Entropy |
| 641 | case fields.MD5Segment: |
| 642 | valuer[key] = section.Md5 |
| 643 | } |
| 644 | } |
| 645 | return valuer |
| 646 | } |