rapid7 / metasploit-payloads

Unified repository for different Metasploit Framework payloads
Other
1.75k stars 673 forks source link

GetThreadId/OpenThreadToken not available in kernel32 in Windows XP sp2/sp3 with MingW #712

Closed wolfcod closed 2 months ago

wolfcod commented 3 months ago

This patch fixes two issues on Windows XP:

  1. GetThreadId not available on Windows XP sp2/sp3 (according to MSDN, it's present only from NT 5.2)
  2. OpenThreadToken is present in ADVAPI32.dll as API, but the same API is available in kernel32 in mingw-x86, which doesn't reflect the exported symbol of kernel32 on XP.