private boolean LoadUNK(ByteBuffer f,SceModule module,int baseAddress,boolean analyzeOnly) throws IOException {
  byte m0=f.get();
  byte m1=f.get();
  byte m2=f.get();
  byte m3=f.get();
  if (m0 == 0x43 && m1 == 0x49 && m2 == 0x53 && m3 == 0x4F) {
    log.info("This is not an executable file!");
    log.info("Try using the Load UMD menu item");
  }
 else   if ((m0 == 0 && m1 == 0x50 && m2 == 0x53 && m3 == 0x46)) {
    log.info("This is not an executable file!");
  }
 else {
    boolean handled=false;
    if (f.limit() >= 16 * 2048 + 6) {
      f.position(16 * 2048);
      byte[] id=new byte[6];
      f.get(id);
      if ((((char)id[1]) == 'C') && (((char)id[2]) == 'D') && (((char)id[3]) == '0')&& (((char)id[4]) == '0')&& (((char)id[5]) == '1')) {
        log.info("This is not an executable file!");
        log.info("Try using the Load UMD menu item");
        handled=true;
      }
    }
    if (!handled) {
      log.info("Unrecognized file format");
      log.info(String.format("File magic %02X %02X %02X %02X",m0,m1,m2,m3));
      if (log.isDebugEnabled()) {
        byte[] buffer=new byte[256];
        buffer[0]=m0;
        buffer[1]=m1;
        buffer[2]=m2;
        buffer[3]=m3;
        f.get(buffer,4,buffer.length - 4);
        log.debug(String.format("File header: %s",Utilities.getMemoryDump(buffer,0,buffer.length)));
      }
    }
  }
  return false;
}

private boolean LoadUNK ( ByteBuffer f , SceModule module , int baseAddress , boolean analyzeOnly ) throws IOException { byte m0 = f . get ( ) ; byte m1 = f . get ( ) ; byte m2 = f . get ( ) ; byte m3 = f . get ( ) ; if ( m0 == 0x43 && m1 == 0x49 && m2 == 0x53 && m3 == 0x4F ) { log . info ( "This is not an executable file!" ) ; log . info ( "Try using the Load UMD menu item" ) ; } else if ( ( m0 == 0 && m1 == 0x50 && m2 == 0x53 && m3 == 0x46 ) ) { log . info ( "This is not an executable file!" ) ; } else { boolean handled = false ; if ( f . limit ( ) >= 16 * 2048 + 6 ) { f . position ( 16 * 2048 ) ; byte [ ] id = new byte [ 6 ] ; f . get ( id ) ; if ( ( ( ( char ) id [ 1 ] ) == 'C' ) && ( ( ( char ) id [ 2 ] ) == 'D' ) && ( ( ( char ) id [ 3 ] ) == '0' ) && ( ( ( char ) id [ 4 ] ) == '0' ) && ( ( ( char ) id [ 5 ] ) == '1' ) ) { log . info ( "This is not an executable file!" ) ; log . info ( "Try using the Load UMD menu item" ) ; handled = true ; } } if ( ! handled ) { log . info ( "Unrecognized file format" ) ; log . info ( String . format ( "File magic %02X %02X %02X %02X" , m0 , m1 , m2 , m3 ) ) ; if ( log . isDebugEnabled ( ) ) { byte [ ] buffer = new byte [ 256 ] ; buffer [ 0 ] = m0 ; buffer [ 1 ] = m1 ; buffer [ 2 ] = m2 ; buffer [ 3 ] = m3 ; f . get ( buffer , 4 , buffer . length - 4 ) ; log . debug ( String . format ( "File header: %s" , Utilities . getMemoryDump ( buffer , 0 , buffer . length ) ) ) ; } } } return false ; }
dummy loader for unrecognized file formats , put at the end of a loader chain .
