Change The Cid
Change The Cid
Change The Cid
com/raburton/evoplus_cid
https://github.com/raburton/evoplus_cid.git
Before:
1b534d454231515430a51561bd012400
To Be:
5d5342303030384712750a9e2f0117bf
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <arpa/inet.h>
#include "mmc.h"
#define CID_SIZE 16
#define PROGRAM_CID_OPCODE 26
#define SAMSUNG_VENDOR_OPCODE 62
idata.data_timeout_ns = 0x10000000;
idata.write_flag = 1;
idata.opcode = SAMSUNG_VENDOR_OPCODE;
idata.arg = arg;
idata.flags = MMC_RSP_R1B | MMC_CMD_AC;
return ret;
}
return ret;
}
idata.data_timeout_ns = 0x10000000;
idata.write_flag = 1;
idata.opcode = PROGRAM_CID_OPCODE;
idata.arg = 0;
idata.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
idata.blksz = CID_SIZE;
idata.blocks = 1;
idata.data_ptr = (__u64)cid;
return ret;
}
int count;
unsigned char crc = 0;
long val;
return (int)val;
}
len = strlen(argv[2]);
if (len != 30 && len != 32) {
printf("CID should be 30 or 32 chars long!\n");
return;
}
// parse cid
for (i = 0; i < (len/2); i++){
ret = sscanf(&argv[2][i*2], "%2hhx", &cid[i]);
if (!ret){
printf("CID should be hex (without 0x prefix)!\n");
return;
}
}
// open device
fd = open(argv[1], O_RDWR);
if (fd < 0){
printf("Unable to open device %s\n", argv[1]);
return;
}
// unlock card
//ret = 0;
ret = cid_backdoor(fd);
if (!ret){
// write new cid
printf("Writing new CID: ");
show_cid(cid);
ret = program_cid(fd, cid);
if (!ret){
printf("Success! Remove and reinsert SD card to check new
CID.\n");
}
}
close(fd);