extract_xc3028.pl 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717
  1. #!/usr/bin/perl
  2. # Copyright (c) Mauro Carvalho Chehab <mchehab@infradead.org>
  3. # Released under GPLv2
  4. #
  5. # In order to use, you need to:
  6. # 1) Download the windows driver with something like:
  7. # Version 2.4
  8. # wget http://www.twinhan.com/files/AW/BDA T/20080303_V1.0.6.7.zip
  9. # or wget http://www.stefanringel.de/pub/20080303_V1.0.6.7.zip
  10. # Version 2.7
  11. # wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
  12. # 2) Extract the files from the zip into the current dir:
  13. # unzip -j 20080303_V1.0.6.7.zip 20080303_v1.0.6.7/UDXTTM6000.sys
  14. # unzip -j HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip Driver85/hcw85bda.sys
  15. # 3) run the script:
  16. # ./extract_xc3028.pl
  17. # 4) copy the generated files:
  18. # cp xc3028-v24.fw /lib/firmware
  19. # cp xc3028-v27.fw /lib/firmware
  20. #use strict;
  21. use IO::Handle;
  22. my $debug=0;
  23. sub verify ($$)
  24. {
  25. my ($filename, $hash) = @_;
  26. my ($testhash);
  27. if (system("which md5sum > /dev/null 2>&1")) {
  28. die "This firmware requires the md5sum command - see http://www.gnu.org/software/coreutils/\n";
  29. }
  30. open(CMD, "md5sum ".$filename."|");
  31. $testhash = <CMD>;
  32. $testhash =~ /([a-zA-Z0-9]*)/;
  33. $testhash = $1;
  34. close CMD;
  35. die "Hash of extracted file does not match (found $testhash, expected $hash!\n" if ($testhash ne $hash);
  36. }
  37. sub get_hunk ($$)
  38. {
  39. my ($offset, $length) = @_;
  40. my ($chunklength, $buf, $rcount, $out);
  41. sysseek(INFILE, $offset, SEEK_SET);
  42. while ($length > 0) {
  43. # Calc chunk size
  44. $chunklength = 2048;
  45. $chunklength = $length if ($chunklength > $length);
  46. $rcount = sysread(INFILE, $buf, $chunklength);
  47. die "Ran out of data\n" if ($rcount != $chunklength);
  48. $out .= $buf;
  49. $length -= $rcount;
  50. }
  51. return $out;
  52. }
  53. sub write_le16($)
  54. {
  55. my $val = shift;
  56. my $msb = ($val >> 8) &0xff;
  57. my $lsb = $val & 0xff;
  58. syswrite(OUTFILE, chr($lsb).chr($msb));
  59. }
  60. sub write_le32($)
  61. {
  62. my $val = shift;
  63. my $l3 = ($val >> 24) & 0xff;
  64. my $l2 = ($val >> 16) & 0xff;
  65. my $l1 = ($val >> 8) & 0xff;
  66. my $l0 = $val & 0xff;
  67. syswrite(OUTFILE, chr($l0).chr($l1).chr($l2).chr($l3));
  68. }
  69. sub write_le64($$)
  70. {
  71. my $msb_val = shift;
  72. my $lsb_val = shift;
  73. my $l7 = ($msb_val >> 24) & 0xff;
  74. my $l6 = ($msb_val >> 16) & 0xff;
  75. my $l5 = ($msb_val >> 8) & 0xff;
  76. my $l4 = $msb_val & 0xff;
  77. my $l3 = ($lsb_val >> 24) & 0xff;
  78. my $l2 = ($lsb_val >> 16) & 0xff;
  79. my $l1 = ($lsb_val >> 8) & 0xff;
  80. my $l0 = $lsb_val & 0xff;
  81. syswrite(OUTFILE,
  82. chr($l0).chr($l1).chr($l2).chr($l3).
  83. chr($l4).chr($l5).chr($l6).chr($l7));
  84. }
  85. sub write_hunk($$)
  86. {
  87. my ($offset, $length) = @_;
  88. my $out = get_hunk($offset, $length);
  89. printf "(len %d) ",$length if ($debug);
  90. for (my $i=0;$i<$length;$i++) {
  91. printf "%02x ",ord(substr($out,$i,1)) if ($debug);
  92. }
  93. printf "\n" if ($debug);
  94. syswrite(OUTFILE, $out);
  95. }
  96. sub write_hunk_fix_endian($$)
  97. {
  98. my ($offset, $length) = @_;
  99. my $out = get_hunk($offset, $length);
  100. printf "(len_fix %d) ",$length if ($debug);
  101. for (my $i=0;$i<$length;$i++) {
  102. printf "%02x ",ord(substr($out,$i,1)) if ($debug);
  103. }
  104. printf "\n" if ($debug);
  105. my $i=0;
  106. while ($i<$length) {
  107. my $size = ord(substr($out,$i,1))*256+ord(substr($out,$i+1,1));
  108. syswrite(OUTFILE, substr($out,$i+1,1));
  109. syswrite(OUTFILE, substr($out,$i,1));
  110. $i+=2;
  111. if ($size>0 && $size <0x8000) {
  112. for (my $j=0;$j<$size;$j++) {
  113. syswrite(OUTFILE, substr($out,$j+$i,1));
  114. }
  115. $i+=$size;
  116. }
  117. }
  118. }
  119. sub main_firmware_24($$$$)
  120. {
  121. my $out;
  122. my $j=0;
  123. my $outfile = shift;
  124. my $name = shift;
  125. my $version = shift;
  126. my $nr_desc = shift;
  127. for ($j = length($name); $j <32; $j++) {
  128. $name = $name.chr(0);
  129. }
  130. open OUTFILE, ">$outfile";
  131. syswrite(OUTFILE, $name);
  132. write_le16($version);
  133. write_le16($nr_desc);
  134. #
  135. # Firmware 0, type: BASE FW F8MHZ (0x00000003), id: (0000000000000000), size: 6635
  136. #
  137. write_le32(0x00000003); # Type
  138. write_le64(0x00000000, 0x00000000); # ID
  139. write_le32(6635); # Size
  140. write_hunk_fix_endian(257752, 6635);
  141. #
  142. # Firmware 1, type: BASE FW F8MHZ MTS (0x00000007), id: (0000000000000000), size: 6635
  143. #
  144. write_le32(0x00000007); # Type
  145. write_le64(0x00000000, 0x00000000); # ID
  146. write_le32(6635); # Size
  147. write_hunk_fix_endian(264392, 6635);
  148. #
  149. # Firmware 2, type: BASE FW FM (0x00000401), id: (0000000000000000), size: 6525
  150. #
  151. write_le32(0x00000401); # Type
  152. write_le64(0x00000000, 0x00000000); # ID
  153. write_le32(6525); # Size
  154. write_hunk_fix_endian(271040, 6525);
  155. #
  156. # Firmware 3, type: BASE FW FM INPUT1 (0x00000c01), id: (0000000000000000), size: 6539
  157. #
  158. write_le32(0x00000c01); # Type
  159. write_le64(0x00000000, 0x00000000); # ID
  160. write_le32(6539); # Size
  161. write_hunk_fix_endian(277568, 6539);
  162. #
  163. # Firmware 4, type: BASE FW (0x00000001), id: (0000000000000000), size: 6633
  164. #
  165. write_le32(0x00000001); # Type
  166. write_le64(0x00000000, 0x00000000); # ID
  167. write_le32(6633); # Size
  168. write_hunk_fix_endian(284120, 6633);
  169. #
  170. # Firmware 5, type: BASE FW MTS (0x00000005), id: (0000000000000000), size: 6617
  171. #
  172. write_le32(0x00000005); # Type
  173. write_le64(0x00000000, 0x00000000); # ID
  174. write_le32(6617); # Size
  175. write_hunk_fix_endian(290760, 6617);
  176. #
  177. # Firmware 6, type: STD FW (0x00000000), id: PAL/BG A2/A (0000000100000007), size: 161
  178. #
  179. write_le32(0x00000000); # Type
  180. write_le64(0x00000001, 0x00000007); # ID
  181. write_le32(161); # Size
  182. write_hunk_fix_endian(297384, 161);
  183. #
  184. # Firmware 7, type: STD FW MTS (0x00000004), id: PAL/BG A2/A (0000000100000007), size: 169
  185. #
  186. write_le32(0x00000004); # Type
  187. write_le64(0x00000001, 0x00000007); # ID
  188. write_le32(169); # Size
  189. write_hunk_fix_endian(297552, 169);
  190. #
  191. # Firmware 8, type: STD FW (0x00000000), id: PAL/BG A2/B (0000000200000007), size: 161
  192. #
  193. write_le32(0x00000000); # Type
  194. write_le64(0x00000002, 0x00000007); # ID
  195. write_le32(161); # Size
  196. write_hunk_fix_endian(297728, 161);
  197. #
  198. # Firmware 9, type: STD FW MTS (0x00000004), id: PAL/BG A2/B (0000000200000007), size: 169
  199. #
  200. write_le32(0x00000004); # Type
  201. write_le64(0x00000002, 0x00000007); # ID
  202. write_le32(169); # Size
  203. write_hunk_fix_endian(297896, 169);
  204. #
  205. # Firmware 10, type: STD FW (0x00000000), id: PAL/BG NICAM/A (0000000400000007), size: 161
  206. #
  207. write_le32(0x00000000); # Type
  208. write_le64(0x00000004, 0x00000007); # ID
  209. write_le32(161); # Size
  210. write_hunk_fix_endian(298072, 161);
  211. #
  212. # Firmware 11, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/A (0000000400000007), size: 169
  213. #
  214. write_le32(0x00000004); # Type
  215. write_le64(0x00000004, 0x00000007); # ID
  216. write_le32(169); # Size
  217. write_hunk_fix_endian(298240, 169);
  218. #
  219. # Firmware 12, type: STD FW (0x00000000), id: PAL/BG NICAM/B (0000000800000007), size: 161
  220. #
  221. write_le32(0x00000000); # Type
  222. write_le64(0x00000008, 0x00000007); # ID
  223. write_le32(161); # Size
  224. write_hunk_fix_endian(298416, 161);
  225. #
  226. # Firmware 13, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/B (0000000800000007), size: 169
  227. #
  228. write_le32(0x00000004); # Type
  229. write_le64(0x00000008, 0x00000007); # ID
  230. write_le32(169); # Size
  231. write_hunk_fix_endian(298584, 169);
  232. #
  233. # Firmware 14, type: STD FW (0x00000000), id: PAL/DK A2 (00000003000000e0), size: 161
  234. #
  235. write_le32(0x00000000); # Type
  236. write_le64(0x00000003, 0x000000e0); # ID
  237. write_le32(161); # Size
  238. write_hunk_fix_endian(298760, 161);
  239. #
  240. # Firmware 15, type: STD FW MTS (0x00000004), id: PAL/DK A2 (00000003000000e0), size: 169
  241. #
  242. write_le32(0x00000004); # Type
  243. write_le64(0x00000003, 0x000000e0); # ID
  244. write_le32(169); # Size
  245. write_hunk_fix_endian(298928, 169);
  246. #
  247. # Firmware 16, type: STD FW (0x00000000), id: PAL/DK NICAM (0000000c000000e0), size: 161
  248. #
  249. write_le32(0x00000000); # Type
  250. write_le64(0x0000000c, 0x000000e0); # ID
  251. write_le32(161); # Size
  252. write_hunk_fix_endian(299104, 161);
  253. #
  254. # Firmware 17, type: STD FW MTS (0x00000004), id: PAL/DK NICAM (0000000c000000e0), size: 169
  255. #
  256. write_le32(0x00000004); # Type
  257. write_le64(0x0000000c, 0x000000e0); # ID
  258. write_le32(169); # Size
  259. write_hunk_fix_endian(299272, 169);
  260. #
  261. # Firmware 18, type: STD FW (0x00000000), id: SECAM/K1 (0000000000200000), size: 161
  262. #
  263. write_le32(0x00000000); # Type
  264. write_le64(0x00000000, 0x00200000); # ID
  265. write_le32(161); # Size
  266. write_hunk_fix_endian(299448, 161);
  267. #
  268. # Firmware 19, type: STD FW MTS (0x00000004), id: SECAM/K1 (0000000000200000), size: 169
  269. #
  270. write_le32(0x00000004); # Type
  271. write_le64(0x00000000, 0x00200000); # ID
  272. write_le32(169); # Size
  273. write_hunk_fix_endian(299616, 169);
  274. #
  275. # Firmware 20, type: STD FW (0x00000000), id: SECAM/K3 (0000000004000000), size: 161
  276. #
  277. write_le32(0x00000000); # Type
  278. write_le64(0x00000000, 0x04000000); # ID
  279. write_le32(161); # Size
  280. write_hunk_fix_endian(299792, 161);
  281. #
  282. # Firmware 21, type: STD FW MTS (0x00000004), id: SECAM/K3 (0000000004000000), size: 169
  283. #
  284. write_le32(0x00000004); # Type
  285. write_le64(0x00000000, 0x04000000); # ID
  286. write_le32(169); # Size
  287. write_hunk_fix_endian(299960, 169);
  288. #
  289. # Firmware 22, type: STD FW D2633 DTV6 ATSC (0x00010030), id: (0000000000000000), size: 149
  290. #
  291. write_le32(0x00010030); # Type
  292. write_le64(0x00000000, 0x00000000); # ID
  293. write_le32(149); # Size
  294. write_hunk_fix_endian(300136, 149);
  295. #
  296. # Firmware 23, type: STD FW D2620 DTV6 QAM (0x00000068), id: (0000000000000000), size: 149
  297. #
  298. write_le32(0x00000068); # Type
  299. write_le64(0x00000000, 0x00000000); # ID
  300. write_le32(149); # Size
  301. write_hunk_fix_endian(300296, 149);
  302. #
  303. # Firmware 24, type: STD FW D2633 DTV6 QAM (0x00000070), id: (0000000000000000), size: 149
  304. #
  305. write_le32(0x00000070); # Type
  306. write_le64(0x00000000, 0x00000000); # ID
  307. write_le32(149); # Size
  308. write_hunk_fix_endian(300448, 149);
  309. #
  310. # Firmware 25, type: STD FW D2620 DTV7 (0x00000088), id: (0000000000000000), size: 149
  311. #
  312. write_le32(0x00000088); # Type
  313. write_le64(0x00000000, 0x00000000); # ID
  314. write_le32(149); # Size
  315. write_hunk_fix_endian(300608, 149);
  316. #
  317. # Firmware 26, type: STD FW D2633 DTV7 (0x00000090), id: (0000000000000000), size: 149
  318. #
  319. write_le32(0x00000090); # Type
  320. write_le64(0x00000000, 0x00000000); # ID
  321. write_le32(149); # Size
  322. write_hunk_fix_endian(300760, 149);
  323. #
  324. # Firmware 27, type: STD FW D2620 DTV78 (0x00000108), id: (0000000000000000), size: 149
  325. #
  326. write_le32(0x00000108); # Type
  327. write_le64(0x00000000, 0x00000000); # ID
  328. write_le32(149); # Size
  329. write_hunk_fix_endian(300920, 149);
  330. #
  331. # Firmware 28, type: STD FW D2633 DTV78 (0x00000110), id: (0000000000000000), size: 149
  332. #
  333. write_le32(0x00000110); # Type
  334. write_le64(0x00000000, 0x00000000); # ID
  335. write_le32(149); # Size
  336. write_hunk_fix_endian(301072, 149);
  337. #
  338. # Firmware 29, type: STD FW D2620 DTV8 (0x00000208), id: (0000000000000000), size: 149
  339. #
  340. write_le32(0x00000208); # Type
  341. write_le64(0x00000000, 0x00000000); # ID
  342. write_le32(149); # Size
  343. write_hunk_fix_endian(301232, 149);
  344. #
  345. # Firmware 30, type: STD FW D2633 DTV8 (0x00000210), id: (0000000000000000), size: 149
  346. #
  347. write_le32(0x00000210); # Type
  348. write_le64(0x00000000, 0x00000000); # ID
  349. write_le32(149); # Size
  350. write_hunk_fix_endian(301384, 149);
  351. #
  352. # Firmware 31, type: STD FW FM (0x00000400), id: (0000000000000000), size: 135
  353. #
  354. write_le32(0x00000400); # Type
  355. write_le64(0x00000000, 0x00000000); # ID
  356. write_le32(135); # Size
  357. write_hunk_fix_endian(301554, 135);
  358. #
  359. # Firmware 32, type: STD FW (0x00000000), id: PAL/I (0000000000000010), size: 161
  360. #
  361. write_le32(0x00000000); # Type
  362. write_le64(0x00000000, 0x00000010); # ID
  363. write_le32(161); # Size
  364. write_hunk_fix_endian(301688, 161);
  365. #
  366. # Firmware 33, type: STD FW MTS (0x00000004), id: PAL/I (0000000000000010), size: 169
  367. #
  368. write_le32(0x00000004); # Type
  369. write_le64(0x00000000, 0x00000010); # ID
  370. write_le32(169); # Size
  371. write_hunk_fix_endian(301856, 169);
  372. #
  373. # Firmware 34, type: STD FW (0x00000000), id: SECAM/L AM (0000001000400000), size: 169
  374. #
  375. #
  376. # Firmware 35, type: STD FW (0x00000000), id: SECAM/L NICAM (0000000c00400000), size: 161
  377. #
  378. write_le32(0x00000000); # Type
  379. write_le64(0x0000000c, 0x00400000); # ID
  380. write_le32(161); # Size
  381. write_hunk_fix_endian(302032, 161);
  382. #
  383. # Firmware 36, type: STD FW (0x00000000), id: SECAM/Lc (0000000000800000), size: 161
  384. #
  385. write_le32(0x00000000); # Type
  386. write_le64(0x00000000, 0x00800000); # ID
  387. write_le32(161); # Size
  388. write_hunk_fix_endian(302200, 161);
  389. #
  390. # Firmware 37, type: STD FW (0x00000000), id: NTSC/M Kr (0000000000008000), size: 161
  391. #
  392. write_le32(0x00000000); # Type
  393. write_le64(0x00000000, 0x00008000); # ID
  394. write_le32(161); # Size
  395. write_hunk_fix_endian(302368, 161);
  396. #
  397. # Firmware 38, type: STD FW LCD (0x00001000), id: NTSC/M Kr (0000000000008000), size: 161
  398. #
  399. write_le32(0x00001000); # Type
  400. write_le64(0x00000000, 0x00008000); # ID
  401. write_le32(161); # Size
  402. write_hunk_fix_endian(302536, 161);
  403. #
  404. # Firmware 39, type: STD FW LCD NOGD (0x00003000), id: NTSC/M Kr (0000000000008000), size: 161
  405. #
  406. write_le32(0x00003000); # Type
  407. write_le64(0x00000000, 0x00008000); # ID
  408. write_le32(161); # Size
  409. write_hunk_fix_endian(302704, 161);
  410. #
  411. # Firmware 40, type: STD FW MTS (0x00000004), id: NTSC/M Kr (0000000000008000), size: 169
  412. #
  413. write_le32(0x00000004); # Type
  414. write_le64(0x00000000, 0x00008000); # ID
  415. write_le32(169); # Size
  416. write_hunk_fix_endian(302872, 169);
  417. #
  418. # Firmware 41, type: STD FW (0x00000000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  419. #
  420. write_le32(0x00000000); # Type
  421. write_le64(0x00000000, 0x0000b700); # ID
  422. write_le32(161); # Size
  423. write_hunk_fix_endian(303048, 161);
  424. #
  425. # Firmware 42, type: STD FW LCD (0x00001000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  426. #
  427. write_le32(0x00001000); # Type
  428. write_le64(0x00000000, 0x0000b700); # ID
  429. write_le32(161); # Size
  430. write_hunk_fix_endian(303216, 161);
  431. #
  432. # Firmware 43, type: STD FW LCD NOGD (0x00003000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  433. #
  434. write_le32(0x00003000); # Type
  435. write_le64(0x00000000, 0x0000b700); # ID
  436. write_le32(161); # Size
  437. write_hunk_fix_endian(303384, 161);
  438. #
  439. # Firmware 44, type: STD FW (0x00000000), id: NTSC/M Jp (0000000000002000), size: 161
  440. #
  441. write_le32(0x00000000); # Type
  442. write_le64(0x00000000, 0x00002000); # ID
  443. write_le32(161); # Size
  444. write_hunk_fix_endian(303552, 161);
  445. #
  446. # Firmware 45, type: STD FW MTS (0x00000004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  447. #
  448. write_le32(0x00000004); # Type
  449. write_le64(0x00000000, 0x0000b700); # ID
  450. write_le32(169); # Size
  451. write_hunk_fix_endian(303720, 169);
  452. #
  453. # Firmware 46, type: STD FW MTS LCD (0x00001004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  454. #
  455. write_le32(0x00001004); # Type
  456. write_le64(0x00000000, 0x0000b700); # ID
  457. write_le32(169); # Size
  458. write_hunk_fix_endian(303896, 169);
  459. #
  460. # Firmware 47, type: STD FW MTS LCD NOGD (0x00003004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  461. #
  462. write_le32(0x00003004); # Type
  463. write_le64(0x00000000, 0x0000b700); # ID
  464. write_le32(169); # Size
  465. write_hunk_fix_endian(304072, 169);
  466. #
  467. # Firmware 48, type: SCODE FW HAS IF (0x60000000), IF = 3.28 MHz id: (0000000000000000), size: 192
  468. #
  469. write_le32(0x60000000); # Type
  470. write_le64(0x00000000, 0x00000000); # ID
  471. write_le16(3280); # IF
  472. write_le32(192); # Size
  473. write_hunk(309048, 192);
  474. #
  475. # Firmware 49, type: SCODE FW HAS IF (0x60000000), IF = 3.30 MHz id: (0000000000000000), size: 192
  476. #
  477. # write_le32(0x60000000); # Type
  478. # write_le64(0x00000000, 0x00000000); # ID
  479. # write_le16(3300); # IF
  480. # write_le32(192); # Size
  481. # write_hunk(304440, 192);
  482. #
  483. # Firmware 50, type: SCODE FW HAS IF (0x60000000), IF = 3.44 MHz id: (0000000000000000), size: 192
  484. #
  485. write_le32(0x60000000); # Type
  486. write_le64(0x00000000, 0x00000000); # ID
  487. write_le16(3440); # IF
  488. write_le32(192); # Size
  489. write_hunk(309432, 192);
  490. #
  491. # Firmware 51, type: SCODE FW HAS IF (0x60000000), IF = 3.46 MHz id: (0000000000000000), size: 192
  492. #
  493. write_le32(0x60000000); # Type
  494. write_le64(0x00000000, 0x00000000); # ID
  495. write_le16(3460); # IF
  496. write_le32(192); # Size
  497. write_hunk(309624, 192);
  498. #
  499. # Firmware 52, type: SCODE FW DTV6 ATSC OREN36 HAS IF (0x60210020), IF = 3.80 MHz id: (0000000000000000), size: 192
  500. #
  501. write_le32(0x60210020); # Type
  502. write_le64(0x00000000, 0x00000000); # ID
  503. write_le16(3800); # IF
  504. write_le32(192); # Size
  505. write_hunk(306936, 192);
  506. #
  507. # Firmware 53, type: SCODE FW HAS IF (0x60000000), IF = 4.00 MHz id: (0000000000000000), size: 192
  508. #
  509. write_le32(0x60000000); # Type
  510. write_le64(0x00000000, 0x00000000); # ID
  511. write_le16(4000); # IF
  512. write_le32(192); # Size
  513. write_hunk(309240, 192);
  514. #
  515. # Firmware 54, type: SCODE FW DTV6 ATSC TOYOTA388 HAS IF (0x60410020), IF = 4.08 MHz id: (0000000000000000), size: 192
  516. #
  517. write_le32(0x60410020); # Type
  518. write_le64(0x00000000, 0x00000000); # ID
  519. write_le16(4080); # IF
  520. write_le32(192); # Size
  521. write_hunk(307128, 192);
  522. #
  523. # Firmware 55, type: SCODE FW HAS IF (0x60000000), IF = 4.20 MHz id: (0000000000000000), size: 192
  524. #
  525. write_le32(0x60000000); # Type
  526. write_le64(0x00000000, 0x00000000); # ID
  527. write_le16(4200); # IF
  528. write_le32(192); # Size
  529. write_hunk(308856, 192);
  530. #
  531. # Firmware 56, type: SCODE FW MONO HAS IF (0x60008000), IF = 4.32 MHz id: NTSC/M Kr (0000000000008000), size: 192
  532. #
  533. write_le32(0x60008000); # Type
  534. write_le64(0x00000000, 0x00008000); # ID
  535. write_le16(4320); # IF
  536. write_le32(192); # Size
  537. write_hunk(305208, 192);
  538. #
  539. # Firmware 57, type: SCODE FW HAS IF (0x60000000), IF = 4.45 MHz id: (0000000000000000), size: 192
  540. #
  541. write_le32(0x60000000); # Type
  542. write_le64(0x00000000, 0x00000000); # ID
  543. write_le16(4450); # IF
  544. write_le32(192); # Size
  545. write_hunk(309816, 192);
  546. #
  547. # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192
  548. #
  549. write_le32(0x6002b004); # Type
  550. write_le64(0x00000000, 0x0000b700); # ID
  551. write_le16(4500); # IF
  552. write_le32(192); # Size
  553. write_hunk(304824, 192);
  554. #
  555. # Firmware 59, type: SCODE FW LCD NOGD IF HAS IF (0x60023000), IF = 4.60 MHz id: NTSC/M Kr (0000000000008000), size: 192
  556. #
  557. write_le32(0x60023000); # Type
  558. write_le64(0x00000000, 0x00008000); # ID
  559. write_le16(4600); # IF
  560. write_le32(192); # Size
  561. write_hunk(305016, 192);
  562. #
  563. # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192
  564. #
  565. write_le32(0x620003e0); # Type
  566. write_le64(0x00000000, 0x00000000); # ID
  567. write_le16(4760); # IF
  568. write_le32(192); # Size
  569. write_hunk(304440, 192);
  570. #
  571. # Firmware 61, type: SCODE FW HAS IF (0x60000000), IF = 4.94 MHz id: (0000000000000000), size: 192
  572. #
  573. write_le32(0x60000000); # Type
  574. write_le64(0x00000000, 0x00000000); # ID
  575. write_le16(4940); # IF
  576. write_le32(192); # Size
  577. write_hunk(308664, 192);
  578. #
  579. # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192
  580. #
  581. write_le32(0x60000000); # Type
  582. write_le64(0x00000000, 0x00000000); # ID
  583. write_le16(5260); # IF
  584. write_le32(192); # Size
  585. write_hunk(307704, 192);
  586. #
  587. # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192
  588. #
  589. write_le32(0x60008000); # Type
  590. write_le64(0x0000000f, 0x00000007); # ID
  591. write_le16(5320); # IF
  592. write_le32(192); # Size
  593. write_hunk(307896, 192);
  594. #
  595. # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192
  596. #
  597. write_le32(0x65000380); # Type
  598. write_le64(0x00000000, 0x00000000); # ID
  599. write_le16(5400); # IF
  600. write_le32(192); # Size
  601. write_hunk(304248, 192);
  602. #
  603. # Firmware 65, type: SCODE FW DTV6 ATSC OREN538 HAS IF (0x60110020), IF = 5.58 MHz id: (0000000000000000), size: 192
  604. #
  605. write_le32(0x60110020); # Type
  606. write_le64(0x00000000, 0x00000000); # ID
  607. write_le16(5580); # IF
  608. write_le32(192); # Size
  609. write_hunk(306744, 192);
  610. #
  611. # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192
  612. #
  613. write_le32(0x60000000); # Type
  614. write_le64(0x00000003, 0x00000007); # ID
  615. write_le16(5640); # IF
  616. write_le32(192); # Size
  617. write_hunk(305592, 192);
  618. #
  619. # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192
  620. #
  621. write_le32(0x60000000); # Type
  622. write_le64(0x0000000c, 0x00000007); # ID
  623. write_le16(5740); # IF
  624. write_le32(192); # Size
  625. write_hunk(305784, 192);
  626. #
  627. # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192
  628. #
  629. write_le32(0x60000000); # Type
  630. write_le64(0x00000000, 0x00000000); # ID
  631. write_le16(5900); # IF
  632. write_le32(192); # Size
  633. write_hunk(307512, 192);
  634. #
  635. # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192
  636. #
  637. write_le32(0x60008000); # Type
  638. write_le64(0x0000000c, 0x04c000f0); # ID
  639. write_le16(6000); # IF
  640. write_le32(192); # Size
  641. write_hunk(305576, 192);
  642. #
  643. # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192
  644. #
  645. write_le32(0x68050060); # Type
  646. write_le64(0x00000000, 0x00000000); # ID
  647. write_le16(6200); # IF
  648. write_le32(192); # Size
  649. write_hunk(306552, 192);
  650. #
  651. # Firmware 71, type: SCODE FW HAS IF (0x60000000), IF = 6.24 MHz id: PAL/I (0000000000000010), size: 192
  652. #
  653. write_le32(0x60000000); # Type
  654. write_le64(0x00000000, 0x00000010); # ID
  655. write_le16(6240); # IF
  656. write_le32(192); # Size
  657. write_hunk(305400, 192);
  658. #
  659. # Firmware 72, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.32 MHz id: SECAM/K1 (0000000000200000), size: 192
  660. #
  661. write_le32(0x60008000); # Type
  662. write_le64(0x00000000, 0x00200000); # ID
  663. write_le16(6320); # IF
  664. write_le32(192); # Size
  665. write_hunk(308472, 192);
  666. #
  667. # Firmware 73, type: SCODE FW HAS IF (0x60000000), IF = 6.34 MHz id: SECAM/K1 (0000000000200000), size: 192
  668. #
  669. write_le32(0x60000000); # Type
  670. write_le64(0x00000000, 0x00200000); # ID
  671. write_le16(6340); # IF
  672. write_le32(192); # Size
  673. write_hunk(306360, 192);
  674. #
  675. # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192
  676. #
  677. write_le32(0x60008000); # Type
  678. write_le64(0x0000000c, 0x044000e0); # ID
  679. write_le16(6500); # IF
  680. write_le32(192); # Size
  681. write_hunk(308280, 192);
  682. #
  683. # Firmware 75, type: SCODE FW DTV6 ATSC ATI638 HAS IF (0x60090020), IF = 6.58 MHz id: (0000000000000000), size: 192
  684. #
  685. write_le32(0x60090020); # Type
  686. write_le64(0x00000000, 0x00000000); # ID
  687. write_le16(6580); # IF
  688. write_le32(192); # Size
  689. write_hunk(304632, 192);
  690. #
  691. # Firmware 76, type: SCODE FW HAS IF (0x60000000), IF = 6.60 MHz id: PAL/DK A2 (00000003000000e0), size: 192
  692. #
  693. write_le32(0x60000000); # Type
  694. write_le64(0x00000003, 0x000000e0); # ID
  695. write_le16(6600); # IF
  696. write_le32(192); # Size
  697. write_hunk(306168, 192);
  698. #
  699. # Firmware 77, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.68 MHz id: PAL/DK A2 (00000003000000e0), size: 192
  700. #
  701. write_le32(0x60008000); # Type
  702. write_le64(0x00000003, 0x000000e0); # ID
  703. write_le16(6680); # IF
  704. write_le32(192); # Size
  705. write_hunk(308088, 192);
  706. #
  707. # Firmware 78, type: SCODE FW DTV6 ATSC TOYOTA794 HAS IF (0x60810020), IF = 8.14 MHz id: (0000000000000000), size: 192
  708. #
  709. write_le32(0x60810020); # Type
  710. write_le64(0x00000000, 0x00000000); # ID
  711. write_le16(8140); # IF
  712. write_le32(192); # Size
  713. write_hunk(307320, 192);
  714. #
  715. # Firmware 79, type: SCODE FW HAS IF (0x60000000), IF = 8.20 MHz id: (0000000000000000), size: 192
  716. #
  717. # write_le32(0x60000000); # Type
  718. # write_le64(0x00000000, 0x00000000); # ID
  719. # write_le16(8200); # IF
  720. # write_le32(192); # Size
  721. # write_hunk(308088, 192);
  722. }
  723. sub main_firmware_27($$$$)
  724. {
  725. my $out;
  726. my $j=0;
  727. my $outfile = shift;
  728. my $name = shift;
  729. my $version = shift;
  730. my $nr_desc = shift;
  731. for ($j = length($name); $j <32; $j++) {
  732. $name = $name.chr(0);
  733. }
  734. open OUTFILE, ">$outfile";
  735. syswrite(OUTFILE, $name);
  736. write_le16($version);
  737. write_le16($nr_desc);
  738. #
  739. # Firmware 0, type: BASE FW F8MHZ (0x00000003), id: (0000000000000000), size: 8718
  740. #
  741. write_le32(0x00000003); # Type
  742. write_le64(0x00000000, 0x00000000); # ID
  743. write_le32(8718); # Size
  744. write_hunk_fix_endian(813432, 8718);
  745. #
  746. # Firmware 1, type: BASE FW F8MHZ MTS (0x00000007), id: (0000000000000000), size: 8712
  747. #
  748. write_le32(0x00000007); # Type
  749. write_le64(0x00000000, 0x00000000); # ID
  750. write_le32(8712); # Size
  751. write_hunk_fix_endian(822152, 8712);
  752. #
  753. # Firmware 2, type: BASE FW FM (0x00000401), id: (0000000000000000), size: 8562
  754. #
  755. write_le32(0x00000401); # Type
  756. write_le64(0x00000000, 0x00000000); # ID
  757. write_le32(8562); # Size
  758. write_hunk_fix_endian(830872, 8562);
  759. #
  760. # Firmware 3, type: BASE FW FM INPUT1 (0x00000c01), id: (0000000000000000), size: 8576
  761. #
  762. write_le32(0x00000c01); # Type
  763. write_le64(0x00000000, 0x00000000); # ID
  764. write_le32(8576); # Size
  765. write_hunk_fix_endian(839440, 8576);
  766. #
  767. # Firmware 4, type: BASE FW (0x00000001), id: (0000000000000000), size: 8706
  768. #
  769. write_le32(0x00000001); # Type
  770. write_le64(0x00000000, 0x00000000); # ID
  771. write_le32(8706); # Size
  772. write_hunk_fix_endian(848024, 8706);
  773. #
  774. # Firmware 5, type: BASE FW MTS (0x00000005), id: (0000000000000000), size: 8682
  775. #
  776. write_le32(0x00000005); # Type
  777. write_le64(0x00000000, 0x00000000); # ID
  778. write_le32(8682); # Size
  779. write_hunk_fix_endian(856736, 8682);
  780. #
  781. # Firmware 6, type: STD FW (0x00000000), id: PAL/BG A2/A (0000000100000007), size: 161
  782. #
  783. write_le32(0x00000000); # Type
  784. write_le64(0x00000001, 0x00000007); # ID
  785. write_le32(161); # Size
  786. write_hunk_fix_endian(865424, 161);
  787. #
  788. # Firmware 7, type: STD FW MTS (0x00000004), id: PAL/BG A2/A (0000000100000007), size: 169
  789. #
  790. write_le32(0x00000004); # Type
  791. write_le64(0x00000001, 0x00000007); # ID
  792. write_le32(169); # Size
  793. write_hunk_fix_endian(865592, 169);
  794. #
  795. # Firmware 8, type: STD FW (0x00000000), id: PAL/BG A2/B (0000000200000007), size: 161
  796. #
  797. write_le32(0x00000000); # Type
  798. write_le64(0x00000002, 0x00000007); # ID
  799. write_le32(161); # Size
  800. write_hunk_fix_endian(865424, 161);
  801. #
  802. # Firmware 9, type: STD FW MTS (0x00000004), id: PAL/BG A2/B (0000000200000007), size: 169
  803. #
  804. write_le32(0x00000004); # Type
  805. write_le64(0x00000002, 0x00000007); # ID
  806. write_le32(169); # Size
  807. write_hunk_fix_endian(865592, 169);
  808. #
  809. # Firmware 10, type: STD FW (0x00000000), id: PAL/BG NICAM/A (0000000400000007), size: 161
  810. #
  811. write_le32(0x00000000); # Type
  812. write_le64(0x00000004, 0x00000007); # ID
  813. write_le32(161); # Size
  814. write_hunk_fix_endian(866112, 161);
  815. #
  816. # Firmware 11, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/A (0000000400000007), size: 169
  817. #
  818. write_le32(0x00000004); # Type
  819. write_le64(0x00000004, 0x00000007); # ID
  820. write_le32(169); # Size
  821. write_hunk_fix_endian(866280, 169);
  822. #
  823. # Firmware 12, type: STD FW (0x00000000), id: PAL/BG NICAM/B (0000000800000007), size: 161
  824. #
  825. write_le32(0x00000000); # Type
  826. write_le64(0x00000008, 0x00000007); # ID
  827. write_le32(161); # Size
  828. write_hunk_fix_endian(866112, 161);
  829. #
  830. # Firmware 13, type: STD FW MTS (0x00000004), id: PAL/BG NICAM/B (0000000800000007), size: 169
  831. #
  832. write_le32(0x00000004); # Type
  833. write_le64(0x00000008, 0x00000007); # ID
  834. write_le32(169); # Size
  835. write_hunk_fix_endian(866280, 169);
  836. #
  837. # Firmware 14, type: STD FW (0x00000000), id: PAL/DK A2 (00000003000000e0), size: 161
  838. #
  839. write_le32(0x00000000); # Type
  840. write_le64(0x00000003, 0x000000e0); # ID
  841. write_le32(161); # Size
  842. write_hunk_fix_endian(866800, 161);
  843. #
  844. # Firmware 15, type: STD FW MTS (0x00000004), id: PAL/DK A2 (00000003000000e0), size: 169
  845. #
  846. write_le32(0x00000004); # Type
  847. write_le64(0x00000003, 0x000000e0); # ID
  848. write_le32(169); # Size
  849. write_hunk_fix_endian(866968, 169);
  850. #
  851. # Firmware 16, type: STD FW (0x00000000), id: PAL/DK NICAM (0000000c000000e0), size: 161
  852. #
  853. write_le32(0x00000000); # Type
  854. write_le64(0x0000000c, 0x000000e0); # ID
  855. write_le32(161); # Size
  856. write_hunk_fix_endian(867144, 161);
  857. #
  858. # Firmware 17, type: STD FW MTS (0x00000004), id: PAL/DK NICAM (0000000c000000e0), size: 169
  859. #
  860. write_le32(0x00000004); # Type
  861. write_le64(0x0000000c, 0x000000e0); # ID
  862. write_le32(169); # Size
  863. write_hunk_fix_endian(867312, 169);
  864. #
  865. # Firmware 18, type: STD FW (0x00000000), id: SECAM/K1 (0000000000200000), size: 161
  866. #
  867. write_le32(0x00000000); # Type
  868. write_le64(0x00000000, 0x00200000); # ID
  869. write_le32(161); # Size
  870. write_hunk_fix_endian(867488, 161);
  871. #
  872. # Firmware 19, type: STD FW MTS (0x00000004), id: SECAM/K1 (0000000000200000), size: 169
  873. #
  874. write_le32(0x00000004); # Type
  875. write_le64(0x00000000, 0x00200000); # ID
  876. write_le32(169); # Size
  877. write_hunk_fix_endian(867656, 169);
  878. #
  879. # Firmware 20, type: STD FW (0x00000000), id: SECAM/K3 (0000000004000000), size: 161
  880. #
  881. write_le32(0x00000000); # Type
  882. write_le64(0x00000000, 0x04000000); # ID
  883. write_le32(161); # Size
  884. write_hunk_fix_endian(867832, 161);
  885. #
  886. # Firmware 21, type: STD FW MTS (0x00000004), id: SECAM/K3 (0000000004000000), size: 169
  887. #
  888. write_le32(0x00000004); # Type
  889. write_le64(0x00000000, 0x04000000); # ID
  890. write_le32(169); # Size
  891. write_hunk_fix_endian(868000, 169);
  892. #
  893. # Firmware 22, type: STD FW D2633 DTV6 ATSC (0x00010030), id: (0000000000000000), size: 149
  894. #
  895. write_le32(0x00010030); # Type
  896. write_le64(0x00000000, 0x00000000); # ID
  897. write_le32(149); # Size
  898. write_hunk_fix_endian(868176, 149);
  899. #
  900. # Firmware 23, type: STD FW D2620 DTV6 QAM (0x00000068), id: (0000000000000000), size: 149
  901. #
  902. write_le32(0x00000068); # Type
  903. write_le64(0x00000000, 0x00000000); # ID
  904. write_le32(149); # Size
  905. write_hunk_fix_endian(868336, 149);
  906. #
  907. # Firmware 24, type: STD FW D2633 DTV6 QAM (0x00000070), id: (0000000000000000), size: 149
  908. #
  909. write_le32(0x00000070); # Type
  910. write_le64(0x00000000, 0x00000000); # ID
  911. write_le32(149); # Size
  912. write_hunk_fix_endian(868488, 149);
  913. #
  914. # Firmware 25, type: STD FW D2620 DTV7 (0x00000088), id: (0000000000000000), size: 149
  915. #
  916. write_le32(0x00000088); # Type
  917. write_le64(0x00000000, 0x00000000); # ID
  918. write_le32(149); # Size
  919. write_hunk_fix_endian(868648, 149);
  920. #
  921. # Firmware 26, type: STD FW D2633 DTV7 (0x00000090), id: (0000000000000000), size: 149
  922. #
  923. write_le32(0x00000090); # Type
  924. write_le64(0x00000000, 0x00000000); # ID
  925. write_le32(149); # Size
  926. write_hunk_fix_endian(868800, 149);
  927. #
  928. # Firmware 27, type: STD FW D2620 DTV78 (0x00000108), id: (0000000000000000), size: 149
  929. #
  930. write_le32(0x00000108); # Type
  931. write_le64(0x00000000, 0x00000000); # ID
  932. write_le32(149); # Size
  933. write_hunk_fix_endian(868960, 149);
  934. #
  935. # Firmware 28, type: STD FW D2633 DTV78 (0x00000110), id: (0000000000000000), size: 149
  936. #
  937. write_le32(0x00000110); # Type
  938. write_le64(0x00000000, 0x00000000); # ID
  939. write_le32(149); # Size
  940. write_hunk_fix_endian(869112, 149);
  941. #
  942. # Firmware 29, type: STD FW D2620 DTV8 (0x00000208), id: (0000000000000000), size: 149
  943. #
  944. write_le32(0x00000208); # Type
  945. write_le64(0x00000000, 0x00000000); # ID
  946. write_le32(149); # Size
  947. write_hunk_fix_endian(868648, 149);
  948. #
  949. # Firmware 30, type: STD FW D2633 DTV8 (0x00000210), id: (0000000000000000), size: 149
  950. #
  951. write_le32(0x00000210); # Type
  952. write_le64(0x00000000, 0x00000000); # ID
  953. write_le32(149); # Size
  954. write_hunk_fix_endian(868800, 149);
  955. #
  956. # Firmware 31, type: STD FW FM (0x00000400), id: (0000000000000000), size: 135
  957. #
  958. write_le32(0x00000400); # Type
  959. write_le64(0x00000000, 0x00000000); # ID
  960. write_le32(135); # Size
  961. write_hunk_fix_endian(869584, 135);
  962. #
  963. # Firmware 32, type: STD FW (0x00000000), id: PAL/I (0000000000000010), size: 161
  964. #
  965. write_le32(0x00000000); # Type
  966. write_le64(0x00000000, 0x00000010); # ID
  967. write_le32(161); # Size
  968. write_hunk_fix_endian(869728, 161);
  969. #
  970. # Firmware 33, type: STD FW MTS (0x00000004), id: PAL/I (0000000000000010), size: 169
  971. #
  972. write_le32(0x00000004); # Type
  973. write_le64(0x00000000, 0x00000010); # ID
  974. write_le32(169); # Size
  975. write_hunk_fix_endian(869896, 169);
  976. #
  977. # Firmware 34, type: STD FW (0x00000000), id: SECAM/L AM (0000001000400000), size: 169
  978. #
  979. write_le32(0x00000000); # Type
  980. write_le64(0x00000010, 0x00400000); # ID
  981. write_le32(169); # Size
  982. write_hunk_fix_endian(870072, 169);
  983. #
  984. # Firmware 35, type: STD FW (0x00000000), id: SECAM/L NICAM (0000000c00400000), size: 161
  985. #
  986. write_le32(0x00000000); # Type
  987. write_le64(0x0000000c, 0x00400000); # ID
  988. write_le32(161); # Size
  989. write_hunk_fix_endian(870248, 161);
  990. #
  991. # Firmware 36, type: STD FW (0x00000000), id: SECAM/Lc (0000000000800000), size: 161
  992. #
  993. write_le32(0x00000000); # Type
  994. write_le64(0x00000000, 0x00800000); # ID
  995. write_le32(161); # Size
  996. write_hunk_fix_endian(870416, 161);
  997. #
  998. # Firmware 37, type: STD FW (0x00000000), id: NTSC/M Kr (0000000000008000), size: 161
  999. #
  1000. write_le32(0x00000000); # Type
  1001. write_le64(0x00000000, 0x00008000); # ID
  1002. write_le32(161); # Size
  1003. write_hunk_fix_endian(870584, 161);
  1004. #
  1005. # Firmware 38, type: STD FW LCD (0x00001000), id: NTSC/M Kr (0000000000008000), size: 161
  1006. #
  1007. write_le32(0x00001000); # Type
  1008. write_le64(0x00000000, 0x00008000); # ID
  1009. write_le32(161); # Size
  1010. write_hunk_fix_endian(870752, 161);
  1011. #
  1012. # Firmware 39, type: STD FW LCD NOGD (0x00003000), id: NTSC/M Kr (0000000000008000), size: 161
  1013. #
  1014. write_le32(0x00003000); # Type
  1015. write_le64(0x00000000, 0x00008000); # ID
  1016. write_le32(161); # Size
  1017. write_hunk_fix_endian(870920, 161);
  1018. #
  1019. # Firmware 40, type: STD FW MTS (0x00000004), id: NTSC/M Kr (0000000000008000), size: 169
  1020. #
  1021. write_le32(0x00000004); # Type
  1022. write_le64(0x00000000, 0x00008000); # ID
  1023. write_le32(169); # Size
  1024. write_hunk_fix_endian(871088, 169);
  1025. #
  1026. # Firmware 41, type: STD FW (0x00000000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  1027. #
  1028. write_le32(0x00000000); # Type
  1029. write_le64(0x00000000, 0x0000b700); # ID
  1030. write_le32(161); # Size
  1031. write_hunk_fix_endian(871264, 161);
  1032. #
  1033. # Firmware 42, type: STD FW LCD (0x00001000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  1034. #
  1035. write_le32(0x00001000); # Type
  1036. write_le64(0x00000000, 0x0000b700); # ID
  1037. write_le32(161); # Size
  1038. write_hunk_fix_endian(871432, 161);
  1039. #
  1040. # Firmware 43, type: STD FW LCD NOGD (0x00003000), id: NTSC PAL/M PAL/N (000000000000b700), size: 161
  1041. #
  1042. write_le32(0x00003000); # Type
  1043. write_le64(0x00000000, 0x0000b700); # ID
  1044. write_le32(161); # Size
  1045. write_hunk_fix_endian(871600, 161);
  1046. #
  1047. # Firmware 44, type: STD FW (0x00000000), id: NTSC/M Jp (0000000000002000), size: 161
  1048. #
  1049. write_le32(0x00000000); # Type
  1050. write_le64(0x00000000, 0x00002000); # ID
  1051. write_le32(161); # Size
  1052. write_hunk_fix_endian(871264, 161);
  1053. #
  1054. # Firmware 45, type: STD FW MTS (0x00000004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  1055. #
  1056. write_le32(0x00000004); # Type
  1057. write_le64(0x00000000, 0x0000b700); # ID
  1058. write_le32(169); # Size
  1059. write_hunk_fix_endian(871936, 169);
  1060. #
  1061. # Firmware 46, type: STD FW MTS LCD (0x00001004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  1062. #
  1063. write_le32(0x00001004); # Type
  1064. write_le64(0x00000000, 0x0000b700); # ID
  1065. write_le32(169); # Size
  1066. write_hunk_fix_endian(872112, 169);
  1067. #
  1068. # Firmware 47, type: STD FW MTS LCD NOGD (0x00003004), id: NTSC PAL/M PAL/N (000000000000b700), size: 169
  1069. #
  1070. write_le32(0x00003004); # Type
  1071. write_le64(0x00000000, 0x0000b700); # ID
  1072. write_le32(169); # Size
  1073. write_hunk_fix_endian(872288, 169);
  1074. #
  1075. # Firmware 48, type: SCODE FW HAS IF (0x60000000), IF = 3.28 MHz id: (0000000000000000), size: 192
  1076. #
  1077. write_le32(0x60000000); # Type
  1078. write_le64(0x00000000, 0x00000000); # ID
  1079. write_le16(3280); # IF
  1080. write_le32(192); # Size
  1081. write_hunk(811896, 192);
  1082. #
  1083. # Firmware 49, type: SCODE FW HAS IF (0x60000000), IF = 3.30 MHz id: (0000000000000000), size: 192
  1084. #
  1085. write_le32(0x60000000); # Type
  1086. write_le64(0x00000000, 0x00000000); # ID
  1087. write_le16(3300); # IF
  1088. write_le32(192); # Size
  1089. write_hunk(813048, 192);
  1090. #
  1091. # Firmware 50, type: SCODE FW HAS IF (0x60000000), IF = 3.44 MHz id: (0000000000000000), size: 192
  1092. #
  1093. write_le32(0x60000000); # Type
  1094. write_le64(0x00000000, 0x00000000); # ID
  1095. write_le16(3440); # IF
  1096. write_le32(192); # Size
  1097. write_hunk(812280, 192);
  1098. #
  1099. # Firmware 51, type: SCODE FW HAS IF (0x60000000), IF = 3.46 MHz id: (0000000000000000), size: 192
  1100. #
  1101. write_le32(0x60000000); # Type
  1102. write_le64(0x00000000, 0x00000000); # ID
  1103. write_le16(3460); # IF
  1104. write_le32(192); # Size
  1105. write_hunk(812472, 192);
  1106. #
  1107. # Firmware 52, type: SCODE FW DTV6 ATSC OREN36 HAS IF (0x60210020), IF = 3.80 MHz id: (0000000000000000), size: 192
  1108. #
  1109. write_le32(0x60210020); # Type
  1110. write_le64(0x00000000, 0x00000000); # ID
  1111. write_le16(3800); # IF
  1112. write_le32(192); # Size
  1113. write_hunk(809784, 192);
  1114. #
  1115. # Firmware 53, type: SCODE FW HAS IF (0x60000000), IF = 4.00 MHz id: (0000000000000000), size: 192
  1116. #
  1117. write_le32(0x60000000); # Type
  1118. write_le64(0x00000000, 0x00000000); # ID
  1119. write_le16(4000); # IF
  1120. write_le32(192); # Size
  1121. write_hunk(812088, 192);
  1122. #
  1123. # Firmware 54, type: SCODE FW DTV6 ATSC TOYOTA388 HAS IF (0x60410020), IF = 4.08 MHz id: (0000000000000000), size: 192
  1124. #
  1125. write_le32(0x60410020); # Type
  1126. write_le64(0x00000000, 0x00000000); # ID
  1127. write_le16(4080); # IF
  1128. write_le32(192); # Size
  1129. write_hunk(809976, 192);
  1130. #
  1131. # Firmware 55, type: SCODE FW HAS IF (0x60000000), IF = 4.20 MHz id: (0000000000000000), size: 192
  1132. #
  1133. write_le32(0x60000000); # Type
  1134. write_le64(0x00000000, 0x00000000); # ID
  1135. write_le16(4200); # IF
  1136. write_le32(192); # Size
  1137. write_hunk(811704, 192);
  1138. #
  1139. # Firmware 56, type: SCODE FW MONO HAS IF (0x60008000), IF = 4.32 MHz id: NTSC/M Kr (0000000000008000), size: 192
  1140. #
  1141. write_le32(0x60008000); # Type
  1142. write_le64(0x00000000, 0x00008000); # ID
  1143. write_le16(4320); # IF
  1144. write_le32(192); # Size
  1145. write_hunk(808056, 192);
  1146. #
  1147. # Firmware 57, type: SCODE FW HAS IF (0x60000000), IF = 4.45 MHz id: (0000000000000000), size: 192
  1148. #
  1149. write_le32(0x60000000); # Type
  1150. write_le64(0x00000000, 0x00000000); # ID
  1151. write_le16(4450); # IF
  1152. write_le32(192); # Size
  1153. write_hunk(812664, 192);
  1154. #
  1155. # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192
  1156. #
  1157. write_le32(0x6002b004); # Type
  1158. write_le64(0x00000000, 0x0000b700); # ID
  1159. write_le16(4500); # IF
  1160. write_le32(192); # Size
  1161. write_hunk(807672, 192);
  1162. #
  1163. # Firmware 59, type: SCODE FW LCD NOGD IF HAS IF (0x60023000), IF = 4.60 MHz id: NTSC/M Kr (0000000000008000), size: 192
  1164. #
  1165. write_le32(0x60023000); # Type
  1166. write_le64(0x00000000, 0x00008000); # ID
  1167. write_le16(4600); # IF
  1168. write_le32(192); # Size
  1169. write_hunk(807864, 192);
  1170. #
  1171. # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192
  1172. #
  1173. write_le32(0x620003e0); # Type
  1174. write_le64(0x00000000, 0x00000000); # ID
  1175. write_le16(4760); # IF
  1176. write_le32(192); # Size
  1177. write_hunk(807288, 192);
  1178. #
  1179. # Firmware 61, type: SCODE FW HAS IF (0x60000000), IF = 4.94 MHz id: (0000000000000000), size: 192
  1180. #
  1181. write_le32(0x60000000); # Type
  1182. write_le64(0x00000000, 0x00000000); # ID
  1183. write_le16(4940); # IF
  1184. write_le32(192); # Size
  1185. write_hunk(811512, 192);
  1186. #
  1187. # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192
  1188. #
  1189. write_le32(0x60000000); # Type
  1190. write_le64(0x00000000, 0x00000000); # ID
  1191. write_le16(5260); # IF
  1192. write_le32(192); # Size
  1193. write_hunk(810552, 192);
  1194. #
  1195. # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192
  1196. #
  1197. write_le32(0x60008000); # Type
  1198. write_le64(0x0000000f, 0x00000007); # ID
  1199. write_le16(5320); # IF
  1200. write_le32(192); # Size
  1201. write_hunk(810744, 192);
  1202. #
  1203. # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192
  1204. #
  1205. write_le32(0x65000380); # Type
  1206. write_le64(0x00000000, 0x00000000); # ID
  1207. write_le16(5400); # IF
  1208. write_le32(192); # Size
  1209. write_hunk(807096, 192);
  1210. #
  1211. # Firmware 65, type: SCODE FW DTV6 ATSC OREN538 HAS IF (0x60110020), IF = 5.58 MHz id: (0000000000000000), size: 192
  1212. #
  1213. write_le32(0x60110020); # Type
  1214. write_le64(0x00000000, 0x00000000); # ID
  1215. write_le16(5580); # IF
  1216. write_le32(192); # Size
  1217. write_hunk(809592, 192);
  1218. #
  1219. # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192
  1220. #
  1221. write_le32(0x60000000); # Type
  1222. write_le64(0x00000003, 0x00000007); # ID
  1223. write_le16(5640); # IF
  1224. write_le32(192); # Size
  1225. write_hunk(808440, 192);
  1226. #
  1227. # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192
  1228. #
  1229. write_le32(0x60000000); # Type
  1230. write_le64(0x0000000c, 0x00000007); # ID
  1231. write_le16(5740); # IF
  1232. write_le32(192); # Size
  1233. write_hunk(808632, 192);
  1234. #
  1235. # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192
  1236. #
  1237. write_le32(0x60000000); # Type
  1238. write_le64(0x00000000, 0x00000000); # ID
  1239. write_le16(5900); # IF
  1240. write_le32(192); # Size
  1241. write_hunk(810360, 192);
  1242. #
  1243. # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192
  1244. #
  1245. write_le32(0x60008000); # Type
  1246. write_le64(0x0000000c, 0x04c000f0); # ID
  1247. write_le16(6000); # IF
  1248. write_le32(192); # Size
  1249. write_hunk(808824, 192);
  1250. #
  1251. # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192
  1252. #
  1253. write_le32(0x68050060); # Type
  1254. write_le64(0x00000000, 0x00000000); # ID
  1255. write_le16(6200); # IF
  1256. write_le32(192); # Size
  1257. write_hunk(809400, 192);
  1258. #
  1259. # Firmware 71, type: SCODE FW HAS IF (0x60000000), IF = 6.24 MHz id: PAL/I (0000000000000010), size: 192
  1260. #
  1261. write_le32(0x60000000); # Type
  1262. write_le64(0x00000000, 0x00000010); # ID
  1263. write_le16(6240); # IF
  1264. write_le32(192); # Size
  1265. write_hunk(808248, 192);
  1266. #
  1267. # Firmware 72, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.32 MHz id: SECAM/K1 (0000000000200000), size: 192
  1268. #
  1269. write_le32(0x60008000); # Type
  1270. write_le64(0x00000000, 0x00200000); # ID
  1271. write_le16(6320); # IF
  1272. write_le32(192); # Size
  1273. write_hunk(811320, 192);
  1274. #
  1275. # Firmware 73, type: SCODE FW HAS IF (0x60000000), IF = 6.34 MHz id: SECAM/K1 (0000000000200000), size: 192
  1276. #
  1277. write_le32(0x60000000); # Type
  1278. write_le64(0x00000000, 0x00200000); # ID
  1279. write_le16(6340); # IF
  1280. write_le32(192); # Size
  1281. write_hunk(809208, 192);
  1282. #
  1283. # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192
  1284. #
  1285. write_le32(0x60008000); # Type
  1286. write_le64(0x0000000c, 0x044000e0); # ID
  1287. write_le16(6500); # IF
  1288. write_le32(192); # Size
  1289. write_hunk(811128, 192);
  1290. #
  1291. # Firmware 75, type: SCODE FW DTV6 ATSC ATI638 HAS IF (0x60090020), IF = 6.58 MHz id: (0000000000000000), size: 192
  1292. #
  1293. write_le32(0x60090020); # Type
  1294. write_le64(0x00000000, 0x00000000); # ID
  1295. write_le16(6580); # IF
  1296. write_le32(192); # Size
  1297. write_hunk(807480, 192);
  1298. #
  1299. # Firmware 76, type: SCODE FW HAS IF (0x60000000), IF = 6.60 MHz id: PAL/DK A2 (00000003000000e0), size: 192
  1300. #
  1301. write_le32(0x60000000); # Type
  1302. write_le64(0x00000003, 0x000000e0); # ID
  1303. write_le16(6600); # IF
  1304. write_le32(192); # Size
  1305. write_hunk(809016, 192);
  1306. #
  1307. # Firmware 77, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.68 MHz id: PAL/DK A2 (00000003000000e0), size: 192
  1308. #
  1309. write_le32(0x60008000); # Type
  1310. write_le64(0x00000003, 0x000000e0); # ID
  1311. write_le16(6680); # IF
  1312. write_le32(192); # Size
  1313. write_hunk(810936, 192);
  1314. #
  1315. # Firmware 78, type: SCODE FW DTV6 ATSC TOYOTA794 HAS IF (0x60810020), IF = 8.14 MHz id: (0000000000000000), size: 192
  1316. #
  1317. write_le32(0x60810020); # Type
  1318. write_le64(0x00000000, 0x00000000); # ID
  1319. write_le16(8140); # IF
  1320. write_le32(192); # Size
  1321. write_hunk(810168, 192);
  1322. #
  1323. # Firmware 79, type: SCODE FW HAS IF (0x60000000), IF = 8.20 MHz id: (0000000000000000), size: 192
  1324. #
  1325. write_le32(0x60000000); # Type
  1326. write_le64(0x00000000, 0x00000000); # ID
  1327. write_le16(8200); # IF
  1328. write_le32(192); # Size
  1329. write_hunk(812856, 192);
  1330. }
  1331. sub extract_firmware {
  1332. my $sourcefile_24 = "UDXTTM6000.sys";
  1333. my $hash_24 = "cb9deb5508a5e150af2880f5b0066d78";
  1334. my $outfile_24 = "xc3028-v24.fw";
  1335. my $name_24 = "xc2028 firmware";
  1336. my $version_24 = 516;
  1337. my $nr_desc_24 = 77;
  1338. my $out;
  1339. my $sourcefile_27 = "hcw85bda.sys";
  1340. my $hash_27 = "0e44dbf63bb0169d57446aec21881ff2";
  1341. my $outfile_27 = "xc3028-v27.fw";
  1342. my $name_27 = "xc2028 firmware";
  1343. my $version_27 = 519;
  1344. my $nr_desc_27 = 80;
  1345. my $out;
  1346. if (-e $sourcefile_24) {
  1347. verify($sourcefile_24, $hash_24);
  1348. open INFILE, "<$sourcefile_24";
  1349. main_firmware_24($outfile_24, $name_24, $version_24, $nr_desc_24);
  1350. close INFILE;
  1351. }
  1352. if (-e $sourcefile_27) {
  1353. verify($sourcefile_27, $hash_27);
  1354. open INFILE, "<$sourcefile_27";
  1355. main_firmware_27($outfile_27, $name_27, $version_27, $nr_desc_27);
  1356. close INFILE;
  1357. }
  1358. }
  1359. extract_firmware;
  1360. printf "Firmwares generated.\n";