Comments (2)
@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.
from patcherex2.
Related Issues (9)
- Private tests doesn't work on PR
- Instructions that use the PC are considered movable HOT 1
- Proposal: Copy and Micropatch based target HOT 6
- Feature: Extract memory layout and other information from embedded target toolchains
- Alignment issues with InsertInstructionPatch HOT 2
- .eh_frame (exception frame) section getting tacked onto compiled C code for some bases HOT 1
- Linker doesn't resolve relocations when relocatable flag is used HOT 5
- Trampoline does not jump back to proper location when force_insert=True HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patcherex2.