| 151 | } |
| 152 | |
| 153 | static Ref<Platform> Recognize(BinaryView* view, Metadata* metadata) |
| 154 | { |
| 155 | bool shouldRecognizeOnIOS = false; |
| 156 | if (view->GetFile()->IsBackedByDatabase()) |
| 157 | { |
| 158 | if (auto database = view->GetFile()->GetDatabase()) |
| 159 | { |
| 160 | if (database->HasGlobal("original_version") && database->ReadGlobal("original_version").asInt64() < 6) |
| 161 | shouldRecognizeOnIOS = true; |
| 162 | } |
| 163 | } |
| 164 | auto machoPlatform = metadata->Get("machoplatform"); |
| 165 | if (!machoPlatform || !machoPlatform->IsUnsignedInteger()) |
| 166 | return nullptr; |
| 167 | if (machoPlatform->GetUnsignedInteger() != 2 || shouldRecognizeOnIOS) |
| 168 | return g_macArm64; |
| 169 | |
| 170 | return nullptr; |
| 171 | } |
| 172 | }; |
| 173 | |
| 174 |
nothing calls this directly
no test coverage detected