(self, key)
Find the index of a field in the malloc_chunk struct.

        64bit example:
            prev_size == 0
            size      == 8
            fd        == 16
            bk        == 24
            ...
Find the index of a field in the malloc_chunk struct.
Find the index of a field in the malloc_chunk struct .
def chunk_key_offset(self, key):
        """Find the index of a field in the malloc_chunk struct.

        64bit example:
            prev_size == 0
            size      == 8
            fd        == 16
            bk        == 24
            ...
        """
        renames = {
            "mchunk_size": "size",
            "mchunk_prev_size": "prev_size",
        }
        val = self.malloc_chunk
        chunk_keys = [renames[key] if key in renames else key for key in val.keys()]

        try:
            return chunk_keys.index(key) * pwndbg.arch.ptrsize
        except:
            return None
def chunk_key_offset ( self , key ) : renames = { "mchunk_size" : "size" , "mchunk_prev_size" : "prev_size" , } val = self . malloc_chunk chunk_keys = [ renames [ key ] if key in renames else key for key in val . keys ( ) ] try : return chunk_keys . index ( key ) * pwndbg . arch . ptrsize except : return None