go-memexec icon indicating copy to clipboard operation
go-memexec copied to clipboard

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

Open Baiyuetribe opened this issue 3 years ago • 2 comments

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

Baiyuetribe avatar Apr 16 '22 04:04 Baiyuetribe

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.

0xE232FE avatar Apr 19 '22 18:04 0xE232FE

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.

amenzhinsky avatar Apr 20 '22 08:04 amenzhinsky