title: Finding a stringtable resource ID
body: <p>Where is a string-table resource ID stored? I am able to list the strings in a table but there doesn't appear to be any kind of identifier the "raw resource" it is just an (array of) USHORT (length) followed by wide chars (the string), there is no identifier.</p>
  
  <pre><code>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 &lt;= 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;
  </code></pre>
  
  <p>I read resourcestring(type) can be cast to a <code>PResStringRec</code> whos <code>.Identifier</code> field will give an identifier but, I tried with my "raw strings" and it's a random large number (compared IDs resedit gives), any suggestions on how to find the IDs?</p>
  
  <p><a href="https://i.imgur.com/kRGmiKG.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/kRGmiKG.png" alt="image"></a></p>