Package src ::
Module pyfault_defines
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 '''
19 This provides the constants the main pyfault class uses for process access, memory writes, etc.
20 Some of these were gleaned from MSDN (http://msdn.microsoft.com) and the module structure is
21 referring to a code snippet in the PaiMei framework (http://paimei.openrce.org) by Pedram Amini, although I
22 changed the ctypes type of hModule to be slightly different.
23 '''
24
25 import ctypes
26
27 INVALID_HANDLE_VALUE = 0xFFFFFFFF
28 PAGE_READWRITE = 0x04
29 PROCESS_ALL_ACCESS = ( 0x000F0000 | 0x00100000 | 0xFFF )
30 TH32CS_SNAPMODULE = 0x00000008
31 VIRTUAL_MEM = ( 0x1000 | 0x2000 )
32
33
34
35 -class MODULEENTRY32(ctypes.Structure):
36 _fields_ = [
37 ("dwSize", ctypes.c_ulong),
38 ("th32ModuleID", ctypes.c_ulong),
39 ("th32ProcessID", ctypes.c_ulong),
40 ("GlblcntUsage", ctypes.c_ulong),
41 ("ProccntUsage", ctypes.c_ulong),
42 ("modBaseAddr", ctypes.c_ulong),
43 ("modBaseSize", ctypes.c_ulong),
44 ("hModule", ctypes.c_void_p),
45 ("szModule", ctypes.c_char * 256),
46 ("szExePath", ctypes.c_char * 260),
47 ]
48