1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 11:19:26 +08:00
Files
Alas/blcrack/cracker/utils.hpp

37 lines
835 B
C++
Raw Normal View History

2025-11-01 00:23:46 +08:00
#ifndef UTILS_HPP
#define UTILS_HPP
#include <lua/lua.hpp>
#include <string>
#include <sol/types.hpp>
#include <sol/object.hpp>
#include <sol/table.hpp>
#define PTR_ADD(ptr, offset) ((void*)((char*)(ptr) + (offset)))
namespace Utils {
void* get_so_base_address(const std::string& name);
lua_State* get_lua_state();
namespace Lua {
std::string get_type_name(sol::type t);
std::string get_type_name(sol::object& o);
void print_table_fields_type(sol::table& t);
void print_traceback(sol::this_state& L);
void print_object(sol::object& obj);
}
2025-11-18 18:12:20 +08:00
class FuncTrace {
public:
FuncTrace(const std::string& func);
~FuncTrace();
private:
std::string m_func;
};
2025-11-01 00:23:46 +08:00
}
2025-11-18 18:12:20 +08:00
#define FUNC_TRACE() auto _ = Utils::FuncTrace(__FUNCTION__);
2025-11-01 00:23:46 +08:00
#endif //UTILS_HPP