I made a program in C using the Win32 API. I managed to modify some images and save them in a file. I'm trying to modify a string table but I can't. I only managed to display it as a normal string.
Image from Resource Tuner:
My C code:
#include <windows.h>
int main() {
const char* dllPath = "path/to/your_dll.dll";
const int resourceID = 296;
const char* newText = "Hello World";
HANDLE hUpdate = BeginUpdateResource(dllPath, FALSE);
if (hUpdate == NULL) {
return 1;
}
BOOL result = UpdateResource(hUpdate, RT_STRING, MAKEINTRESOURCE(resourceID), MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), (LPVOID)newText, strlen(newText) + 1);
if (result == FALSE) {
EndUpdateResource(hUpdate, TRUE);
return 1;
}
result = EndUpdateResource(hUpdate, FALSE);
if (result == FALSE) {
return 1;
}
return 0;
}
My String is to address 296. After some work, I get this result, but it isn't recognized by the Software that uses this .dll
file.
It was represented like this: 'Hello World'
without any table indentation.
I tried to build the same as there, with the same structure, but it is still recognized as a single string, not as a string table.