ptrace Package¶
cpu_info
Module¶
Constants about the CPU:
- CPU_BIGENDIAN (bool)
- CPU_64BITS (bool)
- CPU_WORD_SIZE (int)
- CPU_MAX_UINT (int)
- CPU_PPC32 (bool)
- CPU_PPC64 (bool)
- CPU_I386 (bool)
- CPU_X86_64 (bool)
- CPU_INTEL (bool)
- CPU_POWERPC (bool)
ctypes_errno
Module¶
Function get_errno(): get the current errno value.
- Try different implementations:
- ctypes_support.get_errno() function
- __errno_location_sym symbol from the C library
- PyErr_SetFromErrno() from the C Python API
ctypes_libc
Module¶
- Load the system C library. Variables:
- LIBC_FILENAME: the C library filename
- libc: the loaded library
ctypes_tools
Module¶
-
FingerPrint.ptrace.ctypes_tools.
bytes2array
(bytes, basetype, size)[source]¶ Cast a bytes string to an array of objets of the specified type and size.
-
FingerPrint.ptrace.ctypes_tools.
bytes2type
(bytes, type)[source]¶ Cast a bytes string to an objet of the specified type.
-
FingerPrint.ptrace.ctypes_tools.
bytes2word
(bytes)[source]¶ Convert a bytes string to an unsigned integer (a CPU word).
-
FingerPrint.ptrace.ctypes_tools.
formatAddress
(address)[source]¶ Format an address to hexadecimal. Return “NULL” for zero.
-
FingerPrint.ptrace.ctypes_tools.
formatAddressRange
(start, end)[source]¶ Format an address range, eg. “0x80004000-0x8000ffff”.
-
FingerPrint.ptrace.ctypes_tools.
formatWordHex
(value)¶ Format an 64 bits unsigned integer.
-
FingerPrint.ptrace.ctypes_tools.
int2uint
(value)¶ Convert a signed 32 bits integer into an unsigned 32 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
int2uint32
(value)[source]¶ Convert a signed 32 bits integer into an unsigned 32 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
int2uint64
(value)[source]¶ Convert a signed 64 bits integer into an unsigned 64 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
long2ulong
(value)¶ Convert a signed 64 bits integer into an unsigned 64 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
ntoh_uint
(value)[source]¶ Convert an unsigned integer from network endiant to host endian.
-
FingerPrint.ptrace.ctypes_tools.
ntoh_ushort
(value)[source]¶ Convert an unsigned short integer from network endiant to host endian.
-
FingerPrint.ptrace.ctypes_tools.
truncateWord
(value)¶ Truncate an unsigned integer to 64 bits.
-
FingerPrint.ptrace.ctypes_tools.
truncateWord32
(value)[source]¶ Truncate an unsigned integer to 32 bits.
-
FingerPrint.ptrace.ctypes_tools.
truncateWord64
(value)[source]¶ Truncate an unsigned integer to 64 bits.
-
FingerPrint.ptrace.ctypes_tools.
uint2int
(value)¶ Convert an unsigned 32 bits integer into a signed 32 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
uint2int32
(value)[source]¶ Convert an unsigned 32 bits integer into a signed 32 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
uint2int64
(value)[source]¶ Convert an unsigned 64 bits integer into a signed 64 bits integer.
-
FingerPrint.ptrace.ctypes_tools.
ulong2long
(value)¶ Convert an unsigned 64 bits integer into a signed 64 bits integer.
error
Module¶
-
exception
FingerPrint.ptrace.error.
PtraceError
(message, errno=None, pid=None)[source]¶ Bases:
exceptions.Exception
Ptrace error: have the optional attributes errno and pid.
func
Module¶
linux_struct
Module¶
-
class
FingerPrint.ptrace.linux_struct.
siginfo
[source]¶ Bases:
_ctypes.Structure
-
pad
¶ Structure/Union member
-
si_code
¶ Structure/Union member
-
si_errno
¶ Structure/Union member
-
si_signo
¶ Structure/Union member
-
-
class
FingerPrint.ptrace.linux_struct.
user_fpregs_struct
[source]¶ Bases:
_ctypes.Structure
-
cwd
¶ Structure/Union member
-
fop
¶ Structure/Union member
-
ftw
¶ Structure/Union member
-
mxcr_mask
¶ Structure/Union member
-
mxcsr
¶ Structure/Union member
-
padding
¶ Structure/Union member
-
rdp
¶ Structure/Union member
-
rip
¶ Structure/Union member
-
st_space
¶ Structure/Union member
-
swd
¶ Structure/Union member
-
xmm_space
¶ Structure/Union member
-
-
class
FingerPrint.ptrace.linux_struct.
user_regs_struct
[source]¶ Bases:
_ctypes.Structure
-
cs
¶ Structure/Union member
-
ds
¶ Structure/Union member
-
eflags
¶ Structure/Union member
-
es
¶ Structure/Union member
-
fs
¶ Structure/Union member
-
fs_base
¶ Structure/Union member
-
gs
¶ Structure/Union member
-
gs_base
¶ Structure/Union member
-
orig_rax
¶ Structure/Union member
-
r10
¶ Structure/Union member
-
r11
¶ Structure/Union member
-
r12
¶ Structure/Union member
-
r13
¶ Structure/Union member
-
r14
¶ Structure/Union member
-
r15
¶ Structure/Union member
-
r8
¶ Structure/Union member
-
r9
¶ Structure/Union member
-
rax
¶ Structure/Union member
-
rbp
¶ Structure/Union member
-
rbx
¶ Structure/Union member
-
rcx
¶ Structure/Union member
-
rdi
¶ Structure/Union member
-
rdx
¶ Structure/Union member
-
rip
¶ Structure/Union member
-
rsi
¶ Structure/Union member
-
rsp
¶ Structure/Union member
-
ss
¶ Structure/Union member
-
os_tools
Module¶
Constants about the operating system:
- RUNNING_PYPY (bool)
- RUNNING_WINDOWS (bool)
- RUNNING_LINUX (bool)
- RUNNING_FREEBSD (bool)
- RUNNING_OPENBSD (bool)
- RUNNING_MACOSX (bool)
- RUNNING_BSD (bool)
- HAS_PROC (bool)
- HAS_PTRACE (bool)
signames
Module¶
Name of process signals.
SIGNAMES contains a dictionary mapping a signal number to it’s name. But you should better use signalName() instead of SIGNAMES since it returns a string even if the signal is unknown.