| 206 | } |
| 207 | |
| 208 | func newParserOpts(opts opts) *peparser.Options { |
| 209 | return &peparser.Options{ |
| 210 | DisableCertValidation: true, |
| 211 | OmitIATDirectory: true, |
| 212 | OmitSecurityDirectory: !opts.parseSecurity, |
| 213 | OmitExceptionDirectory: true, |
| 214 | OmitTLSDirectory: true, |
| 215 | OmitCLRHeaderDirectory: !opts.parseCLR, |
| 216 | OmitCLRMetadata: true, |
| 217 | OmitDelayImportDirectory: true, |
| 218 | OmitBoundImportDirectory: true, |
| 219 | OmitArchitectureDirectory: true, |
| 220 | OmitDebugDirectory: true, |
| 221 | OmitRelocDirectory: true, |
| 222 | OmitResourceDirectory: !opts.parseResources, |
| 223 | OmitImportDirectory: !opts.parseSymbols && !opts.calcImphash, |
| 224 | OmitExportDirectory: !opts.parseExports, |
| 225 | OmitLoadConfigDirectory: true, |
| 226 | OmitGlobalPtrDirectory: true, |
| 227 | SectionEntropy: opts.sectionEntropy, |
| 228 | Logger: &Logger{}, |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | // Logger is the adapter for routing PE package logs to logrus. |
| 233 | type Logger struct{} |