Code Monkey home page Code Monkey logo

Comments (2)

DennyDai avatar DennyDai commented on September 28, 2024

@calebh Thank you for reporting it!

The short answer is I'm still currently working on this and will ideally get it done by Hackathon.
You can use ↓ for now (anywhere before apply_patches()) to manually mark certain unused functions as free space. Patcherex will then utilize this space to insert additional code, overwriting the original content.

proj.allocation_manager.add_free_space(addr, size, "RX")

We have received similar feedback through AMP Slack. In both instances, the root cause is Patcherex's attempt to allocate memory blocks at a distance from the patch site that exceeds the range a branch instruction can cover.

While implementing a solution for long-jump capabilities is on our agenda, a more pressing issue stems from how the ELF file is used for the board. Assuming the board in question is Teensy 4.1 (please correct me if I'm wrong), the process begins with converting the ELF file to Intel Hex format using objcopy. This is followed by loading it onto the board via Teensy's proprietary loader. This conversion process removes all segment/section information from the ELF file, and the behavior of the loader remains unclear. Consequently, this makes it challenging for Patcherex to identify appropriate memory addresses for injecting additional code based solely on the ELF or Hex file.

To mitigate this issue, I am developing a component that will extract relevant information from the linker script included in the Teensy toolchain. This enhancement will enable Patcherex to better comprehend the structure of the Teensy 4.1 ELF format. Following this, I plan to investigate the behavior of the firmware loader. In combination with the linker script extractor, this will enable Patcherex to accurately locate and allocate the correct positions for additional code.

from patcherex2.

DennyDai avatar DennyDai commented on September 28, 2024

#25

from patcherex2.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.