Log in

View Full Version : rsrc file - help please!


jatls
February 9th, 2011, 03:50
I've been playing around recently with an exe and trying to isolate the code which displays a particular error message. However when I disassemble the exe, there is a significant shortage of strings to help me narrow down my search.

Further investigation led me to another file in the same folder as the exe in question which has the file type rsrc. This file appears to be a simple listing of strings used by the program and inside it I found my error message. The only problem is that this file is one string followed by another and I can't make sense of how the exe is calling these strings.

Has anybody seen anything like this before? Any advice or tips or even where to start?

Google has told me that rsrc is a common resource file type in mac applications and I know that there are rsrc headers in exe files normally but I haven't seen them as an external file before. It's quite bizarre!

deroko
February 9th, 2011, 07:43
When you have strings in external dll/exe it could be part of localization. What you can search for are calls to LoadStringA/W through which application will extract strings held in resource section.

Process is simple:
Code:

Display Error Message:
hmod = LoadLibraryEx("dll.exe", 0, DONT_RESOLVE_REFERENCES);
FindStringW(hmod, IDS_ERROR_MESSAGE, lpBuffer, sizeof(lpBuffer)/sizeof(TCHAR));
FreeLibrary(hmod);
<-- do whatever you wanna do with string -->


Of course, there is also internal working of how these strings are represented inside of resource section, but that's different as I assume that not many developers know how resource section looks like, not to mention how certain stuff inside of resource data is organized