title: Get Name / Description Startaddress Or From A Thread In A Process ( Delphi/Pascal )
body: <p>Process Hacker has a process manager in C.   </p>
  
  <p>When you double-click in process manager on a process e.g. Explorer<br>
  You see a lot of info, including:<br>
  Topics related to the process. PDD, Cycles Delta Start, Address, priority.  </p>
  
  <p>Well I tried to do something similar in Delphi, but I get only the TID and priority ...<br>
  I can not put the info Start Address as follows: "msiltcfg.dll 0x258!" or can only return
  00630EFA.</p>
  
  <p>The (Original) Application Process Hacker show the information in the image below:</p>
  
  <p><img src="https://i.stack.imgur.com/32AHa.png" alt="http://i54.tinypic.com/mrcztx.png"></p>
  
  <p>How do I solve this? based on the code example below.</p>
  
  <pre><code>procedure TForm1.Button7Click (Sender: TObject);
  var
    tbi: THREAD_BASIC_INFORMATION;
    hThreadSnap, Process, hThread, ThreadInfo: THandle;
    te32: tagTHREADENTRY32;
    me32: MODULEENTRY32;
    th32: THREADENTRY32;
    dwPID: DWORD;
  
    startaddr: Pointer;
    Status: LongInt;
    Error: DWORD;
    modname: String;
    hToken: DWORD;
    TKP: TOKEN_PRIVILEGES;
    otkp: TOKEN_PRIVILEGES;
    dwLen: dword;
  
  
  begin
    hThreadSnap: = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0);
    if hThreadSnap = INVALID_HANDLE_VALUE then 
     Exit;
    try
      dwPID: = GetProcessID (Trim (Edit1.Text));
  
      te32.dwSize: = SizeOf (THREADENTRY32);
  
      me32.dwSize: = SizeOf (MODULEENTRY32);
  
      ListBox1.Items.Clear;
      ListBox2.Items.Clear;
  
      if not Thread32First (hThreadSnap, te32) then
        Exit;
  
      repeat
        if te32.th32OwnerProcessID = dwPID then 
        begin
          hThread: = OpenThread (THREAD_ALL_ACCESS,
          False, te32.th32ThreadID);
          status: = ZwQueryInformationThread (hThread,
          9, 
          ThreadQuerySetWin32StartAddress {}
          @Startaddr,
          SizeOf (startaddr)
          @ DwLen);
  
          listbox1.Items.AddObject (Format ('StartAddress:% p'
          [Startaddr]) + 'ID:' + IntToStr(te32.th32ThreadID), TObject (hThread));
  
          if hThread &lt;&gt; 0 then
            CloseHandle (hThread);
        end;
      Until not Thread32Next (hThreadSnap, te32);
    finally
      CloseHandle (hThreadSnap);
    end;
  end;
  </code></pre>