extract_xc3028.pl 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718
  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";