mirror of https://github.com/x64dbg/GleeBug
Doxygen configuration + documented some undocumented classes and functions
This commit is contained in:
parent
439fd82767
commit
abc8a41a8d
|
|
@ -5,3 +5,4 @@ Release/
|
|||
*.opensdf
|
||||
*.orig
|
||||
*.vcxproj.user
|
||||
docs/
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ namespace GleeBug
|
|||
Execute
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Structure describing internal breakpoint info.
|
||||
*/
|
||||
struct BreakpointInternalInfo
|
||||
{
|
||||
union
|
||||
|
|
@ -74,6 +77,9 @@ namespace GleeBug
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Structure describing a breakpoint.
|
||||
*/
|
||||
struct BreakpointInfo
|
||||
{
|
||||
ptr address;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ enum class F
|
|||
}; //F
|
||||
|
||||
/**
|
||||
\brief Class that represents a flag.
|
||||
\brief Class that represents a flag. This class provides an abstraction for a flag to allow intuitive operations.
|
||||
\tparam FlagIndex The enum index of the flag.
|
||||
\tparam ThisPtr Pointer to the Registers class.
|
||||
*/
|
||||
|
|
@ -21,34 +21,92 @@ template<F FlagIndex>
|
|||
class Flag
|
||||
{
|
||||
public:
|
||||
/**
|
||||
\brief Constructor.
|
||||
\param registers Pointer to the registers object.
|
||||
*/
|
||||
explicit Flag(Registers* registers) : _registers(registers) {}
|
||||
|
||||
/**
|
||||
\brief Gets the flag.
|
||||
\return true if the flag was set, false otherwise.
|
||||
*/
|
||||
bool Get() const
|
||||
{
|
||||
return _registers->GetFlag(FlagIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Sets the flag.
|
||||
\param value (Optional) True to set the flag, false to unset the flag.
|
||||
*/
|
||||
void Set(bool value = true)
|
||||
{
|
||||
_registers->SetFlag(FlagIndex, value);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Gets the flag.
|
||||
\return true if the flag was set, false otherwise.
|
||||
*/
|
||||
///
|
||||
bool operator()() const
|
||||
{
|
||||
return Get();
|
||||
}
|
||||
|
||||
Flag<FlagIndex> & operator=(const bool & other)
|
||||
/**
|
||||
\brief Assignment operator (sets the flag).
|
||||
\param value True to set the flag, false to unset the flag.
|
||||
\return A shallow copy of this object.
|
||||
*/
|
||||
Flag<FlagIndex> & operator=(const bool & value)
|
||||
{
|
||||
Set(other);
|
||||
Set(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief bool casting operator. Uses the flag status.
|
||||
*/
|
||||
operator bool() const
|
||||
{
|
||||
return Get();
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Bitwise 'or' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Flag<FlagIndex> & operator|=(const bool & value)
|
||||
{
|
||||
Set(Get() | value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Bitwise 'exclusive or' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Flag<FlagIndex> & operator^=(const bool & value)
|
||||
{
|
||||
Set(Get() ^ value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Bitwise 'and' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Flag<FlagIndex> & operator&=(const bool & value)
|
||||
{
|
||||
Set(Get() & value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
Registers* _registers;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ enum class R
|
|||
}; //R
|
||||
|
||||
/**
|
||||
\brief Class that represents a register.
|
||||
\brief Class that represents a register. This class provides an abstraction for a register to allow intuitive operations.
|
||||
\tparam RegisterIndex The enum index of the register.
|
||||
\tparam Type Type of the register value.
|
||||
\tparam ThisPtr Pointer to the Registers class.
|
||||
|
|
@ -112,96 +112,176 @@ template<R RegisterIndex, typename Type>
|
|||
class Register
|
||||
{
|
||||
public:
|
||||
/**
|
||||
\brief Constructor.
|
||||
\param registers Pointer to the registers.
|
||||
*/
|
||||
explicit Register(Registers* registers) : _registers(registers) {}
|
||||
|
||||
/**
|
||||
\brief Gets the register value.
|
||||
\return The register value.
|
||||
*/
|
||||
Type Get() const
|
||||
{
|
||||
return Type(_registers->Get(RegisterIndex));
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Sets the register value.
|
||||
\param value The new register value.
|
||||
*/
|
||||
void Set(Type value)
|
||||
{
|
||||
_registers->Set(RegisterIndex, ptr(value));
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Gets the register value.
|
||||
\return The register value.
|
||||
*/
|
||||
Type operator()() const
|
||||
{
|
||||
return Get();
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator=(const Type & other)
|
||||
/**
|
||||
\brief Assignment operator.
|
||||
\param value The new register value.
|
||||
\return A shallow copy of this object.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator=(const Type & value)
|
||||
{
|
||||
Set(other);
|
||||
Set(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator+=(const Type & other)
|
||||
/**
|
||||
\brief Addition assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator+=(const Type & value)
|
||||
{
|
||||
Set(Get() + other);
|
||||
Set(Get() + value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator-=(const Type & other)
|
||||
/**
|
||||
\brief Subtraction assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator-=(const Type & value)
|
||||
{
|
||||
Set(Get() - other);
|
||||
Set(Get() - value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator*=(const Type & other)
|
||||
/**
|
||||
\brief Multiplication assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator*=(const Type & value)
|
||||
{
|
||||
Set(Get() * other);
|
||||
Set(Get() * value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator/=(const Type & other)
|
||||
/**
|
||||
\brief Division assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator/=(const Type & value)
|
||||
{
|
||||
Set(Get() / other);
|
||||
Set(Get() / value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator%=(const Type & other)
|
||||
/**
|
||||
\brief Modulus assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator%=(const Type & value)
|
||||
{
|
||||
Set(Get() % other);
|
||||
Set(Get() % value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator^=(const Type & other)
|
||||
/**
|
||||
\brief Bitwise 'exclusive or' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator^=(const Type & value)
|
||||
{
|
||||
Set(Get() ^ other);
|
||||
Set(Get() ^ value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator&=(const Type & other)
|
||||
/**
|
||||
\brief Bitwise 'and' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator&=(const Type & value)
|
||||
{
|
||||
Set(Get() & other);
|
||||
Set(Get() & value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Register<RegisterIndex, Type> & operator|=(const Type & other)
|
||||
/**
|
||||
\brief Bitwise 'or' assignment operator.
|
||||
\param value The value to perform the operation with.
|
||||
\return The result of the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator|=(const Type & value)
|
||||
{
|
||||
Set(Get() | other);
|
||||
Set(Get() | value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Increment operator.
|
||||
\return The register before the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator++()
|
||||
{
|
||||
auto ret = *this;
|
||||
Set(Get() + 1);
|
||||
return *this;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Increment operator.
|
||||
\return The register before the operation.
|
||||
*/
|
||||
Register<RegisterIndex, Type> & operator++(int)
|
||||
{
|
||||
return operator++();
|
||||
}
|
||||
|
||||
bool operator==(const Type & other) const
|
||||
/**
|
||||
\brief Equality operator.
|
||||
\param value The value to compare with.
|
||||
\return true if the register is equal to the value.
|
||||
*/
|
||||
bool operator==(const Type & value) const
|
||||
{
|
||||
return Get() == other;
|
||||
return Get() == value;
|
||||
}
|
||||
|
||||
bool operator!=(const Type & other) const
|
||||
/**
|
||||
\brief Inequality operator.
|
||||
\param value The value to compare with.
|
||||
\return true if the register is not equal to the value.
|
||||
*/
|
||||
bool operator!=(const Type & value) const
|
||||
{
|
||||
return !operator==(other);
|
||||
return !operator==(value);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -55,36 +55,42 @@ namespace GleeBug
|
|||
/**
|
||||
\brief Process creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback.
|
||||
\param createProcess Information about the process created.
|
||||
\param process ProcessInfo of the created process.
|
||||
*/
|
||||
virtual void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) {};
|
||||
|
||||
/**
|
||||
\brief Process termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback.
|
||||
\param exitProcess Information about the process terminated.
|
||||
\param process ProcessInfo of the terminated process.
|
||||
*/
|
||||
virtual void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) {};
|
||||
|
||||
/**
|
||||
\brief Thread creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback.
|
||||
\param createThread Information about the thread created.
|
||||
\param thread ThreadInfo of the created thread.
|
||||
*/
|
||||
virtual void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) {};
|
||||
|
||||
/**
|
||||
\brief Thread termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback.
|
||||
\param exitThread Information about the thread terminated.
|
||||
\param thread ThreadInfo of the terminated thread.
|
||||
*/
|
||||
virtual void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) {};
|
||||
|
||||
/**
|
||||
\brief DLL load debug event callback. Called after event is internally processed. Provide an implementation to use this callback.
|
||||
\param loadDll Information about the DLL loaded.
|
||||
\param dll DllInfo of the loaded DLL.
|
||||
*/
|
||||
virtual void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) {};
|
||||
|
||||
/**
|
||||
\brief DLL unload debug event callback. Called before event is internally processed. Provide an implementation to use this callback.
|
||||
\param unloadDll Information about the DLL unloaded.
|
||||
\param dll DllInfo of the unloaded DLL.
|
||||
*/
|
||||
virtual void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) {};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,17 @@ namespace GleeBug
|
|||
|
||||
typedef std::pair<ptr, ptr> Range;
|
||||
|
||||
/**
|
||||
\brief A range compare (used in std::map).
|
||||
*/
|
||||
struct RangeCompare
|
||||
{
|
||||
/**
|
||||
\brief Returns if range a comes before range b.
|
||||
\param a First range.
|
||||
\param b Second range.
|
||||
\return True if a comes before b, false otherwise.
|
||||
*/
|
||||
inline bool operator()(const Range & a, const Range & b) const //a before b?
|
||||
{
|
||||
return a.second < b.first;
|
||||
|
|
|
|||
Loading…
Reference in New Issue