Hello, I have now been for a few hours trying to update a String resource in another .exe file, but with no success so far.
Here is what I want to do:
IWantToUpdateAStringHere.exe (basically does: MessageBox(String1FromSt, String2FromST))
StringTable with 2 entries:
IDS_Hello 102 "Hello"
IDS_World 103 "World"
When I run this file I get a MessageBox that says has Hello as the title and World as the text.
Now I want to edit these resources by updating a string in the StringTable from another .exe, so that I could, for example, get the output Hello Test. But I always end up either creating a new StringTable and not updating the actual resource, or I overwrite the entire resource, and the actual program crashes.
I have been trying to find a proper example of how to do this, but I am not able to find a solution for String Tables.
Here is the code I use in the update.exe file:
Thanks in advance for any help!
Here is what I want to do:
IWantToUpdateAStringHere.exe (basically does: MessageBox(String1FromSt, String2FromST))
StringTable with 2 entries:
IDS_Hello 102 "Hello"
IDS_World 103 "World"
When I run this file I get a MessageBox that says has Hello as the title and World as the text.
Now I want to edit these resources by updating a string in the StringTable from another .exe, so that I could, for example, get the output Hello Test. But I always end up either creating a new StringTable and not updating the actual resource, or I overwrite the entire resource, and the actual program crashes.
I have been trying to find a proper example of how to do this, but I am not able to find a solution for String Tables.
Here is the code I use in the update.exe file:
Code
HANDLE hUpdateRes = BeginUpdateResource(TEXT("Test.exe"), FALSE);
TCHAR sz[] = TEXT("Test");
BOOL result = UpdateResource(hUpdateRes, RT_STRING, L"IDS_Hello", MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), (void*)sz, (lstrlen(sz) + 4));
BOOL commit = EndUpdateResource(hUpdateRes, FALSE);Thanks in advance for any help!



![[Image: chain.png]](https://i.postimg.cc/NFnfH9zY/chain.png)