字符串表资源 ID 存储在哪里?我能够在表格中列出字符串,但似乎没有任何类型的标识符“原始资源”它只是一个(数组)USHORT(长度)后跟宽字符(字符串),有没有标识符。
PIMAGE_RESOURCE_DIR_STRING_U = ^TIMAGE_RESOURCE_DIR_STRING_U;
TIMAGE_RESOURCE_DIR_STRING_U = Record
Count : USHORT;//Word;
Name : Array [0..0] of WideChar;
End;
PIMAGE_RESOURCE_DATA =^TIMAGE_RESOURCE_DATA;
TIMAGE_RESOURCE_DATA = Record
rt_type : DWORD; //RT_STRING
lpName : ShortString; //tables name
Address : PDWORD; //address of the table
dwSize : DWORD; //size of the data
end;
procedure GUIDataToString(IRD: TIMAGE_RESOURCE_DATA);
Type
TStringArray = Array of String;
Function SplitString(P: PByte; dwplen: Int32): TStringArray;
//P is a Pointer to the string table, dwPLen is the size of the table
Var
Index : Int32;
offset: Int32;
dwLen : WORD;
ST_ID : NativeUInt;
rt_str: PIMAGE_RESOURCE_DIR_STRING_U;
Begin
Index := 0; //String Index
offset:= 0;
while (offset <= dwplen) do
Begin
SetLength(Result, Length(Result)+1);
rt_str := PIMAGE_RESOURCE_DIR_STRING_U(@P[offset]);
Result[Index] := NameToStr(rt_str);
//
Inc(offset, (rt_str.Count * sizeof(WideChar) )+ sizeof(WORD));
Inc(Index);
End;
End;
Var
Table : TStringArray;
dwStrings : DWORD;
I : Int32;
//d :
begin
Table := SplitString(PByte(IRD.Address), IRD.dwSize);
dwStrings := Length(Table);
Memo1.Lines.Add('STRINGTABLE');
Memo1.Lines.Add('{');
for I := 0 to dwStrings-1 do
Begin
Memo1.Lines.Add(#9+Table[I]); //#9 is TAB
End;
Memo1.Lines.Add('}');
end;
我读过resourcestring(type) can be cast to a PResStringRec
whos .Identifier
field will give an identifier但是,我尝试使用我的“原始字符串”,它是一个随机的大数(比较的IDs resedit给出),关于如何找到ID的任何建议?