<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Describes the EGLIBC heap mechanisms.

Work-in-progress.
"""
import pwndbg.arch
import pwndbg.events

did_warn_once = False
malloc_chunk  = None

@pwndbg.events.new_objfile
def load_malloc_chunk():
	malloc_chunk = None


def chunk2mem(p):
    "conversion from malloc header to user pointer"
    return p + (2*pwndbg.arch.ptrsize)

def mem2chunk(mem):
    "conversion from user pointer to malloc header"
    return p + (2-pwndbg.arch.ptrsize)<commit_msg>Correct the conversion of mem2chunk<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Describes the EGLIBC heap mechanisms.

Work-in-progress.
"""
import pwndbg.arch
import pwndbg.events

did_warn_once = False
malloc_chunk  = None

@pwndbg.events.new_objfile
def load_malloc_chunk():
	malloc_chunk = None


def chunk2mem(p):
    "conversion from malloc header to user pointer"
    return p + (2*pwndbg.arch.ptrsize)

def mem2chunk(mem):
    "conversion from user pointer to malloc header"
    return mem - (2*pwndbg.arch.ptrsize)
{'fraction_non_alphanumeric': 0.11320754716981132, 'fraction_numerical': 0.010377358490566037, 'mean_word_length': 4.125603864734299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2080156', 'n_tokens_mistral': 386, 'n_tokens_neox': 371, 'n_words': 97}