def extract_one_string_in_section(section, str_ptr):
    """Extract one string in an ELF section"""
    data = section['data']
    max_offset = section['size']
    offset = str_ptr - section['start']

    if offset < 0 or offset >= max_offset:
        return None

    ret_str = ""

    while (offset < max_offset) and (data[offset] != 0):
        ret_str += chr(data[offset])
        offset += 1

    return ret_str