I want to read an image of a module (loaded in the memory of a process), into a buffer, using the Win32 C++ API. After reading I want to change all VAs in from the buffer, into RVAs.
I've found the ImageRvaToVa
function on MSDN, however, I would need the reverse mapping, i.e. ImageVaToRva
and I would need to apply it for all VAs inside of the given image. However, I couldn't find such a function or anything similar to it. Does such a function exist in Win32?
One way to do what I want would be to parse the .reloc
section of the image. However, I didn't find any straightforward way to do this. Are there any Win32 API functions that can easily parse the .reloc
section?
Any other suggestions for approaches to solving this problem would be appreciated.