Skip to content

Commit

Permalink
Change Doxygen comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Nov 1, 2024
1 parent 8c7b291 commit 699ae7e
Show file tree
Hide file tree
Showing 208 changed files with 3,288 additions and 3,288 deletions.
2 changes: 1 addition & 1 deletion include/LIEF/ART/Parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace ART {
class File;


//! @brief Class which parses an ART file and transform into a ART::File object
/// Class which parses an ART file and transform into a ART::File object
class LIEF_API Parser {
public:
static std::unique_ptr<File> parse(const std::string& file);
Expand Down
14 changes: 7 additions & 7 deletions include/LIEF/ART/java_structures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "LIEF/ART/types.hpp"

namespace LIEF {
//! @brief Namespace related to the LIEF's ART module
/// Namespace related to the LIEF's ART module
namespace ART {

namespace details {
Expand All @@ -36,7 +36,7 @@ struct no_brooks_read_barrier_t {};
// ======================
namespace ART_17 {

//! @brief Namespace related to the Java part of ART 17
/// Namespace related to the Java part of ART 17
namespace Java {

using heap_reference_t = uint32_t;
Expand Down Expand Up @@ -130,7 +130,7 @@ struct ALIGNED_(4) jdex_cache_t {
// ======================
namespace ART_29 {

//! @brief Namespace related to the Java part of ART 29
/// Namespace related to the Java part of ART 29
namespace Java {
using heap_reference_t = ART_17::Java::heap_reference_t;
using brooks_read_barrier_t = ART_17::Java::brooks_read_barrier_t;
Expand Down Expand Up @@ -215,7 +215,7 @@ struct ALIGNED_(4) jdex_cache_t {
// ======================
namespace ART_30 {

//! @brief Namespace related to the Java part of ART 30
/// Namespace related to the Java part of ART 30
namespace Java {

using heap_reference_t = ART_29::Java::heap_reference_t;
Expand Down Expand Up @@ -246,7 +246,7 @@ using jdex_cache_t = ART_29::Java::jdex_cache_t<T>;
// ======================
namespace ART_44 {

//! @brief Namespace related to the Java part of ART 44
/// Namespace related to the Java part of ART 44
namespace Java {


Expand Down Expand Up @@ -335,7 +335,7 @@ struct ALIGNED_(4) jdex_cache_t {
// ======================
namespace ART_46 {

//! @brief Namespace related to the Java part of ART 46
/// Namespace related to the Java part of ART 46
namespace Java {

using heap_reference_t = ART_44::Java::heap_reference_t;
Expand Down Expand Up @@ -364,7 +364,7 @@ using jdex_cache_t = ART_44::Java::jdex_cache_t<T>;
// ======================
namespace ART_56 {

//! @brief Namespace related to the Java part of ART 46
/// Namespace related to the Java part of ART 46
namespace Java {

using heap_reference_t = ART_46::Java::heap_reference_t;
Expand Down
10 changes: 5 additions & 5 deletions include/LIEF/ART/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
namespace LIEF {
namespace ART {

//! @brief Check if the given file is an ART one.
/// Check if the given file is an ART one.
LIEF_API bool is_art(const std::string& file);

//! @brief Check if the given raw data is an ART one.
/// Check if the given raw data is an ART one.
LIEF_API bool is_art(const std::vector<uint8_t>& raw);

//! @brief Return the ART version of the given file
/// Return the ART version of the given file
LIEF_API art_version_t version(const std::string& file);

//! @brief Return the ART version of the raw data
/// Return the ART version of the raw data
LIEF_API art_version_t version(const std::vector<uint8_t>& raw);

//! @brief Return the ANDROID_VERSIONS associated with the given ART version
/// Return the ANDROID_VERSIONS associated with the given ART version
LIEF_API LIEF::Android::ANDROID_VERSIONS android_version(art_version_t version);

}
Expand Down
116 changes: 58 additions & 58 deletions include/LIEF/Abstract/Binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
#include "LIEF/Abstract/Header.hpp"
#include "LIEF/Abstract/Function.hpp"

//! LIEF namespace
/// LIEF namespace
namespace LIEF {
class Section;
class Relocation;
class Symbol;

class DebugInfo;

//! Abstract binary that exposes an uniform API for the
//! different executable file formats
/// Abstract binary that exposes an uniform API for the
/// different executable file formats
class LIEF_API Binary : public Object {
public:

//! Type of a virtual address
/// Type of a virtual address
enum class VA_TYPES {
AUTO = 0, ///< Try to guess if it's relative or not
RVA = 1, ///< Relative
Expand All @@ -58,31 +58,31 @@ class LIEF_API Binary : public Object {

using functions_t = std::vector<Function>;

//! Internal container
/// Internal container
using sections_t = std::vector<Section*>;

//! Iterator that outputs LIEF::Section&
/// Iterator that outputs LIEF::Section&
using it_sections = ref_iterator<sections_t>;

//! Iterator that outputs const LIEF::Section&
/// Iterator that outputs const LIEF::Section&
using it_const_sections = const_ref_iterator<sections_t>;

//! Internal container
/// Internal container
using symbols_t = std::vector<Symbol*>;

//! Iterator that outputs LIEF::Symbol&
/// Iterator that outputs LIEF::Symbol&
using it_symbols = ref_iterator<symbols_t>;

//! Iterator that outputs const LIEF::Symbol&
/// Iterator that outputs const LIEF::Symbol&
using it_const_symbols = const_ref_iterator<symbols_t>;

//! Internal container
/// Internal container
using relocations_t = std::vector<Relocation*>;

//! Iterator that outputs LIEF::Relocation&
/// Iterator that outputs LIEF::Relocation&
using it_relocations = ref_iterator<relocations_t>;

//! Iterator that outputs const LIEF::Relocation&
/// Iterator that outputs const LIEF::Relocation&
using it_const_relocations = const_ref_iterator<relocations_t>;

public:
Expand All @@ -94,40 +94,40 @@ class LIEF_API Binary : public Object {
Binary& operator=(const Binary&) = delete;
Binary(const Binary&) = delete;

//! Executable format (ELF, PE, Mach-O) of the underlying binary
/// Executable format (ELF, PE, Mach-O) of the underlying binary
FORMATS format() const {
return format_;
}

//! Return the abstract header of the binary
/// Return the abstract header of the binary
Header header() const {
return get_abstract_header();
}

//! Return an iterator over the abstracted symbols in which the elements **can** be modified
/// Return an iterator over the abstracted symbols in which the elements **can** be modified
it_symbols symbols() {
return get_abstract_symbols();
}

//! Return an iterator over the abstracted symbols in which the elements **can't** be modified
/// Return an iterator over the abstracted symbols in which the elements **can't** be modified
it_const_symbols symbols() const {
return const_cast<Binary*>(this)->get_abstract_symbols();
}

//! Check if a Symbol with the given name exists
/// Check if a Symbol with the given name exists
bool has_symbol(const std::string& name) const {
return get_symbol(name) != nullptr;
}

//! Return the Symbol with the given name
//! If the symbol does not exist, return a nullptr
/// Return the Symbol with the given name
/// If the symbol does not exist, return a nullptr
const Symbol* get_symbol(const std::string& name) const;

Symbol* get_symbol(const std::string& name) {
return const_cast<Symbol*>(static_cast<const Binary*>(this)->get_symbol(name));
}

//! Return an iterator over the binary's sections (LIEF::Section)
/// Return an iterator over the binary's sections (LIEF::Section)
it_sections sections() {
return get_abstract_sections();
}
Expand All @@ -136,10 +136,10 @@ class LIEF_API Binary : public Object {
return const_cast<Binary*>(this)->get_abstract_sections();
}

//! Remove **all** the sections in the underlying binary
/// Remove **all** the sections in the underlying binary
virtual void remove_section(const std::string& name, bool clear = false) = 0;

//! Return an iterator over the binary relocation (LIEF::Relocation)
/// Return an iterator over the binary relocation (LIEF::Relocation)
it_relocations relocations() {
return get_abstract_relocations();
}
Expand All @@ -148,61 +148,61 @@ class LIEF_API Binary : public Object {
return const_cast<Binary*>(this)->get_abstract_relocations();
}

//! Binary's entrypoint (if any)
/// Binary's entrypoint (if any)
virtual uint64_t entrypoint() const = 0;

//! Binary's original size
/// Binary's original size
uint64_t original_size() const {
return original_size_;
}

//! Return the functions exported by the binary
/// Return the functions exported by the binary
functions_t exported_functions() const {
return get_abstract_exported_functions();
}

//! Return libraries which are imported by the binary
/// Return libraries which are imported by the binary
std::vector<std::string> imported_libraries() const {
return get_abstract_imported_libraries();
}

//! Return functions imported by the binary
/// Return functions imported by the binary
functions_t imported_functions() const {
return get_abstract_imported_functions();
}

//! Return the address of the given function name
/// Return the address of the given function name
virtual result<uint64_t> get_function_address(const std::string& func_name) const;

//! Method so that a ``visitor`` can visit us
/// Method so that a ``visitor`` can visit us
void accept(Visitor& visitor) const override;

std::vector<uint64_t> xref(uint64_t address) const;

//! Patch the content at virtual address @p address with @p patch_value
//!
//! @param[in] address Address to patch
//! @param[in] patch_value Patch to apply
//! @param[in] addr_type Specify if the address should be used as an
//! absolute virtual address or a RVA
/// Patch the content at virtual address @p address with @p patch_value
///
/// @param[in] address Address to patch
/// @param[in] patch_value Patch to apply
/// @param[in] addr_type Specify if the address should be used as an
/// absolute virtual address or a RVA
virtual void patch_address(uint64_t address, const std::vector<uint8_t>& patch_value,
VA_TYPES addr_type = VA_TYPES::AUTO) = 0;

//! Patch the address with the given value
//!
//! @param[in] address Address to patch
//! @param[in] patch_value Patch to apply
//! @param[in] size Size of the value in **bytes** (1, 2, ... 8)
//! @param[in] addr_type Specify if the address should be used as an absolute virtual address or an RVA
/// Patch the address with the given value
///
/// @param[in] address Address to patch
/// @param[in] patch_value Patch to apply
/// @param[in] size Size of the value in **bytes** (1, 2, ... 8)
/// @param[in] addr_type Specify if the address should be used as an absolute virtual address or an RVA
virtual void patch_address(uint64_t address, uint64_t patch_value, size_t size = sizeof(uint64_t),
VA_TYPES addr_type = VA_TYPES::AUTO) = 0;

//! Return the content located at the given virtual address
/// Return the content located at the given virtual address
virtual span<const uint8_t>
get_content_from_virtual_address(uint64_t virtual_address, uint64_t size,
VA_TYPES addr_type = VA_TYPES::AUTO) const = 0;

//! Get the integer value at the given virtual address
/// Get the integer value at the given virtual address
template<class T>
LIEF::result<T> get_int_from_virtual_address(
uint64_t va, VA_TYPES addr_type = VA_TYPES::AUTO) const
Expand All @@ -219,38 +219,38 @@ class LIEF_API Binary : public Object {
return value;
}

//! @brief Change binary's original size.
//!
//! @warning
//! This function should be used carefully as some optimizations
//! can be performed with this value
/// Change binary's original size.
///
/// @warning
/// This function should be used carefully as some optimizations
/// can be performed with this value
void original_size(uint64_t size) {
original_size_ = size;
}

//! Check if the binary is position independent
/// Check if the binary is position independent
virtual bool is_pie() const = 0;

//! Check if the binary uses ``NX`` protection
/// Check if the binary uses ``NX`` protection
virtual bool has_nx() const = 0;

//! Default image base address if the ASLR is not enabled.
/// Default image base address if the ASLR is not enabled.
virtual uint64_t imagebase() const = 0;

//! Constructor functions that are called prior any other functions
/// Constructor functions that are called prior any other functions
virtual functions_t ctor_functions() const = 0;

//! Convert the given offset into a virtual address.
//!
//! @param[in] offset The offset to convert.
//! @param[in] slide If not 0, it will replace the default base address (if any)
/// Convert the given offset into a virtual address.
///
/// @param[in] offset The offset to convert.
/// @param[in] slide If not 0, it will replace the default base address (if any)
virtual result<uint64_t> offset_to_virtual_address(uint64_t offset, uint64_t slide = 0) const = 0;

virtual std::ostream& print(std::ostream& os) const {
return os;
}

//! Build & transform the Binary object representation into a *real* executable
/// Build & transform the Binary object representation into a *real* executable
virtual void write(const std::string& name) = 0;
virtual void write(std::ostream& os) = 0;

Expand Down
Loading

0 comments on commit 699ae7e

Please sign in to comment.