| 240 | } |
| 241 | |
| 242 | static Ref<Platform> Recognize(BinaryView* view, Metadata* metadata) |
| 243 | { |
| 244 | auto machoPlatform = metadata->Get("machoplatform"); |
| 245 | if (!machoPlatform || !machoPlatform->IsUnsignedInteger()) |
| 246 | return nullptr; |
| 247 | if (machoPlatform->GetUnsignedInteger() != 2) |
| 248 | return nullptr; |
| 249 | if (view->GetFile()->IsBackedByDatabase()) |
| 250 | { |
| 251 | if (auto database = view->GetFile()->GetDatabase()) |
| 252 | { |
| 253 | if (database->HasGlobal("original_version") && database->ReadGlobal("original_version").asInt64() < 6) |
| 254 | { |
| 255 | LogError("%s", "iOS database was saved with mac platform. Unable to upgrade. For iOS typelibs to" |
| 256 | " function properly, this binary must be reopened."); |
| 257 | return nullptr; |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | return g_iosArm64; |
| 262 | } |
| 263 | }; |
| 264 | |
| 265 |
nothing calls this directly
no test coverage detected