Skip to main content
Back to challenges

Malware Development · Programming

PE Header Parsing for Reflective Loading

Advanced · 5/5
Paid planExpert rank required175 points on first solo solve

Challenge brief

Parse a PE file's import table to resolve dependencies for reflective loading.

Given the hex of a PE's import directory, extract:

  1. DLL names
  2. Function names/ordinals for each DLL

Import Directory Entry (20 bytes each)

Offset 0:  OriginalFirstThunk RVA (4 bytes)
Offset 4:  TimeDateStamp (4 bytes)
Offset 8:  ForwarderChain (4 bytes)  
Offset 12: Name RVA (4 bytes) -> DLL name
Offset 16: FirstThunk RVA (4 bytes)

Input

Line 1: Import directory hex Line 2: Comma-separated mappings of RVA:string (for name resolution)

Output Format: One line per DLL found in the import directory:

dll_name:function1,function2

Functions are resolved from the RVA map where RVA >= 0x3000. If a DLL has no resolved functions, print just the DLL name followed by a colon.

Solo practice

Sign in to submit an answer and save your progress.

Sign in to practice