structs ¤
Classes:
-
c_pvoid
–Represents a pointer.
-
c_size_t
–Represents a size_t.
-
FakeGDBField
–Fake gdb.Field for compatibility
-
CStruct2GDB
– -
c_malloc_state_2_26
–This class represents malloc_state struct for GLIBC < 2.27 as a ctypes struct.
-
c_malloc_state_2_12
–This class represents malloc_state struct for GLIBC < 2.22 as a ctypes struct.
-
c_malloc_state_2_27
–This class represents malloc_state struct for GLIBC >= 2.27 as a ctypes struct.
-
MallocState
–This class represents malloc_state struct with interface compatible with
pwndbg.dbg_mod.Value
. -
c_heap_info
–This class represents heap_info struct as a ctypes struct.
-
HeapInfo
–This class represents heap_info struct with interface compatible with
pwndbg.dbg_mod.Value
. -
c_malloc_chunk
–This class represents malloc_chunk struct as a ctypes struct.
-
MallocChunk
–This class represents malloc_chunk struct with interface compatible with
pwndbg.dbg_mod.Value
. -
c_tcache_perthread_struct_2_29
–This class represents tcache_perthread_struct for GLIBC < 2.30 as a ctypes struct.
-
c_tcache_perthread_struct_2_30
–This class represents the tcache_perthread_struct for GLIBC >= 2.30 as a ctypes struct.
-
TcachePerthreadStruct
–This class represents tcache_perthread_struct with interface compatible with
pwndbg.dbg_mod.Value
. -
c_tcache_entry_2_28
–This class represents the tcache_entry struct for GLIBC < 2.29 as a ctypes struct.
-
c_tcache_entry_2_29
–This class represents the tcache_entry struct for GLIBC >= 2.29 as a ctypes struct.
-
TcacheEntry
–This class represents the tcache_entry struct with interface compatible with
pwndbg.dbg_mod.Value
. -
c_malloc_par_2_23
–This class represents the malloc_par struct for GLIBC < 2.24 as a ctypes struct.
-
c_malloc_par_2_12
–This class represents the malloc_par struct for GLIBC < 2.15 as a ctypes struct.
-
c_malloc_par_2_24
–This class represents the malloc_par struct for GLIBC >= 2.24 as a ctypes struct.
-
c_malloc_par_2_26
–This class represents the malloc_par struct for GLIBC >= 2.26 as a ctypes struct.
-
c_malloc_par_2_35
–This class represents the malloc_par struct for GLIBC >= 2.35 as a ctypes struct.
-
MallocPar
–This class represents the malloc_par struct with interface compatible with
pwndbg.dbg_mod.Value
.
Functions:
Attributes:
-
GLIBC_VERSION
– -
SIZE_SZ
– -
MINSIZE
– -
MALLOC_ALIGN
– -
long_double_alignment
– -
MALLOC_ALIGN_MASK
– -
MAX_FAST_SIZE
– -
NBINS
– -
BINMAPSIZE
– -
TCACHE_MAX_BINS
– -
NFASTBINS
– -
PTR
– -
SIZE_T
– -
DEFAULT_TOP_PAD
– -
DEFAULT_MMAP_MAX
– -
DEFAULT_MMAP_THRESHOLD
– -
DEFAULT_TRIM_THRESHOLD
– -
DEFAULT_PAGE_SIZE
– -
TCACHE_FILL_COUNT
– -
C2GDB_MAPPING
– -
DEFAULT_MP_
–
C2GDB_MAPPING module-attribute
¤
C2GDB_MAPPING = {
c_char: char,
c_int8: int8,
c_int16: int16,
c_int32: int32,
c_int64: int64,
c_uint8: uint8,
c_uint16: uint16,
c_uint32: uint32,
c_uint64: uint64,
c_pvoid: pvoid,
c_size_t: size_t,
}
FakeGDBField ¤
FakeGDBField(
bitpos: int,
name: str | None,
type,
parent_type,
enumval: int | None = None,
artificial: bool = False,
is_base_class: bool = False,
bitsize: int = 0,
)
Fake gdb.Field for compatibility
Attributes:
-
bitpos
– -
name
– -
type
– -
parent_type
– -
enumval
– -
artificial
– -
is_base_class
– -
bitsize
–
CStruct2GDB ¤
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_malloc_state_2_26 ¤
Bases: Structure
This class represents malloc_state struct for GLIBC < 2.27 as a ctypes struct.
struct malloc_state { /* Serialize access. */ __libc_lock_define (, mutex);
/* Flags (formerly in max_fast). */
int flags;
/* Fastbins */
mfastbinptr fastbinsY[NFASTBINS];
/* Base of the topmost chunk -- not otherwise kept in a bin */
mchunkptr top;
/* The remainder from the most recent split of a small request */
mchunkptr last_remainder;
/* Normal bins packed as described above */
mchunkptr bins[NBINS * 2 - 2];
/* Bitmap of bins */
unsigned int binmap[BINMAPSIZE];
/* Linked list */
struct malloc_state *next;
/* Linked list for free arenas. Access to this field is serialized
by free_list_lock in arena.c. */
struct malloc_state *next_free;
/* Number of threads attached to this arena. 0 if the arena is on
the free list. Access to this field is serialized by
free_list_lock in arena.c. */
INTERNAL_SIZE_T attached_threads;
/* Memory allocated from the system in this arena. */
INTERNAL_SIZE_T system_mem;
INTERNAL_SIZE_T max_system_mem;
};
c_malloc_state_2_12 ¤
Bases: Structure
This class represents malloc_state struct for GLIBC < 2.22 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.12/malloc/malloc.c#L2362-L2400
struct malloc_state { /* Serialize access. */ mutex_t mutex;
/* Flags (formerly in max_fast). */ int flags;
if THREAD_STATS¤
/* Statistics for locking. Only used if THREAD_STATS is defined. */ long stat_lock_direct, stat_lock_loop, stat_lock_wait;
endif¤
/* Fastbins */ mfastbinptr fastbinsY[NFASTBINS];
/* Base of the topmost chunk -- not otherwise kept in a bin */ mchunkptr top;
/* The remainder from the most recent split of a small request */ mchunkptr last_remainder;
/* Normal bins packed as described above */ mchunkptr bins[NBINS * 2 - 2];
/* Bitmap of bins */ unsigned int binmap[BINMAPSIZE];
/* Linked list */ struct malloc_state *next;
ifdef PER_THREAD¤
/* Linked list for free arenas. */ struct malloc_state *next_free;
endif¤
/* Memory allocated from the system in this arena. */ INTERNAL_SIZE_T system_mem; INTERNAL_SIZE_T max_system_mem; };
c_malloc_state_2_27 ¤
Bases: Structure
This class represents malloc_state struct for GLIBC >= 2.27 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/malloc.c#L1831
struct malloc_state { /* Serialize access. */ __libc_lock_define (, mutex);
/* Flags (formerly in max_fast). */
int flags;
/* Set if the fastbin chunks contain recently inserted free blocks. */
/* Note this is a bool but not all targets support atomics on booleans. */
int have_fastchunks;
/* Fastbins */
mfastbinptr fastbinsY[NFASTBINS];
/* Base of the topmost chunk -- not otherwise kept in a bin */
mchunkptr top;
/* The remainder from the most recent split of a small request */
mchunkptr last_remainder;
/* Normal bins packed as described above */
mchunkptr bins[NBINS * 2 - 2];
/* Bitmap of bins */
unsigned int binmap[BINMAPSIZE];
/* Linked list */
struct malloc_state *next;
/* Linked list for free arenas. Access to this field is serialized
by free_list_lock in arena.c. */
struct malloc_state *next_free;
/* Number of threads attached to this arena. 0 if the arena is on
the free list. Access to this field is serialized by
free_list_lock in arena.c. */
INTERNAL_SIZE_T attached_threads;
/* Memory allocated from the system in this arena. */
INTERNAL_SIZE_T system_mem;
INTERNAL_SIZE_T max_system_mem;
};
MallocState ¤
Bases: CStruct2GDB
This class represents malloc_state struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_heap_info ¤
Bases: Structure
This class represents heap_info struct as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/arena.c#L53
typedef struct _heap_info { mstate ar_ptr; /* Arena for this heap. / struct _heap_info *prev; / Previous heap. / size_t size; / Current size in bytes. / size_t mprotect_size; / Size in bytes that has been mprotected PROT_READ|PROT_WRITE. / / Make sure the following data is properly aligned, particularly that sizeof (heap_info) + 2 * SIZE_SZ is a multiple of MALLOC_ALIGNMENT. */ char pad[-6 * SIZE_SZ & MALLOC_ALIGN_MASK]; } heap_info;
HeapInfo ¤
Bases: CStruct2GDB
This class represents heap_info struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_malloc_chunk ¤
Bases: Structure
This class represents malloc_chunk struct as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/malloc.c#L1154
struct malloc_chunk {
INTERNAL_SIZE_T mchunk_prev_size; /* Size of previous chunk (if free). */
INTERNAL_SIZE_T mchunk_size; /* Size in bytes, including overhead. */
struct malloc_chunk* fd; /* double links -- used only if free. */
struct malloc_chunk* bk;
/* Only used for large blocks: pointer to next larger size. */
struct malloc_chunk* fd_nextsize; /* double links -- used only if free. */
struct malloc_chunk* bk_nextsize;
};
MallocChunk ¤
Bases: CStruct2GDB
This class represents malloc_chunk struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_tcache_perthread_struct_2_29 ¤
Bases: Structure
This class represents tcache_perthread_struct for GLIBC < 2.30 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.29/malloc/malloc.c#L2916
typedef struct tcache_perthread_struct { char counts[TCACHE_MAX_BINS]; tcache_entry *entries[TCACHE_MAX_BINS]; } tcache_perthread_struct;
c_tcache_perthread_struct_2_30 ¤
Bases: Structure
This class represents the tcache_perthread_struct for GLIBC >= 2.30 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/malloc.c#L3025
typedef struct tcache_perthread_struct { uint16_t counts[TCACHE_MAX_BINS]; tcache_entry *entries[TCACHE_MAX_BINS]; } tcache_perthread_struct;
TcachePerthreadStruct ¤
Bases: CStruct2GDB
This class represents tcache_perthread_struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_tcache_entry_2_28 ¤
Bases: Structure
This class represents the tcache_entry struct for GLIBC < 2.29 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.28/malloc/malloc.c#L2888
typedef struct tcache_entry { struct tcache_entry *next; } tcache_entry;
c_tcache_entry_2_29 ¤
Bases: Structure
This class represents the tcache_entry struct for GLIBC >= 2.29 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/malloc.c#L3013
typedef struct tcache_entry { struct tcache_entry next; / This field exists to detect double frees. */ uintptr_t key; } tcache_entry;
TcacheEntry ¤
Bases: CStruct2GDB
This class represents the tcache_entry struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.
c_malloc_par_2_23 ¤
Bases: Structure
This class represents the malloc_par struct for GLIBC < 2.24 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.23/malloc/malloc.c#L1726
struct malloc_par { /* Tunable parameters */ unsigned long trim_threshold; INTERNAL_SIZE_T top_pad; INTERNAL_SIZE_T mmap_threshold; INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max;
/* Memory map support / int n_mmaps; int n_mmaps_max; int max_n_mmaps; / the mmap_threshold is dynamic, until the user sets it manually, at which point we need to disable any dynamic behavior. */ int no_dyn_threshold;
/* Statistics / INTERNAL_SIZE_T mmapped_mem; /*INTERNAL_SIZE_T sbrked_mem;/ /INTERNAL_SIZE_T max_sbrked_mem;/ INTERNAL_SIZE_T max_mmapped_mem; INTERNAL_SIZE_T max_total_mem; /* only kept for NO_THREADS */
/* First address handed out by MORECORE/sbrk. */ char *sbrk_base; };
c_malloc_par_2_12 ¤
Bases: Structure
This class represents the malloc_par struct for GLIBC < 2.15 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.12/malloc/malloc.c#L2402-L2433
struct malloc_par { /* Tunable parameters */ unsigned long trim_threshold; INTERNAL_SIZE_T top_pad; INTERNAL_SIZE_T mmap_threshold;
ifdef PER_THREAD¤
INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max;
endif¤
/* Memory map support / int n_mmaps; int n_mmaps_max; int max_n_mmaps; / the mmap_threshold is dynamic, until the user sets it manually, at which point we need to disable any dynamic behavior. */ int no_dyn_threshold;
/* Cache malloc_getpagesize */ unsigned int pagesize;
/* Statistics / INTERNAL_SIZE_T mmapped_mem; /*INTERNAL_SIZE_T sbrked_mem;/ /INTERNAL_SIZE_T max_sbrked_mem;/ INTERNAL_SIZE_T max_mmapped_mem; INTERNAL_SIZE_T max_total_mem; /* only kept for NO_THREADS */
/* First address handed out by MORECORE/sbrk. / char sbrk_base; };
c_malloc_par_2_24 ¤
Bases: Structure
This class represents the malloc_par struct for GLIBC >= 2.24 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.25/malloc/malloc.c#L1690 https://github.com/bminor/glibc/blob/glibc-2.24/malloc/malloc.c#L1719
struct malloc_par { /* Tunable parameters */ unsigned long trim_threshold; INTERNAL_SIZE_T top_pad; INTERNAL_SIZE_T mmap_threshold; INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max;
/* Memory map support */
int n_mmaps;
int n_mmaps_max;
int max_n_mmaps;
/* the mmap_threshold is dynamic, until the user sets
it manually, at which point we need to disable any
dynamic behavior. */
int no_dyn_threshold;
/* Statistics */
INTERNAL_SIZE_T mmapped_mem;
INTERNAL_SIZE_T max_mmapped_mem;
/* First address handed out by MORECORE/sbrk. */
char *sbrk_base;
};
c_malloc_par_2_26 ¤
Bases: Structure
This class represents the malloc_par struct for GLIBC >= 2.26 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.34/malloc/malloc.c#L1875
struct malloc_par { /* Tunable parameters */ unsigned long trim_threshold; INTERNAL_SIZE_T top_pad; INTERNAL_SIZE_T mmap_threshold; INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max;
/* Memory map support */
int n_mmaps;
int n_mmaps_max;
int max_n_mmaps;
/* the mmap_threshold is dynamic, until the user sets
it manually, at which point we need to disable any
dynamic behavior. */
int no_dyn_threshold;
/* Statistics */
INTERNAL_SIZE_T mmapped_mem;
INTERNAL_SIZE_T max_mmapped_mem;
/* First address handed out by MORECORE/sbrk. */
char *sbrk_base;
if USE_TCACHE¤
/* Maximum number of buckets to use. */
size_t tcache_bins;
size_t tcache_max_bytes;
/* Maximum number of chunks in each bucket. */
size_t tcache_count;
/* Maximum number of chunks to remove from the unsorted list, which
aren't used to prefill the cache. */
size_t tcache_unsorted_limit;
endif¤
};
c_malloc_par_2_35 ¤
Bases: Structure
This class represents the malloc_par struct for GLIBC >= 2.35 as a ctypes struct.
https://github.com/bminor/glibc/blob/glibc-2.35/malloc/malloc.c#L1874
struct malloc_par { /* Tunable parameters */ unsigned long trim_threshold; INTERNAL_SIZE_T top_pad; INTERNAL_SIZE_T mmap_threshold; INTERNAL_SIZE_T arena_test; INTERNAL_SIZE_T arena_max;
if HAVE_TUNABLES¤
/* Transparent Large Page support. */
INTERNAL_SIZE_T thp_pagesize;
/* A value different than 0 means to align mmap allocation to hp_pagesize
add hp_flags on flags. */
INTERNAL_SIZE_T hp_pagesize;
int hp_flags;
endif¤
/* Memory map support */
int n_mmaps;
int n_mmaps_max;
int max_n_mmaps;
/* the mmap_threshold is dynamic, until the user sets
it manually, at which point we need to disable any
dynamic behavior. */
int no_dyn_threshold;
/* Statistics */
INTERNAL_SIZE_T mmapped_mem;
INTERNAL_SIZE_T max_mmapped_mem;
/* First address handed out by MORECORE/sbrk. */
char *sbrk_base;
if USE_TCACHE¤
/* Maximum number of buckets to use. */
size_t tcache_bins;
size_t tcache_max_bytes;
/* Maximum number of chunks in each bucket. */
size_t tcache_count;
/* Maximum number of chunks to remove from the unsorted list, which
aren't used to prefill the cache. */
size_t tcache_unsorted_limit;
endif¤
};
MallocPar ¤
Bases: CStruct2GDB
This class represents the malloc_par struct with interface compatible with pwndbg.dbg_mod.Value
.
Methods:
-
__int__
–Returns the address of the C struct.
-
__getitem__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__getattr__
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
__eq__
– -
value_to_human_readable
–Returns a string representation of the C struct like
pwndbg.dbg_mod.Value
does. -
read_field
–Returns the value of the specified field as a
pwndbg.dbg_mod.Value
. -
unqualified
–Returns cls to make it compatible with the
gdb.types.has_field()
interface. -
fields
–Return fields of the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
keys
–Return a list of the names of the fields in the struct to make it compatible with the
pwndbg.dbg_mod.Type
interface. -
get_field_address
–Returns the address of the specified field.
-
get_field_offset
–Returns the offset of the specified field.
-
items
–Returns a tuple of (field name, field value) pairs.
-
has_field
–Checks whether a field exists to make it compatible with the
pwndbg.dbg_mod.Type
interface.
Attributes:
-
sizeof
– -
code
– -
address
– -
type
–Returns type(self) to make it compatible with the
pwndbg.dbg_mod.Value
interface.
type property
¤
Returns type(self) to make it compatible with the pwndbg.dbg_mod.Value
interface.
__getitem__ ¤
__getitem__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
__getattr__ ¤
__getattr__(key: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
value_to_human_readable ¤
Returns a string representation of the C struct like pwndbg.dbg_mod.Value
does.
read_field ¤
read_field(field: str) -> Value
Returns the value of the specified field as a pwndbg.dbg_mod.Value
.
unqualified classmethod
¤
Returns cls to make it compatible with the gdb.types.has_field()
interface.
fields classmethod
¤
fields() -> list[FakeGDBField]
Return fields of the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
keys classmethod
¤
Return a list of the names of the fields in the struct to make it compatible with the pwndbg.dbg_mod.Type
interface.
get_field_address ¤
Returns the address of the specified field.
get_field_offset classmethod
¤
Returns the offset of the specified field.
has_field classmethod
¤
Checks whether a field exists to make it compatible with the pwndbg.dbg_mod.Type
interface.