hack0z / luject Goto Github PK
View Code? Open in Web Editor NEW🍹A static injector of dynamic library for application (android, iphoneos, macOS, windows, linux)
Home Page: https://tboox.org
License: Apache License 2.0
🍹A static injector of dynamic library for application (android, iphoneos, macOS, windows, linux)
Home Page: https://tboox.org
License: Apache License 2.0
luject -i aa.apk ../frida_lx/frida-gadget-15.1.1-android-x86_64.so
extract aa.apk
x86_64 found!
error: /var/folders/69/t_nd3vwx22n0wnrn13qtz4nr0000gn/T/.luject501/210913/aa.tmp/lib/armeabi not found!
命令行
luject -i aa.apk ../frida_lx/frida-gadget-15.1.1-android-x86_64.so
操作系统 macos
apk结构:
/lib/arm64-v8a/.so
/lib/armeabi -v7a/.so
Linux kali 5.7.0-kali1-amd64
Zip 3.0
root@kali:/home/kali# luject -i base.apk -p libcore libfrida-gadget.so
error: zip not found!
xmake version :
xmake v2.7.9+20230515, A cross-platform build utility based on Lua
issue print to terminal
[ 25%]: cache compiling.release src/lni/main.cpp
/usr/bin/gcc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++14 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -isystem /home/jiachengy/.xmake/packages/l/libxmake/v2.7.1/e20dade54e864035be295e18a062200d/include -isystem /home/jiachengy/.xmake/packages/l/libxmake/v2.7.1/e20dade54e864035be295e18a062200d/include/lua -isystem /home/jiachengy/.xmake/packages/l/lief/0.11.5/5fd114f41ff6445fb276c359a1d679ec/include -DNDEBUG -o build/.objs/luject/linux/x86_64/release/src/lni/main.cpp.o src/lni/main.cpp
error: src/lni/main.cpp: In function ‘tb_int_t lni_pe_add_libraries(lua_State*)’:
src/lni/main.cpp:44:23: error: ‘lua_objlen’ was not declared in this scope; did you mean ‘lua_len’?
44 | tb_size_t n = lua_objlen(lua, 3);
| ^~~~~~~~~~
| lua_len
src/lni/main.cpp: In function ‘tb_int_t lni_elf_add_libraries(lua_State*)’:
src/lni/main.cpp:86:23: error: ‘lua_objlen’ was not declared in this scope; did you mean ‘lua_len’?
86 | tb_size_t n = lua_objlen(lua, 3);
| ^~~~~~~~~~
| lua_len
src/lni/main.cpp: In function ‘tb_int_t lni_macho_add_libraries(lua_State*)’:
src/lni/main.cpp:161:23: error: ‘lua_objlen’ was not declared in this scope; did you mean ‘lua_len’?
161 | tb_size_t n = lua_objlen(lua, 3);
| ^~~~~~~~~~
| lua_len
src/lni/main.cpp: In function ‘tb_int_t main(tb_int_t, tb_char_t**)’:
src/lni/main.cpp:223:30: warning: ISO C++ forbids converting a string constant to ‘tb_char_t*’ {aka ‘char*’} [-Wwrite-strings]
223 | tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null};
| ^~~~~
src/lni/main.cpp:223:37: warning: ISO C++ forbids converting a string constant to ‘tb_char_t*’ {aka ‘char*’} [-Wwrite-strings]
223 | tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null};
| ^~~~
src/lni/main.cpp:223:43: warning: ISO C++ forbids converting a string constant to ‘tb_char_t*’ {aka ‘char*’} [-Wwrite-strings]
223 | tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null};
| ^~~~~~~~~~
Please describe your problem details here.
Clone master branch ,xmake show this issue
[ 5%]: cache compiling.release src/sv/sv/src/semvers.c
[ 5%]: cache compiling.release src/sv/sv/src/comp.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lj_debug.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lib_io.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lj_vmmath.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lj_mcode.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lj_opt_split.c
[ 6%]: cache compiling.release src/luajit/luajit/src/lib_debug.c
if you want to get more verbose errors, please see:
-> /Users/xxxxxx/.xmake/cache/packages/2209/l/libxmake/v2.5.9/installdir.failed/logs/install.txt
error: install failed!
detail logs :
[ 59%]: cache compiling.release src/tbox/tbox/src/tbox/platform/ifaddrs.c
[ 59%]: cache compiling.release src/tbox/tbox/src/tbox/platform/socket.c
[ 59%]: cache compiling.release src/tbox/tbox/src/tbox/platform/poller.c
[ 60%]: cache compiling.release src/tbox/tbox/src/tbox/platform/page.c
[ 60%]: cache compiling.release src/tbox/tbox/src/tbox/platform/addrinfo.c
[ 60%]: cache compiling.release src/tbox/tbox/src/tbox/platform/time.c
[ 60%]: cache compiling.release src/tbox/tbox/src/tbox/platform/semaphore.c
[ 60%]: cache compiling.release src/tbox/tbox/src/tbox/platform/event.c
[ 61%]: cache compiling.release src/tbox/tbox/src/tbox/platform/backtrace.c
[ 61%]: cache compiling.release src/tbox/tbox/src/tbox/platform/path.c
error: src/tbox/tbox/src/tbox/platform/ifaddrs.c:187:17: error: variable 'ipflags' set but not used [-Werror,-Wunused-but-set-variable]
tb_uint32_t ipflags = 0;
xmake编译工程报错
=> install lief 0.11.5 .. failed
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c: In function ‘mbedtls_aesni_crypt_ecb’:
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c:100:43: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
asm( "movdqu (%3), %xmm0 \n\t" // load input
^
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c:100:43: warning: (this will be reported only once per input file) [enabled by default]
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c: In function ‘mbedtls_aes_crypt_ecb’:
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c:1031:9: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
// If padlock data misaligned, we just fall back to
^
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c:1031:9: warning: (this will be reported only once per input file) [enabled by default]
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c: At top level:
cc1: warning: unrecognized command line option "-Wno-expansion-to-defined" [enabled by default]
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aria.c:205:37: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
ta = *b; // 4567
^
/root/.xmake/cache/packages/2206/l/lief/0.11.5/source/LIEF-0.11.5/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aria.c:205:37: warning: (this will be reported only once per input file) [enabled by default]
cc1: warning: unrecognized command line option "-Wno-expansion-to-defined" [enabled by default]
if you want to get more verbose errors, please see:
-> /root/.xmake/cache/packages/2206/l/lief/0.11.5/installdir.failed/logs/install.txt
error: install failed!
ubuntu3.6.2 x86_64
xmake按照示例安装的2.5.9 xmake-v2.5.9.gz.run
安装完成后
cd ./luject-master 目录进行
xmake 工程编译
win系统也试过,也是执行到lief安装报错
请问是不是我操作有问题
请提供编译和运行环境
请提供其他附加信息帮助我们诊断问题。
提取APK时失败。
PS E:\项目\luject> xmake run luject -i .\xxx.apk -p libxlua.so .\frida-gadget-arm64.so
extract xxx.apk
error: extract failed!
error: execv(E:\项目\luject\build\windows\x64\release\luject.exe -i .\xxx.apk -p libxlua.so .\frida-gadget-arm64.so) failed(-1)
`[username@vmi442840 luject]$ xmake
checking for platform ... linux
checking for architecture ... x86_64
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> lief 0.11.5
please input: y (y/n/m)
y
=> install lief 0.11.5 .. failed
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c: In function ‘mbedtls_aes_crypt_ecb’:
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c:1031:9: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
// If padlock data misaligned, we just fall back to
^
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c:1031:9: warning: (this will be reported only once per input file) [enabled by default]
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aes.c: At top level:
cc1: warning: unrecognized command line option "-Wno-expansion-to-defined" [enabled by default]
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c: In function ‘mbedtls_aesni_crypt_ecb’:
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c:100:43: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
asm( "movdqu (%3), %xmm0 \n\t" // load input
^
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c:100:43: warning: (this will be reported only once per input file) [enabled by default]
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aesni.c: At top level:
cc1: warning: unrecognized command line option "-Wno-expansion-to-defined" [enabled by default]
/home/username/.xmake/cache/packages/2307/l/lief/0.11.5/source/build_5fd114f4/mbed_tls/src/lief_mbed_tls/library/aria.c:205:37: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
ta = *b; // 4567
^
if you want to get more verbose errors, please see:
-> /home/username/.xmake/cache/packages/2307/l/lief/0.11.5/installdir.failed/logs/install.txt
error: install failed!`
环境:win10 1909
程序:test.exe,test.dll,均为vs2010编译
使用Actions中编译好的windows版本luject程序,将test.dll注入到test.exe程序,提示成功,生成了test_injected.exe 程序,但是经过测试发现,运行test_injected.exe, test.dll并没有被加载
~/Downloads/luject-1.0.5 xmake
[ 50%]: linking.release luject
error: Undefined symbols for architecture x86_64:
"lua_objlen(lua_State*, int)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_rawget(lua_State*, int)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_settop(lua_State*, int)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_pushnil(lua_State*)", referenced from:
lni_elf_detect_arch(lua_State*) in main.cpp.o
"lua_pushnumber(lua_State*, double)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_pushstring(lua_State*, char const*)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_elf_detect_arch(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_pushboolean(lua_State*, int)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_pushlstring(lua_State*, char const*, unsigned long)", referenced from:
lni_elf_detect_arch(lua_State*) in main.cpp.o
"luaL_checklstring(lua_State*, int, unsigned long*)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_elf_detect_arch(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
"lua_type(lua_State*, int)", referenced from:
lni_pe_add_libraries(lua_State*) in main.cpp.o
lni_elf_add_libraries(lua_State*) in main.cpp.o
lni_macho_add_libraries(lua_State*) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.