SHARE
TWEET

pac1

a guest Oct 1st, 2012 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set DEBUGPRINT byte 0
  2.  
  3. IDString FORM
  4. endian big
  5. get lFORM long
  6. IDString PAC1
  7.  
  8. IDString HEAD
  9. get lHEAD long
  10.  
  11. if DEBUGPRINT == 1
  12.         print "lHEAD %lHEAD%"
  13. endif
  14.  
  15. savepos OFFSET
  16. math OFFSET += lHEAD //skip HEAD section
  17. goto OFFSET
  18.  
  19. IDString DATA
  20. get lDATA long
  21.  
  22. if DEBUGPRINT == 1
  23.         print "lDATA %lDATA%"
  24. endif
  25.  
  26. savepos OFFSET
  27. math OFFSET += lDATA //skip DATA section
  28. goto OFFSET
  29.  
  30. IDString FILE
  31. get lFILE long
  32.  
  33. if DEBUGPRINT == 1
  34.         print "lFILE %lFILE%"
  35. endif
  36.  
  37. get isFile byte //toplevel folder, always 0
  38. get lFILENAME byte //toplevel folder, always 0
  39.  
  40. set PATH string ""
  41.  
  42. endian little
  43. CallFunction PARSEFOLDER
  44.  
  45.  
  46. StartFunction PARSEFOLDER
  47.         get FOLDERFILENO long //number of files/folders which are in the current folder
  48.         set FILENO long 0
  49.         if lFILENAME > 0
  50.                 string PATH += FILENAME
  51.                 string PATH += "/"
  52.         endif
  53.  
  54.         for FILENO = 0 < FOLDERFILENO
  55.                 get isFile byte
  56.                 if DEBUGPRINT == 1
  57.                         print "isFile  %isFile%"
  58.                 endif
  59.                 get lFILENAME byte
  60.                 getDString FILENAME lFILENAME
  61.                 if DEBUGPRINT == 1
  62.                         print "lFILENAME %lFILENAME%"
  63.                         print "FILENAME %FILENAME%"
  64.                 endif
  65.  
  66.                 if isFile == 1
  67.                         CallFunction PARSEFILE
  68.                 else
  69.                         CallFunction PARSEFOLDER
  70.                 endif
  71.         next FILENO
  72. EndFunction
  73.  
  74. StartFunction PARSEFILE
  75.         string PATH += FILENAME
  76.         get FILEOFFSET long
  77.         get ZSIZE long
  78.         get SIZE long
  79.  
  80.         if DEBUGPRINT == 1
  81.                 print "SIZE %SIZE%"
  82.                 print "ZSIZE %ZSIZE%"
  83.         endif
  84.  
  85.         get DUMMY longlong
  86.  
  87.         if SIZE != ZSIZE
  88.                 CLOG PATH FILEOFFSET ZSIZE SIZE
  89.         else
  90.                 LOG PATH FILEOFFSET SIZE
  91.         endif
  92. EndFunction
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top