Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. /* This program will attemp to identify and read an on board NAND image. */
  2.     /* Written by UNIX - LibXenon.org */
  3.  
  4. #include <stdio.h>
  5. #include <input/input.h>
  6. #include <xenos/xenos.h>
  7. #include <console/console.h>
  8. #include <xenon_nand/xenon_config.h>
  9. #include <xenon_nand/xenon_sfcx.h>
  10.  
  11. void mainInit(){
  12.     xenos_init(VIDEO_MODE_AUTO);
  13.     console_init();        
  14.  
  15.     usb_init();
  16.     usb_do_poll();
  17. }
  18.  
  19. int main(){
  20.         mainInit();
  21.         sfcx_init();
  22.  
  23.     printf("Only currently supports 16MB consoles!\n");
  24.  
  25.     unsigned char *data = (unsigned char *)malloc(0x80000);
  26.  
  27.     int i;
  28.  
  29.     for(i=0x000000;i<0x0003FF;i++){
  30.         sfcx_read_block(data, i, 0);
  31.        
  32.         while(i<0x0003FF){
  33.             printf("Reading...\r");
  34.            
  35.             if(i=0x0003FF){
  36.                 printf("Done!\n");
  37.             }
  38.         }
  39.     }
  40.  
  41.     free(data);
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement