show manufacture date

This commit is contained in:
Jan Hofmeier 2023-03-19 15:40:37 +01:00
parent 629bd7ca4c
commit a2f6893cc0
1 changed files with 12 additions and 0 deletions

12
main.c
View File

@ -3,6 +3,8 @@
#include <whb/log_udp.h>
#include <whb/log_console.h>
#include <string.h>
#include <mocha/mocha.h>
#include "idsdb.h"
@ -93,6 +95,16 @@ int main(int argc, char const *argv[])
}
WHBLogPrintf("CID: %08x%08x%08x%08x", cid[0], cid[1], cid[2], cid[3]);
if(!strcmp(db->type,"mmc")){
uint8_t month = (uint8_t)(cid[3] >> 12);
uint16_t year = (uint8_t)(cid[3] >> 8) & 0xf;
year += 1997;
if(year < 2005)
year += 0x10;
WHBLogPrintf("Mfg Date: %u/%02d", month, year);
}
uint32_t csd[4];
if (iosuKernRead32(deviceAddress + 0x68, csd, 4) != MOCHA_RESULT_SUCCESS) {