<commit_before>/* Copyright 2017 <NAME>
 * Copyright 2017 Quarkslab
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef LIEF_ELF_PARSER_H_
#define LIEF_ELF_PARSER_H_

#include <vector>
#include <string>
#include <memory>
#include <fstream>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <stdexcept>
#include <functional>

#include "LIEF/visibility.h"
#include "LIEF/exception.hpp"
#include "LIEF/BinaryStream/VectorStream.hpp"

#include "LIEF/Abstract/Parser.hpp"

#include "LIEF/ELF/Binary.hpp"
#include "LIEF/ELF/Structures.hpp"
#include "LIEF/ELF/DynamicEntryArray.hpp"
#include "LIEF/ELF/DynamicEntryRpath.hpp"
#include "LIEF/ELF/DynamicEntryRunPath.hpp"
#include "LIEF/ELF/GnuHash.hpp"

namespace LIEF {
namespace ELF {

//! @brief Class which parse an ELF file and transform into a ELF::Binary
class DLL_PUBLIC Parser : public LIEF::Parser {
  public:

    static constexpr uint32_t NB_MAX_SYMBOLS         = 1000000;
    static constexpr uint32_t DELTA_NB_SYMBOLS       = 3000;
    static constexpr uint32_t NB_MAX_BUCKETS         = NB_MAX_SYMBOLS;
    static constexpr uint32_t NB_MAX_CHAINS          = 1000000;
    static constexpr uint32_t NB_MAX_SECTION         = 10000;
    static constexpr uint32_t NB_MAX_SEGMENTS        = 10000;
    static constexpr uint32_t NB_MAX_RELOCATIONS     = 10000;
    static constexpr uint32_t NB_MAX_DYNAMIC_ENTRIES = 1000;
    static constexpr uint32_t NB_MAX_MASKWORD        = 512;
    static constexpr uint32_t MAX_NOTE_DESCRIPTION   = 1_MB;<commit_msg>Fix ELF: Increasing the upper limit of relocations<commit_after>/* Copyright 2017 <NAME>
 * Copyright 2017 Quarkslab
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef LIEF_ELF_PARSER_H_
#define LIEF_ELF_PARSER_H_

#include <vector>
#include <string>
#include <memory>
#include <fstream>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <stdexcept>
#include <functional>

#include "LIEF/visibility.h"
#include "LIEF/exception.hpp"
#include "LIEF/BinaryStream/VectorStream.hpp"

#include "LIEF/Abstract/Parser.hpp"

#include "LIEF/ELF/Binary.hpp"
#include "LIEF/ELF/Structures.hpp"
#include "LIEF/ELF/DynamicEntryArray.hpp"
#include "LIEF/ELF/DynamicEntryRpath.hpp"
#include "LIEF/ELF/DynamicEntryRunPath.hpp"
#include "LIEF/ELF/GnuHash.hpp"

namespace LIEF {
namespace ELF {

//! @brief Class which parse an ELF file and transform into a ELF::Binary
class DLL_PUBLIC Parser : public LIEF::Parser {
  public:

    static constexpr uint32_t NB_MAX_SYMBOLS         = 1000000;
    static constexpr uint32_t DELTA_NB_SYMBOLS       = 3000;
    static constexpr uint32_t NB_MAX_BUCKETS         = NB_MAX_SYMBOLS;
    static constexpr uint32_t NB_MAX_CHAINS          = 1000000;
    static constexpr uint32_t NB_MAX_SECTION         = 10000;
    static constexpr uint32_t NB_MAX_SEGMENTS        = 10000;
    static constexpr uint32_t NB_MAX_RELOCATIONS     = 3000000;
    static constexpr uint32_t NB_MAX_DYNAMIC_ENTRIES = 1000;
    static constexpr uint32_t NB_MAX_MASKWORD        = 512;
    static constexpr uint32_t MAX_NOTE_DESCRIPTION   = 1_MB;
{'fraction_non_alphanumeric': 0.08088413893611854, 'fraction_numerical': 0.03594850619383046, 'mean_word_length': 4.134663341645886, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3799834', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1310, 'n_words': 404}