Index: trunk/Mars/mcorsika/MCorsikaFormat.cc
===================================================================
--- trunk/Mars/mcorsika/MCorsikaFormat.cc	(revision 18531)
+++ trunk/Mars/mcorsika/MCorsikaFormat.cc	(revision 18532)
@@ -40,5 +40,6 @@
 
 
-const unsigned int MCorsikaFormat::kSyncMarker = 0xd41f8a37;
+const unsigned int MCorsikaFormat::kMagicNumber = 0x5994;
+const unsigned int MCorsikaFormat::kSyncMarker  = 0xd41f8a37;
 
 // --------------------------------------------------------------------------
@@ -60,4 +61,10 @@
     memset(buffer, 0, 5);
     fileIn->read(buffer, 4);
+
+    // This seems to be a new corsika binary identifier
+    const bool hasMagicNumber = *reinterpret_cast<unsigned int*>(buffer) == kMagicNumber;
+    if (hasMagicNumber)
+        fileIn->read(buffer, 4);
+
     fileIn->seekg(-4, ios::cur);
 
@@ -65,5 +72,6 @@
     {
         delete [] buffer;
-        return new MCorsikaFormatRaw(fileIn);
+        gLog << inf2 << "Corsika RAW format detected." << endl;
+        return new MCorsikaFormatRaw(fileIn, hasMagicNumber);
     }
 
@@ -71,4 +79,5 @@
     {
         delete [] buffer;
+        gLog << inf2 << "Corsika EventIO format detected." << endl;
         return new MCorsikaFormatEventIO(fileIn);
     }
@@ -159,5 +168,5 @@
     for (int i=1; i<22; i++)
     {
-        fIn->seekg(-i*273*4, ios::end);
+        fIn->seekg(-i*273*4-(fHasMagicNumber?4:0), ios::end);
 
         char runh[5]="\0\0\0\0";
@@ -170,6 +179,6 @@
         }
     }
-    
-    return kTRUE;
+
+    return kFALSE;
 }
 ///////////////////////////////////////////////////////////////////////////////
Index: trunk/Mars/mcorsika/MCorsikaFormat.h
===================================================================
--- trunk/Mars/mcorsika/MCorsikaFormat.h	(revision 18531)
+++ trunk/Mars/mcorsika/MCorsikaFormat.h	(revision 18532)
@@ -20,4 +20,5 @@
 public:
     static const unsigned int kSyncMarker;
+    static const unsigned int kMagicNumber;
 
    MCorsikaFormat(std::istream * in)
@@ -45,8 +46,9 @@
 {
 private:
+   bool fHasMagicNumber;
 
 public:
-   MCorsikaFormatRaw(std::istream * in)
-        : MCorsikaFormat(in) {}
+   MCorsikaFormatRaw(std::istream * in, bool h)
+        : MCorsikaFormat(in), fHasMagicNumber(h) {}
 
    Bool_t NextBlock(Int_t   readState, Int_t & blockType, Int_t & blockVersion,
