MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / CorePluginInit

Function CorePluginInit

platform/windows/platform_windows.cpp:614–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612 bool WindowsPluginInit()
613#else
614 BINARYNINJAPLUGIN bool CorePluginInit()
615#endif
616 {
617 Ref<Architecture> x86 = Architecture::GetByName("x86");
618 Ref<Platform> windowsX86;
619 if (x86)
620 {
621 windowsX86 = new WindowsX86Platform(x86);
622 Platform::Register("windows", windowsX86);
623 BinaryViewType::RegisterDefaultPlatform("PE", x86, windowsX86);
624 BinaryViewType::RegisterDefaultPlatform("COFF", x86, windowsX86);
625 }
626
627 Ref<Architecture> x64 = Architecture::GetByName("x86_64");
628 if (x64)
629 {
630 Ref<Platform> platform;
631
632 platform = new WindowsX64Platform(x64);
633 Platform::Register("windows", platform);
634 BinaryViewType::RegisterDefaultPlatform("PE", x64, platform);
635 BinaryViewType::RegisterDefaultPlatform("COFF", x64, platform);
636 }
637
638 Ref<Architecture> armv7 = Architecture::GetByName("armv7");
639 Ref<Architecture> thumb2 = Architecture::GetByName("thumb2");
640 if (armv7 && thumb2)
641 {
642 Ref<Platform> armPlatform, thumbPlatform;
643
644 armPlatform = new WindowsArmv7Platform(armv7, "windows-armv7");
645 thumbPlatform = new WindowsArmv7Platform(thumb2, "windows-thumb2");
646 armPlatform->AddRelatedPlatform(thumb2, thumbPlatform);
647 thumbPlatform->AddRelatedPlatform(armv7, armPlatform);
648 Platform::Register("windows", armPlatform);
649 Platform::Register("windows", thumbPlatform);
650 BinaryViewType::RegisterDefaultPlatform("PE", armv7, armPlatform);
651 BinaryViewType::RegisterDefaultPlatform("COFF", armv7, armPlatform);
652 BinaryViewType::RegisterDefaultPlatform("COFF", thumb2, thumbPlatform);
653 }
654
655 Ref<Architecture> arm64 = Architecture::GetByName("aarch64");
656 if (arm64)
657 {
658 Ref<Platform> platform;
659
660 platform = new WindowsArm64Platform(arm64);
661 Platform::Register("windows", platform);
662 BinaryViewType::RegisterDefaultPlatform("PE", arm64, platform);
663 BinaryViewType::RegisterDefaultPlatform("COFF", arm64, platform);
664 }
665
666 if (x86 && windowsX86)
667 {
668 // Set up exception handler prolog/epilog function inlining. These are registered for
669 // the entire architecture but internally they check to make sure it is the Windows
670 // platform. Internal implementation details prevent platform-specific function
671 // recognizers from being registered.

Callers

nothing calls this directly

Calls 2

AddRelatedPlatformMethod · 0.80
RegisterEnum · 0.50

Tested by

no test coverage detected