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

Cannot relocate large libraries #78

Open
JJTech0130 opened this issue Nov 16, 2022 · 1 comment
Open

Cannot relocate large libraries #78

JJTech0130 opened this issue Nov 16, 2022 · 1 comment

Comments

@JJTech0130
Copy link

Large libraries cannot be relocated, because load_base + value_orig overflows a 4 byte integer. Not sure what the solution would be.
Here's the culprit library:
libCoreADI.so.zip
and the backtrace:

Exception has occurred: OverflowError
int too big to convert
  File "/workspaces/test/AndroidNativeEmu/src/androidemu/internal/modules.py", line 197, in load_module
    self.emu.uc.mem_write(rel_addr, value.to_bytes(4, byteorder='little'))
  File "/workspaces/test/AndroidNativeEmu/src/androidemu/emulator.py", line 141, in load_library
    libmod = self.modules.load_module(filename)
  File "/workspaces/test/test.py", line 26, in <module>
    adi_core = emulator.load_library(f"{library_path}/libCoreADI.so", do_init=False)
@JJTech0130
Copy link
Author

I fixed it by moving MODULES_MIN down to 0x80000000 in memory/__init__.py. Let's hope it doesn't break anything.

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

No branches or pull requests

1 participant