Caanoo / WIZ Find Serial Number Of Wiz?


It doesn't have one as such - there's a serial number, but that gets reset, so it's not 100% unique.
You could read the contents of e2 and calculate one, but that also isn't going to be 100% unique, but the chance of finding two of the same is going to be pretty slim.

If your thinking about software protection, the most unique number is going to be the serial number of the inserted SD card.
 
I just need a one out of 1000 number, so what's the "easiest" code to do that? I have no idea about "e2".
 
Chapter 5, "ECID module of the POLLUX stores the 128bit DIEID information on a e-fuse ROM. Each die will have its own DIEID to identify its lot number, wafer number and position on wafer."

Register details also there.
 
Code:
	int memfd = open("/dev/mem", O_RDWR);

	volatile unsigned int *memregs32;
	memregs32 = (volatile unsigned int*) mmap(0, 0x20000, PROT_READ|PROT_WRITE, MAP_SHARED, memfd, 0xC0000000);


int rv = 0;
	typedef struct regStruct_guid {
		unsigned long  Data1; 
	    unsigned short  Data2; 
	    unsigned short  Data3; 
	    unsigned char  Data4[8]; 
	}regStruct_guid;


	regStruct_guid *guid_reg;
	guid_reg = (regStruct_guid*) memregs32[0x1F844];
	rv = guid_reg -> Data1;


	close(memfd);

	return rv;

crashes for me :(
 
According to the ECID manual, try:

Code:
	typedef struct regStruct_guid {
		unsigned long Data1; 
		unsigned short Data2; 
		unsigned short Data3; 
		unsigned char Data4[8]; 
	} regStruct_guid;

        regStruct_guid guid_reg;
        guid_reg.Data1 = (unsigned long)memregs32[0x1F844>>2];
        guid_reg.Data2 = (unsigned short)(memregs32[0x1F848>>2] >> 16);
        guid_reg.Data3 = (unsigned short)memregs32[0x1F848>>2];
        guid_reg.Data4[0] = (unsigned char)memregs32[0x1F84C>>2];
        guid_reg.Data4[1] = (unsigned char)(memregs32[0x1F84C>>2] >> 8);
        guid_reg.Data4[2] = (unsigned char)(memregs32[0x1F84C>>2] >> 16);
        guid_reg.Data4[3] = (unsigned char)(memregs32[0x1F84C>>2] >> 24);
        guid_reg.Data4[4] = (unsigned char)memregs32[0x1F850>>2];
        guid_reg.Data4[5] = (unsigned char)(memregs32[0x1F850>>2] >> 8);
        guid_reg.Data4[6] = (unsigned char)(memregs32[0x1F850>>2] >> 16);
        guid_reg.Data4[7] = (unsigned char)(memregs32[0x1F850>>2] >> 24);
 
You seem to be assigning the contents rather than the pointer. Also, you should be careful about alignment issues. Assign each field seperately rather than trying to use a pointer to a structure.
 
The returned number is the same on both of my devices (1670119342). What am I doing wrong?

Code:
	int memfd = open("/dev/mem", O_RDWR);

	volatile unsigned int *memregs32;
	memregs32 = (volatile unsigned int*) mmap(0, 0x20000, PROT_READ|PROT_WRITE, MAP_SHARED, memfd, 0xC0000000);


typedef struct regStruct_guid {
                unsigned long Data1;
                unsigned short Data2;
                unsigned short Data3;
                unsigned char Data4[8];
        } regStruct_guid;

        regStruct_guid guid_reg;
        guid_reg.Data1 = (unsigned long)memregs32[0x1F844>>2];
        guid_reg.Data2 = (unsigned short)(memregs32[0x1F848>>2] >> 16);
        guid_reg.Data3 = (unsigned short)memregs32[0x1F848>>2];
        guid_reg.Data4[0] = (unsigned char)memregs32[0x1F84C>>2];
        guid_reg.Data4[1] = (unsigned char)(memregs32[0x1F84C>>2] >> 8);
        guid_reg.Data4[2] = (unsigned char)(memregs32[0x1F84C>>2] >> 16);
        guid_reg.Data4[3] = (unsigned char)(memregs32[0x1F84C>>2] >> 24);
        guid_reg.Data4[4] = (unsigned char)memregs32[0x1F850>>2];
        guid_reg.Data4[5] = (unsigned char)(memregs32[0x1F850>>2] >> 8);
        guid_reg.Data4[6] = (unsigned char)(memregs32[0x1F850>>2] >> 16);
        guid_reg.Data4[7] = (unsigned char)(memregs32[0x1F850>>2] >> 24);

	close(memfd);

	int id = guid_reg.Data1 + (guid_reg.Data2<<16) + guid_reg.Data3;
	for(int i=0; i<8; ++i)
	{
		id+=guid_reg.Data4[i] * (1<<(i*8));
	}
	return id;
 
Back
Top