Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleigh-lifter will lift past the end of the provided bytes #176

Open
2over12 opened this issue Apr 28, 2023 · 1 comment
Open

Sleigh-lifter will lift past the end of the provided bytes #176

2over12 opened this issue Apr 28, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@2over12
Copy link
Contributor

2over12 commented Apr 28, 2023

We should probably check the length of the lifted instruction to make sure we arent reading bytes from the 0 fill

ie. ./extra-tools/sleigh-lift/sleigh-lift disassemble ARM7_le.sla 002C -p ./specfiles should not print:
0x00000000: andeq r2,r0,r0, lsl #0x18

and should probably present an error like "not enough bytes"

For users who are not aware of how fills work on the backend/context registers etc the current behavior is non-obvious

@2over12 2over12 added the enhancement New feature or request label Apr 28, 2023
@tetsuo-cpp tetsuo-cpp self-assigned this Apr 29, 2023
@tetsuo-cpp
Copy link
Contributor

Had a quick look at this today but I think it'll require a bit more thought. Even in the normal case where we've provided sufficient instruction data, Sleigh calls loadFill with a size argument past the end of the image buffer.

I suspect that's not a bug on our end but rather that's how Sleigh expects LoadImage implementations to work since the implementations that I can spot in Ghidra seem to have this zero-fill behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants