From 840072d5603a454db162ffcaf8e6dc2311f0d012 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Mon, 10 Feb 2025 14:57:07 -0500 Subject: [mips] Merging PR https://github.com/Vector35/binaryninja-api/pull/6013: adding mips3 support --- platform/linux/platform_linux.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'platform/linux/platform_linux.cpp') diff --git a/platform/linux/platform_linux.cpp b/platform/linux/platform_linux.cpp index 9a57c430..0a70f5b5 100644 --- a/platform/linux/platform_linux.cpp +++ b/platform/linux/platform_linux.cpp @@ -352,27 +352,37 @@ extern "C" Ref mipsel = Architecture::GetByName("mipsel32"); Ref mipseb = Architecture::GetByName("mips32"); + Ref mips3el = Architecture::GetByName("mipsel3"); + Ref mips3eb = Architecture::GetByName("mips3"); Ref mips64eb = Architecture::GetByName("mips64"); Ref cnmips64eb = Architecture::GetByName("cavium-mips64"); - if (mipsel && mipseb && mips64eb && cnmips64eb) + if (mipsel && mipseb && mips64eb && cnmips64eb && mips3el && mips3eb) { - Ref platformLE, platformBE, platformBE64, platformBE64cn; + Ref platformLE, platformBE, platformBE64, platformBE64cn, platform3LE, platform3BE; platformLE = new LinuxMipsPlatform(mipsel, "linux-mipsel"); platformBE = new LinuxMipsPlatform(mipseb, "linux-mips"); + platform3LE = new LinuxMipsPlatform(mips3el, "linux-mipsel3"); + platform3BE = new LinuxMipsPlatform(mips3eb, "linux-mips3"); platformBE64 = new LinuxMips64Platform(mips64eb, "linux-mips64"); platformBE64cn = new LinuxMips64Platform(cnmips64eb, "linux-cnmips64"); Platform::Register("linux", platformLE); Platform::Register("linux", platformBE); + Platform::Register("linux", platform3LE); + Platform::Register("linux", platform3BE); Platform::Register("linux", platformBE64); Platform::Register("linux", platformBE64cn); // Linux binaries sometimes have an OS identifier of zero, even though 3 is the correct one BinaryViewType::RegisterPlatform("ELF", 0, mipsel, platformLE); BinaryViewType::RegisterPlatform("ELF", 0, mipseb, platformBE); + BinaryViewType::RegisterPlatform("ELF", 0, mips3el, platform3LE); + BinaryViewType::RegisterPlatform("ELF", 0, mips3eb, platform3BE); BinaryViewType::RegisterPlatform("ELF", 0, mips64eb, platformBE64); BinaryViewType::RegisterPlatform("ELF", 0, cnmips64eb, platformBE64cn); BinaryViewType::RegisterPlatform("ELF", 3, mipsel, platformLE); BinaryViewType::RegisterPlatform("ELF", 3, mipseb, platformBE); + BinaryViewType::RegisterPlatform("ELF", 3, mips3el, platform3LE); + BinaryViewType::RegisterPlatform("ELF", 3, mips3eb, platform3BE); BinaryViewType::RegisterPlatform("ELF", 3, mips64eb, platformBE64); BinaryViewType::RegisterPlatform("ELF", 3, cnmips64eb, platformBE64cn); } -- cgit v1.3.1