Skip to content

Commit

Permalink
not inject mips and loong64.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Oct 17, 2024
1 parent 076d778 commit a847b0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/inject_into_elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Napi::Value inject_into_elf(const Napi::CallbackInfo& info)
return result;
}

LIEF::ELF::ARCH machine_type = binary->header().machine_type();
if (machine_type == LIEF::ELF::ARCH::EM_LOONGARCH || machine_type == LIEF::ELF::ARCH::EM_MIPS) {
result.Set("result", Napi::Number::New(env, InjectResult::kError));
return result;
}

LIEF::ELF::Note* existing_note = nullptr;

for (LIEF::ELF::Note& note : binary->notes()) {
Expand Down
3 changes: 2 additions & 1 deletion vender/LIEF/include/LIEF/ELF/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ enum class ARCH: size_t {
EM_CSR_KALIMBA = 219, /**< CSR Kalimba architecture family */
EM_AMDGPU = 224, /**< AMD GPU architecture */
EM_RISCV = 243, /**< RISC-V */
EM_BPF = 247 /**< eBPF Filter */
EM_BPF = 247, /**< eBPF Filter */
EM_LOONGARCH = 258 /**< LoongArch */
};


Expand Down

0 comments on commit a847b0f

Please sign in to comment.