zoukankan      html  css  js  c++  java
  • Windows获取线程起始地址

    typedef enum _THREADINFOCLASS {
        ThreadBasicInformation,
        ThreadTimes,
        ThreadPriority,
        ThreadBasePriority,
        ThreadAffinityMask,
        ThreadImpersonationToken,
        ThreadDescriptorTableEntry,
        ThreadEnableAlignmentFaultFixup,
        ThreadEventPair_Reusable,
        ThreadQuerySetWin32StartAddress,
        ThreadZeroTlsCell,
        ThreadPerformanceCount,
        ThreadAmILastThread,
        ThreadIdealProcessor,
        ThreadPriorityBoost,
        ThreadSetTlsArrayAddress,
        ThreadIsIoPending,
        ThreadHideFromDebugger,
        ThreadBreakOnTermination,
        MaxThreadInfoClass
    } THREADINFOCLASS;
    
    typedef LONG (WINAPI *NtQueryInformationThreadProc)(
        _In_       HANDLE ThreadHandle,
        _In_       THREADINFOCLASS ThreadInformationClass,
        _Inout_    PVOID ThreadInformation,
        _In_       ULONG ThreadInformationLength,
        _Out_opt_  PULONG ReturnLength
        );
    
    NtQueryInformationThreadProc   NtQueryInformationThread = NULL;
    hNtdll                      = GetModuleHandleW(L"ntdll.dll");
    NtQueryInformationThread    = (NtQueryInformationThreadProc)GetProcAddress(hNtdll, "NtQueryInformationThread");
    
    HANDLE  hThread = NULL;
    PVOID   pvStart = NULL;
    hThread = OpenThread(THREAD_QUERY_INFORMATION | THREAD_TERMINATE, FALSE, te32.th32ThreadID);
    NtQueryInformationThread(hThread, ThreadQuerySetWin32StartAddress, &pvStart, sizeof(pvStart), NULL);
  • 相关阅读:
    css笔记
    js面向对象开发之--元素拖拽
    git命令笔记
    数据扁平化笔记。
    手写冒泡排序
    ant design-Table组件实现每一行某个特定字段连续相同进行行合并。
    Array.prototype.reduce()。
    I/O多路复用
    TCP/IP四层体系结构
    TCP的三次握手和四次挥手,为什么?
  • 原文地址:https://www.cnblogs.com/codeape/p/3745629.html
Copyright © 2011-2022 走看看