开发者

Get current locale of a thread in another Windows process

开发者 https://www.devze.com 2023-03-01 07:12 出处:网络
Is it possible to get current locale of a thread living inside another Windows process? Is there a utility that shows 开发者_运维知识库this or maybe a Win32 API call?The locale is stored in the TEB, s

Is it possible to get current locale of a thread living inside another Windows process? Is there a utility that shows 开发者_运维知识库this or maybe a Win32 API call?


The locale is stored in the TEB, so you would have to be able to open the process with PROCESS_VM_READ rights and the thread with THREAD_QUERY_INFORMATION and then call OpenThread()+NtQueryInformationThread(ThreadBasicInformation) and then get the TEB address in THREAD_BASIC_INFORMATION and read it with ReadProcessMemory().

All of this is undocumented and could change at any time, you also need to handle WOW64 etc...


There's no API call for this. Assuming that you can't modify the target app to provide the information on demand, the only solution I can see is a global hook. This allows you to inject your code into the thread in question.

0

精彩评论

暂无评论...
验证码 换一张
取 消