TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 05-10-2014, 04:30 PM   #1
telemark
Registered User
 
Join Date: Nov 2013
Posts: 854
pmdmp - [agnostic] partition map dump

I wrote this for myself but felt others might need this as well. The goal was to read as many formats as possible, prevent human error, and getting something working asap so we can get to the more interesting stuff.

Hypothetically can handle:
Roamio or Premiere
32bit or 64bit fields
Little or Big Endian
Device or Files or Pipes
MBR skip over
YMMV

Copyright 2014, binary license granted for personal, non-commercial use. Commercial use or redistribution, please request a license.

Last edited by telemark : 05-10-2014 at 05:08 PM.
telemark is offline   Reply With Quote
Old 05-10-2014, 04:31 PM   #2
telemark
Registered User
 
Join Date: Nov 2013
Posts: 854
Version beta2:
Linux 64bit static linked
Mac OS X 32bit

MD5 (linux/pmdmp) = babafe85b3e5d2a28e4e9b7ffdbd00f7
MD5 (mac/pmdmp) = 541afaa07d0105875b52de64323ea36b

Code:
Usage examples:
  > pmdmp ~/HD.backup
  > zcat sdb1.gz | pmdmp
  Linux> pmdmp /dev/sdb
  Mac> pmdmp /dev/rdisk1

  1 (0200) : MP : Apple_partition_map :                       Apple :         63 @          1
  2 (0400) : MP :               Image :                 Bootstrap 1 :          8 @  537225104
  3 (0600) : MP :               Image :                    Kernel 1 :          8 @  537225112
  4 (0800) : MP :                Ext2 :                      Root 1 :          8 @  537225120
  5 (0A00) : MP :               Image :                 Bootstrap 2 :          8 @  537225128
  6 (0C00) : MP :               Image :                    Kernel 2 :          8 @  537225136
  7 (0E00) : MP :                Ext2 :                      Root 2 :          8 @  537225144
  8 (1000) : MP :                Swap :                  Linux swap :    1048576 @  537225152
  9 (1200) : MP :                Ext2 :                        /var :    1572864 @  538273728
 10 (1400) : MP :                 MFS :      MFS application region :    1638400 @  546138048
 11 (1600) : MP :                 MFS :            MFS media region :  427358320 @  549414848
 12 (1800) : MP :                 MFS :    MFS application region 2 :    1638400 @  547776448
 13 (1A00) : MP :                 MFS :          MFS media region 2 :  537225040 @         64
 14 (1C00) : MP :                Ext2 :                      SQLite :    6291456 @  539846592

  1 (0200) : MP : Apple_partition_map :                       Apple :          1 +         63 =         64
 13 (1A00) : MP :                 MFS :          MFS media region 2 :         64 +  537225040 =  537225104
  2 (0400) : MP :               Image :                 Bootstrap 1 :  537225104 +          8 =  537225112
  3 (0600) : MP :               Image :                    Kernel 1 :  537225112 +          8 =  537225120
  4 (0800) : MP :                Ext2 :                      Root 1 :  537225120 +          8 =  537225128
  5 (0A00) : MP :               Image :                 Bootstrap 2 :  537225128 +          8 =  537225136
  6 (0C00) : MP :               Image :                    Kernel 2 :  537225136 +          8 =  537225144
  7 (0E00) : MP :                Ext2 :                      Root 2 :  537225144 +          8 =  537225152
  8 (1000) : MP :                Swap :                  Linux swap :  537225152 +    1048576 =  538273728
  9 (1200) : MP :                Ext2 :                        /var :  538273728 +    1572864 =  539846592
 14 (1C00) : MP :                Ext2 :                      SQLite :  539846592 +    6291456 =  546138048
 10 (1400) : MP :                 MFS :      MFS application region :  546138048 +    1638400 =  547776448
 12 (1800) : MP :                 MFS :    MFS application region 2 :  547776448 +    1638400 =  549414848
 11 (1600) : MP :                 MFS :            MFS media region :  549414848 +  427358320 =  976773168
Output notes:
PM or MP or NP is the literal field contents but tells you whether it's in 32/64 or LSB/MSB format.

There is a sanity procedure which checks if partitions are adjacent, if you're seeing exclamation marks (!) then there was discontinuity detected. If you're seeing this it's probably a math bug in this program, please report it so it can be fixed.

Change log:
2014-05-10: beta2 - Added code for hypothetical 'PN' (64bit Premiere). None were found on stock drives. Unknown if in wild. Remains untested as such.
2014-05-10: beta1 - Initial public release.

Last edited by telemark : 05-10-2014 at 10:55 PM.
telemark is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 01:40 AM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |