Skip to content
Snippets Groups Projects
Commit db24dec1 authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

adding arm32 for rida, though it still doesnt making xforming arm32 binaries work without ida.

parent e15c08d2
Branches
Tags cfar-phase3-final
No related merge requests found
Pipeline #3859 passed
...@@ -74,9 +74,10 @@ class CreateFunctions_t ...@@ -74,9 +74,10 @@ class CreateFunctions_t
} }
const auto cs_mode= const auto cs_mode=
machine_type==mtAarch64 ? CS_MODE_LITTLE_ENDIAN : machine_type == mtArm32 ? CS_MODE_LITTLE_ENDIAN :
file_class==ELF64 ? CS_MODE_64 : machine_type == mtAarch64 ? CS_MODE_LITTLE_ENDIAN :
file_class==ELF32 ? CS_MODE_32 : file_class == ELF64 ? CS_MODE_64 :
file_class == ELF32 ? CS_MODE_32 :
throw std::runtime_error("Cannot handle ELF class"); throw std::runtime_error("Cannot handle ELF class");
const auto my_cs_arch = const auto my_cs_arch =
...@@ -394,7 +395,7 @@ class CreateFunctions_t ...@@ -394,7 +395,7 @@ class CreateFunctions_t
addName(i,dynsymEntryIndex++); addName(i,dynsymEntryIndex++);
} }
}; };
const auto handle_arm_plt=[&]() const auto handle_arm64_plt=[&]()
{ {
const auto plt_entry_size=16; const auto plt_entry_size=16;
const auto plt_header_size=8*4; const auto plt_header_size=8*4;
...@@ -406,6 +407,18 @@ class CreateFunctions_t ...@@ -406,6 +407,18 @@ class CreateFunctions_t
addName(i,dynsymEntryIndex++); addName(i,dynsymEntryIndex++);
} }
}; };
const auto handle_arm32_plt=[&]()
{
const auto plt_entry_size=3*4; // 3 instructions
const auto plt_header_size=5*4; // 5 instructions
addRange(startAddr,plt_header_size);
for(auto i=startAddr+plt_header_size; i<endAddr; i+=plt_entry_size)
{
addRange(i,plt_entry_size);
addName(i,dynsymEntryIndex++);
}
};
switch(machine_type) switch(machine_type)
{ {
...@@ -414,7 +427,10 @@ class CreateFunctions_t ...@@ -414,7 +427,10 @@ class CreateFunctions_t
handle_x86_plt(); handle_x86_plt();
break; break;
case mtAarch64: case mtAarch64:
handle_arm_plt(); handle_arm64_plt();
break;
case mtArm32:
handle_arm32_plt();
break; break;
default: default:
assert(0); assert(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment