ReactOS  0.4.15-dev-1206-g731eddf
pteb.c
Go to the documentation of this file.
1 #include <ntos.h>
2 #include <stdio.h>
3 
4 
5 int main(int argc, char* argv[])
6 {
7  int x;
8  PTEB Teb;
9 
10  printf("TEB dumpper\n");
11  __asm__("movl %%fs:0x18, %0\n\t"
12  : "=a" (x)
13  : /* no inputs */);
14  printf("fs[0x18] %x\n", x);
15 
16  Teb = (PTEB)x;
17 
18  printf("StackBase: 0x%08lX\n", (DWORD)Teb->Tib.StackBase);
19  printf("StackLimit: 0x%08lX\n", (DWORD)Teb->Tib.StackLimit);
20  printf("DeallocationStack: 0x%08lX\n", (DWORD)Teb->DeallocationStack);
21 
22  return(0);
23 }
static int argc
Definition: ServiceArgs.c:12
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define argv
Definition: mplay32.c:18
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
NT_TIB Tib
Definition: compat.h:696
PVOID DeallocationStack
Definition: compat.h:737
unsigned long DWORD
Definition: ntddk_ex.h:95
int main(int argc, char *argv[])
Definition: pteb.c:5
Definition: compat.h:694
PVOID StackBase
Definition: compat.h:571
struct _TEB * PTEB
PVOID StackLimit
Definition: compat.h:572
#define printf
Definition: config.h:203