add show model

This commit is contained in:
Xu Zhaowei 2021-08-14 10:21:15 +08:00
parent 673b9fd905
commit 9604058858
2 changed files with 35 additions and 15 deletions

View File

@ -1,4 +1,4 @@
# ax3600_tool # xiaomi/redmi ax router tool
backup your mtd9 backup your mtd9
@ -7,16 +7,17 @@ backup your mtd9
unlock the partition lock(automatic reboot) unlock the partition lock(automatic reboot)
`/tmp/fuckax3600 unlock` `/tmp/mitool unlock`
set ssh/uart/telnet to enable and display the default username/password set ssh/uart/telnet to enable and display the default username/password
`/tmp/fuckax3600 hack` `/tmp/mitool hack`
relock the partition lock, otherwise the wifi will not work normally(automatic reboot) relock the partition lock, otherwise the wifi will not work normally(automatic reboot)
`/tmp/fuckax3600 lock` `/tmp/mitool lock`
show password only show password only
`/tmp/fuckax3600 password` `/tmp/mitool password`

View File

@ -1,8 +1,9 @@
/* /*
* *
* Copyright 2020-2021, paldier<paldier@hotmail.com>. * Copyright (C) 2020-2021, paldier<paldier@hotmail.com>.
*${CORSS_PREFIX}gcc -static fuckax3600.c -o fuckax3600 *
*${CORSS_PREFIX}strip fuckax3600 *${CORSS_PREFIX}gcc -static mitool.c -o mitool
*${CORSS_PREFIX}strip mitool
* *
*/ */
#include <stdio.h> #include <stdio.h>
@ -218,17 +219,20 @@ void MD5Final(MD5_CTX *context,unsigned char digest[16])
static void usage(void) static void usage(void)
{ {
fprintf(stderr, "Copyright 2020-2021, paldier<paldier@hotmail.com>.\n"); fprintf(stderr, "Copyright (c) 2020-2021, paldier<paldier@hotmail.com>.\n");
fprintf(stderr, "Usage: fuckax3600\n"); fprintf(stderr, "Usage: mitool\n");
fprintf(stderr, "fuckax3600 lock\n"); fprintf(stderr, "mitool lock\n");
fprintf(stderr, "\tlock mtd9 and auto reboot\n"); fprintf(stderr, "\tlock mtd9 and auto reboot\n");
fprintf(stderr, "fuckax3600 unlock\n"); fprintf(stderr, "mitool unlock\n");
fprintf(stderr, "\tunlock mtd9 and auto reboot\n"); fprintf(stderr, "\tunlock mtd9 and auto reboot\n");
fprintf(stderr, "fuckax3600 password\n"); fprintf(stderr, "mitool password\n");
fprintf(stderr, "\tprintf default password\n"); fprintf(stderr, "\tprintf default password\n");
fprintf(stderr, "fuckax3600 hack\n"); fprintf(stderr, "mitool hack\n");
fprintf(stderr, "\tset ssh telnet uart to default enable\n"); fprintf(stderr, "\tset ssh telnet uart to default enable\n");
fprintf(stderr, "mitool model\n");
fprintf(stderr, "\tshow model\n");
} }
static const unsigned int crc32tab[] = { static const unsigned int crc32tab[] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL,
0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L,
@ -446,11 +450,20 @@ static int lock_mtd(int t)
} }
static int model_show(void)
{
int i,j;
unsigned char model[]="model";
if(load_buf()<0)
return -1;
memset(buf, 0, sizeof(buf));
i = GetSubStrPos(buf,model);
printf("%s\n",buf);
}
static int password_show(void) static int password_show(void)
{ {
int i,j; int i,j;
unsigned char buff[99];
unsigned char decrypt[16]; unsigned char decrypt[16];
unsigned char sn[99]; unsigned char sn[99];
unsigned char salt[]="6d2df50a-250f-4a30-a5e6-d44fb0960aa0"; unsigned char salt[]="6d2df50a-250f-4a30-a5e6-d44fb0960aa0";
@ -482,9 +495,12 @@ static int calc_img_crc()
unsigned char c[]="ssh_en"; unsigned char c[]="ssh_en";
unsigned char c1[]="telnet_en"; unsigned char c1[]="telnet_en";
unsigned char c2[]="uart_en"; unsigned char c2[]="uart_en";
unsigned char c3[]="model";
if(load_buf()<0) if(load_buf()<0)
return -1; return -1;
i = GetSubStrPos(buf,c3);
printf("%s\n",buf);
i = GetSubStrPos(buf,c); i = GetSubStrPos(buf,c);
printf("get ssh_en=%c",buf[i+7]); printf("get ssh_en=%c",buf[i+7]);
buf[i+7]='1';//ssh buf[i+7]='1';//ssh
@ -537,8 +553,11 @@ int main(int argc, char **argv)
else if (!strcmp(argv[1], "password")){ else if (!strcmp(argv[1], "password")){
password_show(); password_show();
printf("ssh default usesrname:root password:%s\n",password); printf("ssh default usesrname:root password:%s\n",password);
else if (!strcmp(argv[1], "model")){
model_show();
} else } else
usage(); usage();
return 0; return 0;
} }