2024-08-01 22:38:55 +08:00
|
|
|
#pragma once
|
|
|
|
|
#include "stdafx.hpp"
|
2024-08-04 17:43:18 +08:00
|
|
|
#include <GenericHelper.hpp>
|
2024-08-01 22:38:55 +08:00
|
|
|
|
|
|
|
|
namespace VSW::Materializer::Utilities {
|
2024-08-02 17:04:37 +08:00
|
|
|
|
|
|
|
|
/// @brief The value representing a invalid CK_ID.
|
|
|
|
|
constexpr CK_ID INVALID_CK_ID = static_cast<CK_ID>(-1);
|
|
|
|
|
|
2024-08-04 17:43:18 +08:00
|
|
|
class EnhancedReporter : public VSW::Reporter {
|
|
|
|
|
public:
|
|
|
|
|
EnhancedReporter(CKContext* ctx);
|
|
|
|
|
~EnhancedReporter();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void PrePrint(const YYCC::yycc_char8_t* strl) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CKContext* m_Ctx;
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-02 17:04:37 +08:00
|
|
|
/**
|
|
|
|
|
* @brief Get relative address from given absolute address
|
|
|
|
|
* @details This function is used when exporting function pointer into database.
|
|
|
|
|
* @param[in] absolute_addr The absolute address
|
|
|
|
|
* @return Module based relative address like \c xxx.dll+0x00000000.
|
|
|
|
|
*/
|
|
|
|
|
std::string RelativeAddress(const void* absolute_addr);
|
2024-08-05 14:23:26 +08:00
|
|
|
//void CopyStrGuid(std::string& dst, const CKGUID& src);
|
2024-08-02 17:04:37 +08:00
|
|
|
void CopyGuid(int64_t& dst, const CKGUID& src);
|
2024-08-05 14:23:26 +08:00
|
|
|
void CopyCKString(std::string& storage, const char* str, const char* fallback = "<unamed>");
|
2024-08-01 22:38:55 +08:00
|
|
|
|
|
|
|
|
}
|