How do I modify buffer
in following code then save the changes in resource of the executable? I'm looking for something like SetString(handle,index,buffer,size)
.
var
hExe : Cardinal;
buffer : array [0..4097] of ansichar;
begin
hExe:=LoadLibraryEx(PAnsiChar(Edit2.Text),0,LOAD_LIBRARY_AS_DATAFILE);
LoadString(hExe,65300,buffer,SizeOf(buffer));
ShowMessage(buffer);
//need to modify buffer here then I'll unload the resources..
end;
Update: Here's my attempt on UpdateResource
var
hEXE: DWORD;
pData: PAnsiChar;
begin
pData := PAnsiChar(Edit1.Text);
hEXE := BeginUpdateResource(pchar(edit2.text), FALSE);
if hEXE <> 0 then
begin
UpdateResource(hEXE, RT_string, MAKEINTRESOURCE(4082), LANG_NEUTRAL,
@pData, Length(pData)); //if i change 4082 to 65300 it creates another key like 4082
EndUpdateResource(hEXE, FALSE);
end;
This code messes up the whole 4082 content. The problem is item named 4082 in RT_STRING is group of strings. When I open the exe in a resource editor, click string table then 4082 the result is:
STRINGTABLE
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
{
65296, "Unicode"
65297, "Big Endian Unicode"
65298, "UTF-8"
65299, "UTF-7"
65300, "ABCDE12345"
}
So I either need to parse the string group or I need an API to set modify string with the index 65300 in the group. Any ideas?