Advertisement
SPLN

wii/mh3/rso/header

Aug 4th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RSO FILE HEADER:
  2.  - Size: 0x58 (88 bytes)
  3.  
  4. //--------------------- HEADER ---------------------//
  5.    file = getFile;
  6.    file.seek(pos);
  7.    /*0x00 (uint32)*/ identifier       =   file.readUint32();
  8.    /*0x04 (uint32)*/ unknown0x04      =   file.readUint32();
  9.    /*0x08 (uint32)*/ sectionCount     =   file.readUint32();
  10.    /*0x0C (uint32)*/ sectionInfoOffset=   file.readUint32();
  11.    /*0x10 (uint32)*/ nameOffset       =   file.readUint32();
  12.    /*0x14 (uint32)*/ nameSize         =   file.readUint32();
  13.    /*0x18 (uint32)*/ version          =   file.readUint32();
  14.    /*0x1C (uint32)*/ unknown0x1C      =   file.readUint32();
  15.  
  16.    //--- Line 0x20 could be empty
  17.    /*0x20 (bool)  */ prologSection    =   file.readUint8();
  18.    /*0x21 (bool)  */ epilogSection    =   file.readUint8();
  19.    /*0x22 (bool)  */ unresolvedSection=   file.readUint8();
  20.    /*0x23 (bool)  */ bssSection       =   file.readUint8();
  21.    /*0x24 (uint32)*/ prologOffset     =   file.readUint32();
  22.    /*0x28 (uint32)*/ epilogOffset     =   file.readUint32();
  23.    /*0x2C (uint32)*/ unresolvedOffset =   file.readUint32();
  24.    
  25.    //--- Internals/Externals relocation table (irt/ert)
  26.    /*0x30 (uint32)*/ irtOffset        =   file.readUint32();
  27.    /*0x34 (uint32)*/ irtSize          =   file.readUint32();
  28.    /*0x38 (uint32)*/ ertOffset        =   file.readUint32();
  29.    /*0x3C (uint32)*/ ertSize          =   file.readUint32();
  30.    /*0x40 (uint32)*/ exportsOffset    =   file.readUint32();
  31.    /*0x44 (uint32)*/ exportsSize      =   file.readUint32();
  32.    /*0x48 (uint32)*/ exportsName      =   file.readUint32(); // I don't find the correct name order :v/
  33.    /*0x4C (uint32)*/ importsOffset    =   file.readUint32();
  34.    /*0x50 (uint32)*/ importsSize      =   file.readUint32();
  35.    /*0x54 (uint32)*/ importsName      =   file.readUint32();
  36.  
  37.    //--- Sections x(sectionCount)
  38.    /*0x58 (uint32)*/ unknown0x58      =   file.readUint32();
  39.    /*0x5C (uint32)*/ unknown0x5C      =   file.readUint32();   
  40.    
  41.    //--- Data (= sections)
  42.    // Assembly (block01)
  43.    /*0x60 (uint32)*/ block01Offset    =   file.readUint32();
  44.    /*0x64 (uint32)*/ block01Size      =   file.readUint32();
  45.    
  46.    // Constructors (block02)
  47.    /*0x68 (uint32)*/ block02Offset    =   file.readUint32();
  48.    /*0x6C (uint32)*/ block02Size      =   file.readUint32();
  49.    
  50.    // Destructors (block03)
  51.    /*0x70 (uint32)*/ block03Offset    =   file.readUint32();
  52.    /*0x74 (uint32)*/ block03Size      =   file.readUint32();
  53.    
  54.    // Constants (block04)
  55.    /*0x78 (uint32)*/ block04Offset    =   file.readUint32();
  56.    /*0x7C (uint32)*/ block04Size      =   file.readUint32();
  57.  
  58.    // Objects (block05)
  59.    /*0x80 (uint32)*/ block05Offset    =   file.readUint32();
  60.    /*0x84 (uint32)*/ block05Size      =   file.readUint32();
  61.  
  62.    // Bss (block06)
  63.    /*0x88 (uint32)*/ block06Offset    =   file.readUint32();
  64.    /*0x8C (uint32)*/ block06Size      =   file.readUint32();
  65.    (... until sectionCount)
  66.  
  67.  
  68. //--------------------- SECTION INFO TABLE ---------------------//
  69. The section info table comprises of sectionCount entries each 0x8 bytes long, of the following form:
  70. 0x0     4   offset: Location in file of the section information. The last bit determines if this section is executable or not. If this is zero, the section is an uninitialized section.
  71. 0x4     4   length: Length in bytes of the section.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement