Examples of a DLL file analyzer
The following examples are from the peExportParser project in the Chapter#4
folder of the GitHub project. In order to save space, this book only extracts the highlighted code; please refer to the full source code to see the full project, which is publicly available in this book's repository.
Let’s put what we have learned in practice and try to scan the entire DLL module for named functions in a purely static situation. As the analysis will be done in a purely static state, the first challenge will be that the entire EAT contains all its data as RVAs (i.e., dynamic file-mapped offsets). Therefore, we need to construct a function to help us automate the conversion of RVAs back into offsets relative to the current static file contents to capture the data correctly. Figure 4.10 shows a simple function, rvaToOffset
, that helps us with this process:
Figure 4.10 – The code of the rvaToOffset function
In Chapter...