lief-project / LIEF

LIEF - Library to Instrument Executable Formats

Home Page:https://lief.re

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't save changes in a corefile

KiteBuilder opened this issue · comments

Describe the bug
I can't save corefile changes.
When I try to save it I see next output

Note type: CORE_PRPSINFO ('CORE') is not supported
Note type: CORE_PRSTATUS ('CORE') is not supported
Note type: CORE_FPREGSET ('CORE') is not supported
Note type: CORE_SIGINFO ('CORE') is not supported
Note type: CORE_AUXV ('CORE') is not supported

To Reproduce
Core dump file was taken from lief examples ELF64_AArch64_core_hello.core
Example from https://lief.re/doc/latest/tutorials/12_elf_coredump.html
Next simple code was executed:

#!/usr/bin/env python3
import lief

core = lief.parse("./ELF64_AArch64_core_hello.core")
prstatus = core.get(lief.ELF.Note.TYPE.CORE_PRSTATUS)
reg_val = prstatus.get(lief.ELF.CorePrStatus.Registers.AARCH64.PC)
print("PC before change", hex(reg_val))
prstatus.set(lief.ELF.CorePrStatus.Registers.AARCH64.PC, 0xAABBCCDD)
reg_val = prstatus.get(lief.ELF.CorePrStatus.Registers.AARCH64.PC)
print("PC after change", hex(reg_val))
core.write("new.core")

Expected behavior
Changes in the core file should be saved as it was described in example https://lief.re/doc/latest/tutorials/12_elf_coredump.html

Environment (please complete the following information):

  • System and Version : [e.g. Ubuntu 22.04.2]
  • Core file
  • LIEF commit version: 0.14.1-bae887e0

Additional context
I've attached the corefile example