Bono2007 Posté(e) le 16 août 2009 Posté(e) le 16 août 2009 Source : http://www.xboxhacker.net/index.php?topic=12209.0 Traduit de tmbinc : Ici je veux décrire la séquence JTAG qui prépare un peu plus le controleur NAND. Lire le fichier hack.txt avant de poser des questions ici, c'est vital pour comprendre ceci Rappelez-vous qu'on ne peut pas écrire l'adresse DMA cible depuis le SMC, donc nous avons besoin de faire ça via le JTAG. Tout cela a déjà été discuté sur le JTAG-thread (xboxhacker), mais reconsidérons ce que nous avons à écrire : Code: write32(0xd0000018, 0x20100); // enable PCI bridge write32(0xd0140010, 0xea00c000); // enable BAR0 for nand controller (to appear in pci space at ea00c000) write32(0xd0140004, 0x6); // enable NAND, enable busmaster write32(0xea00c00c, PAYLOAD_BASE + 0x20000); // address of exploit buffer, in flash (we could write this in SMC, too, but it's easier here) write32(0xea00c01c, 0x00130360); // target address of main data (overwrites idle thread context and first stage exploit code) write32(0xea00c020, 0x00002080); // target address of ECC data, overwrites HV offset Nous devons aussi faire attention que cela arrive assez tôt, mais pas trop, puisque nous ne pouvons interférer avec le CPU. La 1e méthode implémentée dans un microcontroleur AVR était d'attendre simplement que l'IDCODE soit valide, attendre un peu et ensuite démarrer l'écriture JTAG Les routines sont du genre : static inline int j(int tdi, int tms){ int v = 0; if (tdi) v |= TDI; if (tms) v |= TMS; set_bits(v); set_bits(v | TCK); int res = !!(get_bits() & TDO); return res; } unsigned long long jtagn(int IR, unsigned long long val, int n) { j(0, 0); // if we were in TLR, nop if we are in RTI already j(0, 1); j(0, 1); j(0, 0); j(0, 0); j_scanIR(IR); j(0, 1); j(0, 1); j(0, 0); j(0, 0); unsigned long long res = j_n(val, n); j(0, 1); j(0, 0); // and we are in RTI again return res; } static unsigned long jtag32(int IR, unsigned long val) { j(0, 0); // if we were in TLR, nop if we are in RTI already j(0, 1); j(0, 1); j(0, 0); j(0, 0); j_scanIR(IR); j(0, 1); j(0, 1); j(0, 0); j(0, 0); unsigned long res = j_n(val, 32); j(0, 1); j(0, 0); // and we are in RTI again return res; } void write32(unsigned long addr, unsigned long data) { jtagn(0xe0, 3 | addr | (0xFULL << 32), 36); jtag32(0xe1, data); jtagn(0xe4, 1, 1); } void jtag_doit(void) { int i = 20; while (i--) { volatile long j = 10000; while (j--); } write32(0xd0000018, 0x20100); write32(0xd0140010, 0xea00c000); write32(0xd0140004, 0x6); write32(0xea00c00c, PAYLOAD_BASE + 0x20000); // address in flash of exploit write32(0xea00c01c, 0x00130360); write32(0xea00c020, 0x00002080); } static void TLR(void) { int i; for (i=0; i<5; ++i) j(0, 1); } void main() { ... hw init while (1) { if (hack_state == 1) /* hacked */ { TLR(); if (!is_valid_id(jtag32(0x50, 0))) hack_state = 0; /* poweroff */ } else { /* power off */ TLR(); if (is_valid_id(jtag32(0x50, 0))) { jtag_doit(); hack_state = 1; } } } } Tiros a fait un hack formidable en ajoutant ce code dans le SMC, donc nous avons juste besoin d'utiliser les résistors pour rendre le SMC capable de dialoguer au JTAG du GPU.
legueux Posté(e) le 17 août 2009 Posté(e) le 17 août 2009 Merci pour l'information, l'article a été publié sur le site.
Messages recommandés