Cleanup unused functions

This commit is contained in:
topjohnwu 2023-01-12 23:17:41 +08:00
parent 2839978cc1
commit 8f7d6dfb77
2 changed files with 0 additions and 21 deletions

View File

@ -17,24 +17,6 @@ static vector<lsplt::MapInfo> find_maps(const char *name) {
return maps;
}
std::pair<void *, size_t> find_map_range(const char *name, unsigned long inode) {
auto maps = find_maps(name);
uintptr_t start = 0u;
uintptr_t end = 0u;
for (const auto &map : maps) {
if (map.inode == inode) {
if (start == 0) {
start = map.start;
end = map.end;
} else if (map.start == end) {
end = map.end;
}
}
}
LOGD("found map %s with start = %zx, end = %zx\n", name, start, end);
return make_pair(reinterpret_cast<void *>(start), end - start);
}
void unmap_all(const char *name) {
auto maps = find_maps(name);
for (auto &info : maps) {

View File

@ -34,9 +34,6 @@ enum : int {
#define HIJACK_BIN HIJACK_BIN32
#endif
// Find the memory address + size of the pages matching name + inode
std::pair<void*, size_t> find_map_range(const char *name, unsigned long inode);
// Unmap all pages matching the name
void unmap_all(const char *name);