Advertisement
Anaryl

my_debugger_defines.py

Sep 26th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. ###My Debugger my_debugger_defines.py
  2. ###Anaryl
  3.  
  4. from ctypes import *
  5.  
  6.  
  7. # Let's map the Microsoft types to ctypes for clarity
  8.  
  9. WORD = c_ushort
  10. DWORD = c_ulong
  11. LPBYTE = POINTER(c_ubyte)
  12. LPTSTR = POINTER(c_char)
  13. HANDLE = c_void_p
  14.  
  15. # Constants
  16.  
  17. DEBUG_PROCESS = 0x00000001
  18. CREATE_NEW_CONSOLE = 0x00000010
  19.  
  20. # Structures for CreateProcessA() function
  21. class STARTUPINFO(Structure):
  22.     _fields_ = [
  23.         ("cb", DWORD),
  24.         ("lpReserved", LPTSTR),
  25.         ("lpDesktop", LPTSTR),
  26.         ("lpTitle", LPTSTR),
  27.         ("dwX", DWORD),
  28.         ("dwY", DWORD),
  29.         ("dwXSize", DWORD),
  30.         ("dwYSize", DWORD),
  31.         ("dwXCountChars", DWORD),
  32.         ("dwYCountChars", DWORD),
  33.         ("dwFillAttribute",DWORD),
  34.         ("dwFlags", DWORD),
  35.         ("wShowWindow", WORD),
  36.         ("cbReserved2", WORD),
  37.         ("lpReserved2", LPBYTE),
  38.         ("hStdInput", HANDLE),
  39.         ("hStdOutput", HANDLE),
  40.         ("hStdError", HANDLE),
  41.     ]
  42. class PROCESS_INFORMATION(Structure):
  43.     _fields_ = [
  44.         ("hProcess", HANDLE),
  45.         ("hThread", HANDLE),
  46.         ("dwProcessId", DWORD),
  47.         ("dwThreadId", DWORD),
  48.     ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement