| 71 | } |
| 72 | |
| 73 | FilesystemView HookFilesystem::Detect(FilesystemView fs) { |
| 74 | auto lmt = fs.OpenInputStream(TREEMAP_NAME); |
| 75 | if (lmt) { |
| 76 | std::array<char, 11> buf; |
| 77 | |
| 78 | lmt.ReadIntoObj(buf); |
| 79 | |
| 80 | if (!memcmp(buf.data(), "\xbMdgNbqUsff", 11)) { |
| 81 | auto hook_fs = std::make_shared<HookFilesystem>(fs, Hook::SacredTears); |
| 82 | return hook_fs->Subtree(""); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | return fs; |
| 87 | } |
| 88 | |
| 89 | bool HookFilesystem::IsFile(std::string_view path) const { |
| 90 | return GetParent().IsFile(path); |
nothing calls this directly
no test coverage detected