Hi,
im trying to load a string table from an elf binary using .rc files and windres. When compiling it creates the file "deash.ro" with the strings ("Hello" and "Goodbye"), however these do not appear in the binary. I found that resources on how to create resources in an elf binary using fpc are quite lacking also.
My Resource File looks like this:
#define IDS_HELLO 1
#define IDS_GOODBYE 2
STRINGTABLE
{
IDS_HELLO, "Hello"
IDS_GOODBYE, "Goodbye"
}
Some stackoverflow also seemed to suggest that embedding resources is not supported by elf, which would suprise because of the existance of the TElfResourceReader class.
IMPORTANT EDIT:
The strings are embedded into the ELF file just in UTF-16, what the issue is now is that I cannot read anything from the string table it results in an access violation.
Heres my code for reading the string table (its cobbled together to test it before i actually making it pretty, so please pardon me
)
function GetResourceString(const AId: String): String;
var
ress: TResources;
res: TAbstractResource;
res_reader: TElfResourceReader;
str_stream: TStringStream;
_str: String;
begin
result := '';
res_reader := TElfResourceReader.Create;
ress := TResources.Create;
ress.loadfromfile(ParamStr(0),res_reader);
res_reader.Free;
res := ress.find(RT_STRING, 1);
ress.Free;
writeln(TStringTableResource(res).strings[0]);
end;