# (C) 2005 XDA Developers itsme@xs4all.nl
# these are some card id's i often use:
# 554500accf6300553832314453445303 'UE...c.U821DSDS.' .. my minisd
# 3f510009531f4003424d3832314e4918 '?Q..S.@.BM821NI.' .. my kingston
# 3f3c0065ba47640738323144534d5402 '?<.e.Gd.821DSMT.' .. my daneelec
# 0042000f588942414238323153415001 .... bjorns sdcard
# .. the first byte seems dependend on who has read it.
# 0x55 - smartphone
# 0x3f - pocketpc
# 0x00 - bootloader <--- you have to set the first byte to this for the goldcard to work.
#
# ... this id can be found in the magician rom 1.12:
# at offset 0x0849d4d8 ... 'CMDS'+0x48
# or at offset 0x0849cfc5 ... 'SBDS'+0x75
# examples:
#
# perl typhoonnbfdecode.pl sd.img
#
# will try to determine what type of sdcard sd.img is, tell you the
# seclevel, if it can find it.
#
# to create a 'goldcard':
#
# use 'magic=xxx' to prevent the sdcard from being seen as containing a flash image.
#
# perl typhoonnbfdecode.pl -d sd80.img -p magic=xxx -p cardid=004500accf6300553832314453445303 -p keys=typhoon -p seclevel=0
# then psdwrite f: sd80.img
#
# or ... for a 'e0' based goldcard.
# perl typhoonnbfdecode.pl -d sde0.img -p magic=xxx -p cardid=004500accf6300553832314453445303 -p cid=CDL___02
#
# perl typhoonnbfdecode.pl -d sd80.img -p cardid=00510009531f4003424d3832314e4918 -p keys=magician -p seclevel=0
# ... then psdwrite f: sd80.img 0x80 -s 0x80
# todo: add option to create pocketpc version of header.
#
# for the magician: 'task 32' shows the securitylevel.