Access x64 TEB C++ & Assembly
问题 In 32-bit assembly, I can access the ProcessEnvironmentBlock of the TEB structure. From there I access Ldr of the TEB structure. This technique is described here: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block The code to do this in 32-bit assembly is: void* ptr = NULL; __asm { mov eax, FS:[0x18] mov eax, [eax + 0x30] //Offset of PEB mov eax, [eax + 0x0C] //Offset of LDR in PEB structure mov eax, _ptr }; std::cout<<ptr<<"\n"; The TEB structure can be seen here: http://msdn