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

How do I ensure that multiple dependent library files are called? #5

Open
Baiyuetribe opened this issue Apr 16, 2022 · 2 comments
Open

Comments

@Baiyuetribe
Copy link

First of all, thank you for your work, it was great.
Currently only a single executable can be called, but in practice we encounter programs that may also call multiple dynamic library files or other dependencies, in which case go-memexec will indicate that the dependency file does not exist.

foo.exe
bar.dll

If foo depends on bar,go-memexec will indicate that the dependency file bar.dll does not exist.I used the embedded filesystem to fix it and it failed

If there is a file system embedded, is it possible to export this file system to the cache directory as well? This should solve the problem of non-existent files

@0xE232FE
Copy link

I have done it with C and Go. But I needed to work the C Code for all platforms. Linux and Windows actually is working. OSX/Darwin is problematic atm.

@amenzhinsky
Copy link
Owner

I'd create a tempdir, copy the binary along with all dependencies there and run it with LD_PRELOAD_PATH={tempdir} env var on Linux, I believe other platforms have similar ways to override dynamic library path.

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

3 participants