2022-11-26 22:45:45 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2022-11-27 00:43:46 +08:00
|
|
|
#include <string>
|
2022-11-26 22:45:45 +08:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace lsplt {
|
|
|
|
inline namespace v1 {
|
2022-11-27 00:43:46 +08:00
|
|
|
|
|
|
|
struct MapInfo {
|
|
|
|
uintptr_t start;
|
|
|
|
uintptr_t end;
|
2022-11-27 01:24:21 +08:00
|
|
|
uint8_t perms;
|
2022-11-27 00:43:46 +08:00
|
|
|
bool is_private;
|
2022-11-27 01:24:21 +08:00
|
|
|
uintptr_t offset;
|
2022-11-27 00:43:46 +08:00
|
|
|
dev_t dev;
|
|
|
|
ino_t inode;
|
|
|
|
std::string path;
|
|
|
|
|
2022-11-27 00:59:56 +08:00
|
|
|
[[maybe_unused, gnu::visibility("default")]] static std::vector<MapInfo> Scan();
|
2022-11-27 00:43:46 +08:00
|
|
|
};
|
|
|
|
|
2022-11-27 00:29:32 +08:00
|
|
|
[[maybe_unused, gnu::visibility("default")]] bool RegisterHook(ino_t ino, std::string_view symbol,
|
|
|
|
void *callback, void **backup);
|
2022-11-26 22:45:45 +08:00
|
|
|
|
2022-11-27 00:29:32 +08:00
|
|
|
[[maybe_unused, gnu::visibility("default")]] bool CommitHook();
|
2022-11-26 22:45:45 +08:00
|
|
|
|
2022-11-27 00:29:32 +08:00
|
|
|
[[maybe_unused, gnu::visibility("default")]] bool InvalidateBackup();
|
2022-11-26 22:45:45 +08:00
|
|
|
} // namespace v1
|
|
|
|
} // namespace lsplt
|