Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

  1. #ifndef _CLEVEL_H_
  2. #define _CLEVEL_H_
  3. //
  4. // Constant declarations
  5. //
  6. //
  7. // Structure definitions
  8. //
  9. typedef struct _CALLRETSTUB
  10. {
  11. CHAR PUSHDWORD[5]; //push xxxxxxxx (68 dword)
  12. CHAR JMPDWORD[6]; //jmp dword ptr [xxxxxxxx] (ff 25 dword address)
  13. } CALLRETSTUB, *PCALLRETSTUB;
  14. typedef struct _FIXUPRETURN
  15. {
  16. BYTE PUSHAD; //pushad (60)
  17. BYTE PUSHFD; //pushfd (9c)
  18. BYTE PUSHDWORDESPPLUS24[4]; //push dword ptr [esp+24] (ff 74 24 24)
  19. BYTE CALLROUTINE[6]; //call [address] (ff15 dword address)
  20. BYTE MOVESPPLUS24EAX[4]; //mov [esp+0x24],eax (89 44 24 24)
  21. BYTE POPFD; //popfd (9d)
  22. BYTE POPAD; //popad (61)
  23. BYTE RET; //ret (c3)
  24. } FIXUPRETURN, *PFIXUPRETURN;
  25. typedef struct _CALLERINFO
  26. {
  27. DWORD dwIdentifier;
  28. DWORD dwCallLevel;
  29. PVOID pCallRetStub;
  30. PVOID pReturn;
  31. struct _CALLERINFO *pNextChain;
  32. } CALLERINFO, *PCALLERINFO;
  33. //
  34. // Function definitions
  35. //
  36. BOOL
  37. PushCaller(PVOID ptfInfo,
  38. PVOID pEsp);
  39. PVOID
  40. PopCaller(DWORD dwIdentifier);
  41. PCALLRETSTUB
  42. AllocateReturnStub(PVOID ptfInfo);
  43. #endif //_CLEVEL_H_