In Windows, for a long time it was common, if not documented, to know that the stream information block (TIB) of the current stream can be found in FS: 0. But this only works on Intel processors where the FS register exists. Now I want to get into TIB on an ARM-based Windows system (Windows Phone and possibly Windows RT). Is there an API for this, please?
EDIT: I want to get a thread stack base for crash reporting purposes.
TIB / TEB Information: http://www.microsoft.com/msj/archive/S2CE.aspx
NtCurrentTeb() winnt.h , ARM (Windows RT):
NtCurrentTeb()
winnt.h
#if defined(_M_ARM) && !defined(__midl) && !defined(_M_CEE_PURE) __forceinline struct _TEB * NtCurrentTeb ( VOID ) { return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW); }
, NtQueryInformationThread() THREAD_BASIC_INFORMATION, TIB TebBaseAddress.
NtQueryInformationThread()
THREAD_BASIC_INFORMATION
TIB
TebBaseAddress
Igor nailed it. But FYI, in the ARM assembly, looks like this:
mrc p15, 0, r12, c13, c0, 2 ; r12 now points at TEB/TIB ldr r12, [r12, #4] ; r12 now holds stack base
Source: https://habr.com/ru/post/1683801/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1683796/efficiently-using-numpy-to-assign-function-values-to-array&usg=ALkJrhj73fmLxYAdv87ieWVDb2Le02Nu1wHow can I work with F # in Visual Studio 2017 version 15.3? - visual-studioFailure in UIMA ruta - apacheFree TLS Pointers for each topic - cWhich design template to use (if any)? - javaHow to run script task from bamboo plugin? - bamboobash team for a group of accounts - bashWhat is the difference between exit and exit in the hive - hiveIs there a Kotlin equivalent for AssertJ library? - assertionsRewrite url: remove subfolders and file extension from url - phpAll Articles