android 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #------------------------------------------------------------
  2. # $File: android,v 1.6 2014/08/04 06:00:36 christos Exp $
  3. # Various android related magic entries
  4. #------------------------------------------------------------
  5. # Dalvik .dex format. http://retrodev.com/android/dexformat.html
  6. # From <mkf@google.com> "Mike Fleming"
  7. # Fixed to avoid regexec 17 errors on some dex files
  8. # From <diff@lookout.com> "Tim Strazzere"
  9. 0 string dex\n
  10. >0 regex dex\n[0-9]{2}\0 Dalvik dex file
  11. >4 string >000 version %s
  12. 0 string dey\n
  13. >0 regex dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
  14. >4 string >000 version %s
  15. # http://android.stackexchange.com/questions/23357/\
  16. # is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
  17. # 23608#23608
  18. 0 string ANDROID\040BACKUP\n Android Backup
  19. >15 string 1\n \b, version 1
  20. >17 string 0\n \b, uncompressed
  21. >17 string 1\n \b, compressed
  22. >19 string none\n \b, unencrypted
  23. >19 string AES-256\n \b, encrypted AES-256
  24. # Android bootimg format
  25. # From https://android.googlesource.com/\
  26. # platform/system/core/+/master/mkbootimg/bootimg.h
  27. 0 string ANDROID! Android bootimg
  28. >8 lelong >0 \b, kernel
  29. >>12 lelong >0 \b (0x%x)
  30. >16 lelong >0 \b, ramdisk
  31. >>20 lelong >0 \b (0x%x)
  32. >24 lelong >0 \b, second stage
  33. >>28 lelong >0 \b (0x%x)
  34. >36 lelong >0 \b, page size: %d
  35. >38 string >0 \b, name: %s
  36. >64 string >0 \b, cmdline (%s)
  37. # Dalvik .dex format. http://retrodev.com/android/dexformat.html
  38. # From <mkf@google.com> "Mike Fleming"
  39. # Fixed to avoid regexec 17 errors on some dex files
  40. # From <diff@lookout.com> "Tim Strazzere"
  41. 0 string dex\n
  42. >0 regex dex\n[0-9]{2}\0 Dalvik dex file
  43. >4 string >000 version %s
  44. 0 string dey\n
  45. >0 regex dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
  46. >4 string >000 version %s
  47. # http://android.stackexchange.com/questions/23357/\
  48. # is-there-a-way-to-look-inside-and-modify-an-adb-backup-created-file/\
  49. # 23608#23608
  50. 0 string ANDROID\040BACKUP\n Android Backup
  51. >15 string 1\n \b, version 1
  52. >17 string 0\n \b, uncompressed
  53. >17 string 1\n \b, compressed
  54. >19 string none\n \b, unencrypted
  55. >19 string AES-256\n \b, encrypted AES-256
  56. # Android bootimg format
  57. # From https://android.googlesource.com/\
  58. # platform/system/core/+/master/mkbootimg/bootimg.h
  59. 0 string ANDROID! Android bootimg
  60. >8 lelong >0 \b, kernel
  61. >>12 lelong >0 \b (0x%x)
  62. >16 lelong >0 \b, ramdisk
  63. >>20 lelong >0 \b (0x%x)
  64. >24 lelong >0 \b, second stage
  65. >>28 lelong >0 \b (0x%x)
  66. >36 lelong >0 \b, page size: %d
  67. >38 string >0 \b, name: %s
  68. >64 string >0 \b, cmdline (%s)
  69. # Android Backup archive
  70. # From: Ariel Shkedi
  71. # File extension: .ab
  72. # No mime-type defined
  73. # URL: https://github.com/android/platform_frameworks_base/blob/\
  74. # 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
  75. # android/server/BackupManagerService.java#L2367
  76. # After the header comes a tar file
  77. # If compressed, the entire tar file is compressed with JAVA deflate
  78. #
  79. # Include the version number hardcoded with the magic string to avoid
  80. # false positives
  81. 0 string/b ANDROID\ BACKUP\n1\n Android Backup
  82. >17 string 0\n \b, Not-Compressed
  83. >17 string 1\n \b, Compressed
  84. # any string as long as it's not the word none (which is matched below)
  85. >>19 regex/1l \^([^n\n]|n[^o]|no[^n]|non[^e]|none.+).* \b, Encrypted (%s)
  86. >>19 string none\n \b, Not-Encrypted
  87. # Commented out because they don't seem useful to print
  88. # (but they are part of the header - the tar file comes after them):
  89. #>>>&1 regex/1l .* \b, Password salt: %s
  90. #>>>>&1 regex/1l .* \b, Master salt: %s
  91. #>>>>>&1 regex/1l .* \b, PBKDF2 rounds: %s
  92. #>>>>>>&1 regex/1l .* \b, IV: %s
  93. #>>>>>>>&1 regex/1l .* \b, Key: %s
  94. # *.pit files by Joerg Jenderek
  95. # http://forum.xda-developers.com/showthread.php?p=9122369
  96. # http://forum.xda-developers.com/showthread.php?t=816449
  97. # Partition Information Table for Samsung's smartphone with Android
  98. # used by flash software Odin
  99. 0 ulelong 0x12349876
  100. # 1st pit entry marker
  101. >0x01C ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000
  102. # minimal 13 and maximal 18 PIT entries found
  103. >>4 ulelong <128 Partition Information Table for Samsung smartphone
  104. >>>4 ulelong x \b, %d entries
  105. # 1. pit entry
  106. >>>4 ulelong >0 \b; #1
  107. >>>0x01C use PIT-entry
  108. >>>4 ulelong >1 \b; #2
  109. >>>0x0A0 use PIT-entry
  110. >>>4 ulelong >2 \b; #3
  111. >>>0x124 use PIT-entry
  112. >>>4 ulelong >3 \b; #4
  113. >>>0x1A8 use PIT-entry
  114. >>>4 ulelong >4 \b; #5
  115. >>>0x22C use PIT-entry
  116. >>>4 ulelong >5 \b; #6
  117. >>>0x2B0 use PIT-entry
  118. >>>4 ulelong >6 \b; #7
  119. >>>0x334 use PIT-entry
  120. >>>4 ulelong >7 \b; #8
  121. >>>0x3B8 use PIT-entry
  122. >>>4 ulelong >8 \b; #9
  123. >>>0x43C use PIT-entry
  124. >>>4 ulelong >9 \b; #10
  125. >>>0x4C0 use PIT-entry
  126. >>>4 ulelong >10 \b; #11
  127. >>>0x544 use PIT-entry
  128. >>>4 ulelong >11 \b; #12
  129. >>>0x5C8 use PIT-entry
  130. >>>4 ulelong >12 \b; #13
  131. >>>>0x64C use PIT-entry
  132. # 14. pit entry
  133. >>>4 ulelong >13 \b; #14
  134. >>>>0x6D0 use PIT-entry
  135. >>>4 ulelong >14 \b; #15
  136. >>>0x754 use PIT-entry
  137. >>>4 ulelong >15 \b; #16
  138. >>>0x7D8 use PIT-entry
  139. >>>4 ulelong >16 \b; #17
  140. >>>0x85C use PIT-entry
  141. # 18. pit entry
  142. >>>4 ulelong >17 \b; #18
  143. >>>0x8E0 use PIT-entry
  144. 0 name PIT-entry
  145. # garbage value implies end of pit entries
  146. >0x00 ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000
  147. # skip empty partition name
  148. >>0x24 ubyte !0
  149. # partition name
  150. >>>0x24 string >\0 %-.32s
  151. # flags
  152. >>>0x0C ulelong&0x00000002 2 \b+RW
  153. # partition ID:
  154. # 0~IPL,MOVINAND,GANG;1~PIT,GPT;2~HIDDEN;3~SBL,HIDDEN;4~SBL2,HIDDEN;5~BOOT;6~KENREl,RECOVER,misc;7~RECOVER
  155. # ;11~MODEM;20~efs;21~PARAM;22~FACTORY,SYSTEM;23~DBDATAFS,USERDATA;24~CACHE;80~BOOTLOADER;81~TZSW
  156. >>>0x08 ulelong x (0x%x)
  157. # filename
  158. >>>0x44 string >\0 "%-.64s"
  159. #>>>0x18 ulelong >0
  160. # blocksize in 512 byte units ?
  161. #>>>>0x18 ulelong x \b, %db
  162. # partition size in blocks ?
  163. #>>>>0x22 ulelong x \b*%d
  164. # Android bootimg format
  165. # From https://android.googlesource.com/\
  166. # platform/system/core/+/master/libsparse/sparse_format.h
  167. 0 lelong 0xed26ff3a Android sparse image
  168. >4 leshort x \b, version: %d
  169. >6 leshort x \b.%d
  170. >16 lelong x \b, Total of %d
  171. >12 lelong x \b %d-byte output blocks in
  172. >20 lelong x \b %d input chunks.