From 8f7d22f6de09a9f2ccf6784d37567371fc489296 Mon Sep 17 00:00:00 2001 From: Misty Date: Sat, 13 Jun 2020 22:33:52 +0800 Subject: [PATCH] Update to support off-device use --- mkxq | Bin 29456 -> 29368 bytes mkxqimage.c | 33 +++++++++++++++++++++++++++------ public.pem | 9 +++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 public.pem diff --git a/mkxq b/mkxq index d87781ad36bce9ae793946a2dd82e9a777858edd..0cd7290ea1a2e3421d9909012f1efc703a38bbbf 100644 GIT binary patch delta 9937 zcma)C4O~=Zxz|$5UsS7qGeOG zIzvP13{6L+VtK*fEfY2NXGyQf^OK5nVJf&ZZpb1d0+BcR}Lrr2(q^30)juitj=A(NdhW zu)>0vB}vbuBHj#b`OAA$`0P!bL_Q3cg6(L2z$aMex5t0-r z&DL>E!u_EV^zNej2byy$!SZFK)~KT0r17PC>J7f$L~R4J>S~L$V)ZtQxG{Bm2=@pV#_Ux7HKj&ez(qd z`tkd8-tEVK0G{iYdi)AHbb~%W{;1ANexvw=&WHH%U+a97AMermxC+ZnT)%fZe5)5& z{0zR+`7}TNdJ#Q4XjOz+IMKdJX;!3(iXy|~d37+ZO5Knbk9=y1G)3@wVqBH97B&YX z!z1+NNEFo4n_&CEvXyZ)(n+vsQQ;8-3<|P^qN7YS2W*%R`x2FbZ3G+c!?w~&u&rPR z`LG9RD_A#Jp6bSRoDPAFiw=(%Y*3JHlA}$ef*s<+_K^*2ZFG3NKI27M$gLJ3Iof!7 zI@%PGAh7loM;l;s9G*t_uxYdhY{=m72#XI}L>Ivpflc;dRZ1FcqDrtSKI|Nt1-1oj zst=1igFOf~&4)#v!S;d8@L`c>uxT;j5o3H<BF|tO!RGj|$TQehu(>`g z@(k7;6JD3+!>SG4A*w5=WP(Lf9qrXhe}~$zFXTP1Mt}b1aTclH`X_uxnoDuVxRT2~ zo&C71PcY^|<>?T3J!4*yJ?#RoW6Zgg1CFym;(9Ri0j=3(n;7g%8&!+0CxI_tG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5%d*eri7w7coxVpHx-y}q#ZjL@|>hm>i@d(51IPlSkGB8JWDla$5)7ch}KlZR(_wZ+ZaBtNdNgH&2 zW4cB>q(}d>uzi((|5g5qt}{s=v=epPKZ56&SL!`vEQ}xO`lI7C#aa4jdt7Ad$EzQH z08(zU9M!Gf8L3(QU9aWT?u|<-gY{pM?LM(QHz-#8zRYI3W6I@QV|g*;TPYM*nH6qq6R@hx zs4R#vR%k;WrspfO!;MwYZKKaC3&M?Mxu=9;s|tD>KZ{GJ=~acjjWsccHdhsrS`|%4 os&ah0jG}2;>kg1*tyf-2mUV^U2bO4Da2U;7S0H~%o7WBbe_FwKod5s; diff --git a/mkxqimage.c b/mkxqimage.c index 948e837..89ef881 100644 --- a/mkxqimage.c +++ b/mkxqimage.c @@ -199,6 +199,7 @@ size_t util_get_file_len(FILE *a1) //----- (00000000004017F8) ---------------------------------------------------- int util_check_model_idx(int16_t model_idx) { +#ifdef ONDEVICE int result; // w0 char v3[8]; // [xsp+20h] [xbp+20h] BYREF FILE *stream; // [xsp+28h] [xbp+28h] @@ -236,6 +237,10 @@ int util_check_model_idx(int16_t model_idx) result = -1; } return result; +#else + printf("%s\n", model_nr[model_idx]); + return 0; +#endif } //----- (0000000000401918) ---------------------------------------------------- @@ -874,11 +879,18 @@ int64_t init_pkey(EVP_MD_CTX *ctx, RSA **pem, EVP_PKEY **ppkey, int isSsh) int64_t result; // x0 const EVP_MD *algo; // x0 FILE *stream; // [xsp+38h] [xbp+38h] - +#ifdef ONDEVICE if ( isSsh == 1 ) stream = fopen("/usr/share/xiaoqiang/public_ssh.pem", "rb"); else stream = fopen("/usr/share/xiaoqiang/public.pem", "rb"); +#else + if ( isSsh == 1 ) + stream = fopen("public_ssh.pem", "rb"); + else + stream = fopen("public.pem", "rb"); +#endif + if ( stream ) { *pem = PEM_read_RSA_PUBKEY(stream, 0LL, 0LL, 0LL); @@ -1091,8 +1103,7 @@ int64_t transpostGuid(uint8_t *a1, char *outbuf) char *curRow; // [xsp+130h] [xbp+130h] int rowI; // [xsp+138h] [xbp+138h] unsigned int row; // [xsp+13Ch] [xbp+13Ch] - char a9[32]; // [xsp+140h] [xbp+140h] BYREF - + row = 0; rowI = 0; n = 0; @@ -1101,16 +1112,16 @@ int64_t transpostGuid(uint8_t *a1, char *outbuf) { if ( *a1 == '-' ) { - a9[32 * row++ - 0x118 + rowI] = 0; + mat[row++][rowI] = 0; rowI = 0; } else { - a9[32 * row - 0x118 + rowI++] = *a1; + mat[row][rowI++] = *a1; } ++a1; } - a9[32 * row - 0x118 + rowI] = 0; + mat[row][rowI] = 0; curRow = outbuf; while ( 1 ) { @@ -1148,12 +1159,22 @@ int64_t get_ssh_key() memset(Sn, 0, 100); memset(snStr, 0, 100); memset(magic, 0, 100); +#ifdef ONDEVICE stream = popen("nvram get SN", "r"); +#else + stream = fopen("SN.txt", "r"); +#endif if ( !stream ) return puts("Failed to run command"); + while ( fgets(Sn, 100, stream) ) sscanf(Sn, "%s", snStr); + +#ifdef ONDEVICE pclose(stream); +#else + fclose(stream); +#endif transpostGuid("d44fb0960aa0-a5e6-4a30-250f-6d2df50a", magic); sprintf(Sn, "%s%s", snStr, magic); calcMd5(md5Output, Sn); diff --git a/public.pem b/public.pem new file mode 100644 index 0000000..ac4ae72 --- /dev/null +++ b/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuhCogvvVhAng3ZRJP8Cz +gxIkXvdbz5NHyOpOmYjrass6WL93EHKfS+Qa/NaG4d3u9H2GkgrUbOjjID9mRkiR +voXprgNIEEcWzdHsVOlrwk9K+psXFW9mM+0zKxdgt8cuPnM/UAm9i5XTfDgQNwy8 +0Ygcs9qqofm2f3DsK3bR6JyFuf1LbyHUYAymOm2+E7XguPuxUn9i7h1s5/nkWZOm +22kMqYPBZrHf1T5hfZ7XhQGMORaK34a6nk5Vx1qrNrZvZuJdYXldSnvFWO+SHK1Q +J+NE4RD5S6Bs79nB7vTDzLgqCqvtWLgew+s0JE0jLZZpxAwJXO3XYaLV0irO6a6/ +YwIDAQAB +-----END PUBLIC KEY-----