前言
开发辅助时,一个功能执行一个二进制,这样得写许许多多的二进制文件,后期维护麻烦,造成大量冗余文件。利用shell传参 只开发一个二进制 二进制根据不同的传参调用不同的功能 就解决了此问题,而且还还可以加密调用 防止别人调用你的二进制,增强了安全性!
andLua执行二进制传参
1 2 3
| os.execute("su -c chmod 777 "..文件路径) Runtime.getRuntime().exec("su -c "..文件路径..'\t'.."hpbzk "..'\t'.."1938533005") print("su -c "..文件路径..'\t'.."hpbzk "..'\t'.."0458058@qq.com")
|
Aide执行二进制传参
1 2 3 4
| Runtime runtime = Runtime.getRuntime(); runtime.exec("su -c chmod 777 "+文件路径); String[] bash = {"su -c 文件路径","hpbzk","1938533005"}; Process exec = runtime.exec(bash);
|
C/C++接收shell传参
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| #include "MemoryTools.h" #include <stdlib.h> #include <string.h>
void hpbzk(){ int gs; void *jg; PACKAGENAME *bm="com.happyelements.AndroidAnimal"; BypassGameSafe(); SetSearchRange(A_ANONMYOUS); MemorySearch(bm,"-7",&gs,DWORD); MemoryOffset(bm,"504",0x45,&gs,DWORD); MemoryOffset(bm,"216",0x8E,&gs,DWORD); Print(); MemoryWrite(bm,"100",0x28,DWORD); puts("success"); ClearResults(); }
int main(int argc,char *argv[]) { if (true){ FILE *p1; p1=fopen("/storage/emulated/0/AndLua/project/逍遥游灵/xyyl/cs.txt","w+"); fprintf(p1,"参数个数:%d\n",argc); fprintf(p1,"参数1:%s\n",argv[0]); fprintf(p1,"参数2:%s\n",argv[1]); fprintf(p1,"参数3:%s\n",argv[2]); }
if (argv[2] == NULL || strcmp(argv[2],"1938533005")!=0) { printf("校验不合格执行的功能 \n"); system("am start -a android.intent.action.VIEW -d http://m.baidu.com"); return 0 ; } if (argv[1] != NULL) { if (strcmp(argv[1],"hpbzk")==0) {hpbzk();} if (strcmp(argv[1],"hpbzg")==0) {hpbzg();} }
}
|