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

Elf: Error while processing .so file #704

Closed
mcbegamerxx954 opened this issue Jul 13, 2024 · 9 comments · Fixed by #706
Closed

Elf: Error while processing .so file #704

mcbegamerxx954 opened this issue Jul 13, 2024 · 9 comments · Fixed by #706

Comments

@mcbegamerxx954
Copy link

mcbegamerxx954 commented Jul 13, 2024

Hi, im using the object-rewrite crate in a tool that patches a needed library into aarch64 libminecraft.so the library of the minecraft app for android, but while processing the file it gets this error: Unaligned sh_offset value 0x228be4 for section '.gnu.version_r', expected 0x228be8
is there any fix?, the library loads fine on my device after testing, armv7a patching works fine for some reason

@philipc
Copy link
Contributor

philipc commented Jul 14, 2024

I need to be able to reproduce the problem to be able to fix it. Where can I download the .so?

@mcbegamerxx954
Copy link
Author

I need to be able to reproduce the problem to be able to fix it. Where can I download the .so?

I dont really know how i can go about this since its a paid android game, but im open for testing with my copy

@philipc
Copy link
Contributor

philipc commented Jul 14, 2024

I've previously seen a similar error on another .so: Unsupported sh_offset value 0xb878 for section '.gnu.version_r', expected at least 0xb880. I guess it's possible that it is the same cause, so I'll try fixing that and see if it helps.

@philipc
Copy link
Contributor

philipc commented Jul 18, 2024

Can you test if #705 fixes it for you?

@philipc
Copy link
Contributor

philipc commented Jul 18, 2024

In the likely event that doesn't help, can you give me the output of running:
target/debug/readobj --file-header --segments --sections libminecraft.so

@mcbegamerxx954
Copy link
Author

mcbegamerxx954 commented Jul 18, 2024

That did not work, but here is the readobj output
result.txt

@philipc
Copy link
Contributor

philipc commented Jul 19, 2024

I think #706 will fix this.

@mcbegamerxx954
Copy link
Author

That seems to fix it, thanks!

@mcbegamerxx954
Copy link
Author

Oops, forgot to wait for merge

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

Successfully merging a pull request may close this issue.

2 participants