c++cwindowsntdllnt-native-api

How to access PE resources using Windows Native API?


I have a Windows native application that contain embedded resources and I'd like to access them using the native API. Are there native functions that handle resources (something similar to FindResource/LoadResource) or I will have to create my own PE reader to extract them?


Solution

  • Ntdll exports LdrFindResource_U and LdrAccessResource that are almost counterparts of FindResource and LoadResource, respectively. You'll need in addition a counterpart of GetModuleHandle to use them. Wine source (specially resource.c and module.c) can be used as documentation of these functions.