Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7803105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:27:59+00:00 2026-06-02T01:27:59+00:00

I’m writing a process viewer, its 99% complete, I just need get the start

  • 0

I’m writing a process viewer, its 99% complete, I just need get the start address of a process’ thread, but I don’t know how do it.
Can anyone help-me? :/
Thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:28:01+00:00Added an answer on June 2, 2026 at 1:28 am

    You can use the NtQueryInformationThread function passing the ThreadQuerySetWin32StartAddress value of the THREAD_INFORMATION_CLASS enumeration as parameter.

    check this sample app

    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
      TlHelp32,
      Windows,
      SysUtils;
    
    
    const
      THREAD_QUERY_INFORMATION   = $0040;
      STATUS_SUCCESS             = $00000000;
      ThreadQuerySetWin32StartAddress = 9;
    
    type
      NTSTATUS = LONG;
      THREADINFOCLASS = DWORD;
    
    function NtQueryInformationThread(
        ThreadHandle: THandle;  ThreadInformationClass: THREADINFOCLASS;
        ThreadInformation: Pointer; ThreadInformationLength: ULONG;  ReturnLength: PULONG): NTSTATUS; stdcall; external 'ntdll.dll';
    
    function OpenThread(dwDesiredAccess: DWord;
                        bInheritHandle: Bool;
                        dwThreadId: DWord): DWord; stdcall; external 'kernel32.dll';
    
    
    function GetThreadStartAddress(th32ThreadID : DWORD) : Pointer;
    var
      hThread : THandle;
      ThreadStartAddress : Pointer;
    begin
      Result:=0;
      hThread := OpenThread(THREAD_QUERY_INFORMATION , false, th32ThreadID);
      if (hThread = 0) then RaiseLastOSError;
      try
        if NtQueryInformationThread(hThread, ThreadQuerySetWin32StartAddress, @ThreadStartAddress, SizeOf(ThreadStartAddress), nil) = STATUS_SUCCESS then
          Result:=ThreadStartAddress
        else
        RaiseLastOSError;
      finally
          CloseHandle(hThread);
      end;
    end;
    
    function GetThreadsList(th32ProcessID:DWORD): Boolean;
    var
      hSnapshot     : THandle;
      NextThread    : Boolean;
      TThreadEntry  : TThreadEntry32;
    begin
      hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); //Takes a snapshot of the all threads
      Result := (hSnapshot <> INVALID_HANDLE_VALUE);
      if Result then
        try
          TThreadEntry.dwSize := SizeOf(TThreadEntry);
          NextThread := Thread32First(hSnapshot, TThreadEntry);//get the first Thread
          while NextThread do
          begin
            if TThreadEntry.th32OwnerProcessID = th32ProcessID then //Check the owner Pid against the PID requested
                Writeln(Format('Thread Id %.8x Start Address %p',[TThreadEntry.th32ThreadID, GetThreadStartAddress(TThreadEntry.th32ThreadID)]));
            NextThread := Thread32Next(hSnapshot, TThreadEntry);//get the Next Thread
          end;
        finally
          CloseHandle(hSnapshot);
        end;
    end;
    
    begin
      try
        GetThreadsList(4028);
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
      readln;
    end.
    

    Note : to get access to some system process you will need set SeDebugPrivilege privilege in your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.