diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-01-25 15:16:43 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2016-01-25 23:13:23 -0500 |
| commit | ad05dd2072917e2487dcd34dbc249b2a0efac589 (patch) | |
| tree | 0392cd11853a91cbde36c0a8939116a5659fa1d3 /binaryviewtype.cpp | |
| parent | c2b2e11c009fa9b9c6c4a0fbba9210cb997e38ce (diff) | |
Initial implementation of platform ABI classes
Diffstat (limited to 'binaryviewtype.cpp')
| -rw-r--r-- | binaryviewtype.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/binaryviewtype.cpp b/binaryviewtype.cpp index 86a35520..e231586b 100644 --- a/binaryviewtype.cpp +++ b/binaryviewtype.cpp @@ -107,6 +107,45 @@ Ref<Architecture> BinaryViewType::GetArchitecture(uint32_t id) } +void BinaryViewType::RegisterPlatform(const string& name, uint32_t id, Architecture* arch, Platform* platform) +{ + Ref<BinaryViewType> type = BinaryViewType::GetByName(name); + if (!type) + return; + type->RegisterPlatform(id, arch, platform); +} + + +void BinaryViewType::RegisterDefaultPlatform(const string& name, Architecture* arch, Platform* platform) +{ + Ref<BinaryViewType> type = BinaryViewType::GetByName(name); + if (!type) + return; + type->RegisterDefaultPlatform(arch, platform); +} + + +void BinaryViewType::RegisterPlatform(uint32_t id, Architecture* arch, Platform* platform) +{ + BNRegisterPlatformForViewType(m_type, id, arch->GetArchitectureObject(), platform->GetPlatformObject()); +} + + +void BinaryViewType::RegisterDefaultPlatform(Architecture* arch, Platform* platform) +{ + BNRegisterDefaultPlatformForViewType(m_type, arch->GetArchitectureObject(), platform->GetPlatformObject()); +} + + +Ref<Platform> BinaryViewType::GetPlatform(uint32_t id, Architecture* arch) +{ + BNPlatform* platform = BNGetPlatformForViewType(m_type, id, arch->GetArchitectureObject()); + if (!platform) + return nullptr; + return new Platform(platform); +} + + string BinaryViewType::GetName() { char* contents = BNGetBinaryViewTypeName(m_type); |
