Comments (9)
@enty8080
I added MIPS support.
Well, I recommend that you use this just for fun. It may stop processes. See https://github.com/kubo/injector#caveats.
from injector.
@kubo Thanks. Your tool
is great and I hope I won't face such problems, but I do not really understand this caveat. May it stop all the processes including init or just the target process? And any ways to prevent this?
from injector.
May it stop all the processes including init or just the target process?
It may stop just the target process.
And any ways to prevent this?
It is possible in theory but it is difficult for me.
The idea is:
- attach to the target process.
- get a backtrace of the target process as gdb does.
- if the backtrace includes memory management functions such as
malloc
,calloc
,strdup
,free
, step the target process until they disappear from the backtrace. - Here is safe to inject a shared library.
If the target process holds a lock used by memory management functions, injector's library loading, which calls malloc
internally, tries to hold the same lock in the same thread and stops forever.
from injector.
@kubo Thanks for description. Also, I have got a question. So your tool works only on little endian systems or big too? I have this question because in README there are only armel and mipsel, no mipsbe or armbe.
from injector.
It will work also on big endian systems though I have not tested it.
I checked that it was compiled by the following compilers on ubuntu 20.04 x86_64. However I could test only three: mipsel n32 (-mabi=n32
), mipsel o32 (-mabi=32
) and mips64el.
- mips-linux-gnu-gcc (compiler option
-mabi=n32
) - mips-linux-gnu-gcc (compiler option
-mabi=32
) - mipsel-linux-gnu-gcc (compiler option
-mabi=n32
) - mipsel-linux-gnu-gcc (compiler option
-mabi=32
) - mips64-linux-gnuabi64-gcc
- mips64el-linux-gnuabi64-gcc
- mipsisa32r6-linux-gnu-gcc (compiler option
-mabi=n32
) - mipsisa32r6-linux-gnu-gcc (compiler option
-mabi=32
) - mipsisa32r6el-linux-gnu-gcc (compiler option
-mabi=n32
) - mipsisa32r6el-linux-gnu-gcc (compiler option
-mabi=32
) - mipsisa64r6-linux-gnuabi64-gcc
- mipsisa64r6el-linux-gnuabi64-gcc
from injector.
@kubo I am just curious if it will work on embedded Linux. For instance, router that has Linux 2.5 with musl c library and mipsel CPU. I am gonna test this, but I also want to know if you think this will work.
BTW, have you tried to inject dylib to macho process (macOS)?
from injector.
I think that it works. Support for musl libc was contributed at #22.
BTW, how about LD_PRELOAD
or /etc/ld.so.preload
in order to inject libraries?
As for macOS, I won't support it. I don't know how to do it on macOS and I don't have macOS machine suitable for the latest OS. (I have macbook air mid 2013.)
from injector.
@kubo I thought LD_PRELOAD
can only inject shared library to the app, that you run at the same time. I thought you can't use LD_PRELOAD
for injecting .so
to the running process.
from injector.
@enty8080 You are correct. It isn't in-place replacement of injector. I recommend that you have a rethink about your application design because injector have the caveat I cannot fix.
from injector.
Related Issues (20)
- add option HOT 2
- Create new process and inject HOT 1
- macos dylib injector HOT 1
- Segfault in ld on ARM HOT 2
- Could not find libc HOT 4
- PTRACE_ATTACH error : Operation not permitted HOT 6
- Trace/breakpoint trap on UserLAnd (Android App) HOT 1
- `INJERR_NO_LIBRARY` and `INJERR_NO_FUNCTION` have same integer representation
- ubuntu 18.04 inject snap process failed HOT 2
- Support RISC-V HOT 2
- Support PowerPC HOT 2
- injector_uninject should fail when the libc is musl. HOT 1
- Wine? HOT 4
- expose API to set libc name?
- Compile for Windows on Linux (mingw) HOT 1
- Safe injection on linux HOT 3
- Pass an argument to function HOT 3
- Inconsistency detected by ld.so HOT 2
- -Wimplicit-function-declaration and -Wint-conversion when compiling under MinGW x64 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from injector.