找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8572|回复: 0

解压canon hf10 hf100 hv30固件的源程序

[复制链接]
发表于 2008-10-2 23:34:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
通过附件中的工具就可以对hf10或者hv30的firmware解密钥,解开以后就可以对相关参数做调整了,真是个好东东
相关内容见:
http://chdk.setepontos.com/index.php/topic,1641.45.html







源码如下:
  1. /*
  2. * Canon HF10(0) Firmware Decrypter
  3. * Copyright 2008 mg1984@gmx.at
  4. *
  5. * based on "Canon Firmware Decrypter" by Alex Bernstein, 2003
  6. */
  7. #include <stdio.h>
  8. #include <stddef.h>

  9. char crypt1[] = {
  10. 0x41, 0xCA, 0x42, 0xF9, 0x3C, 0x6D, 0x9D, 0xDF, 0xD8, 0x19, 0x84, 0x08, 0x50, 0xFB, 0x67, 0xA1,
  11. 0xAD, 0x35, 0xF2, 0xCE, 0xDF, 0x9A, 0xF3, 0xC4, 0xF5, 0x22, 0x1A, 0x8A, 0xD5, 0x64, 0x08, 0x65,
  12. 0xD3, 0x2C, 0x96, 0xB6, 0x08, 0x11, 0x3A, 0xB3, 0x90, 0x08, 0xE6, 0x2E, 0x88, 0xED, 0x24, 0xFB,
  13. 0x24, 0x28, 0x82, 0x3D, 0x39, 0xA8, 0xF3, 0x52, 0x98, 0xF9, 0xA7, 0x75, 0x52, 0x63, 0x0A, 0xF9,
  14. 0xED, 0x7A, 0x82, 0x02, 0x1F, 0x94, 0x76, 0xE1, 0xBA, 0xB6, 0xB9, 0x7B, 0x6C, 0xA2, 0xDA, 0x16,
  15. 0x5B, 0x58, 0x51, 0x20, 0xBC, 0xF1, 0xD8, 0x34, 0x36, 0xAA, 0xD1, 0xA5, 0xEF, 0xF4, 0xE8, 0x50,
  16. 0xDD, 0x09, 0x95, 0x8D, 0xC9, 0x06, 0x8D, 0xF0, 0x2D, 0xA2, 0xF1, 0x0D, 0x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0x3E, 0xF3, 0x1D, 0xD7, 0x86, 0x4B, 0xF1,
  39. 0x9D, 0x69, 0x45, 0xE0, 0xD4, 0x31, 0x89, 0xDC, 0x47, 0x45, 0x94, 0xC5, 0x4D, 0x20, 0x22, 0xB4,
  40. 0xAB, 0x71, 0x36, 0x6B, 0xBC, 0xAF, 0x74, 0x20, 0x0E, 0x6B, 0xB0, 0xB8, 0xB5, 0xF0, 0x34, 0xCA,
  41. 0x02, 0xAD, 0x7B, 0x35, 0x3D, 0x50, 0x01, 0x9E, 0x30, 0x7B, 0x69, 0x2F, 0x6A, 0x79, 0xF4, 0xEF
  42. };

  43. char crypt2[] = {
  44. 0xA5, 0xF5, 0x2A, 0xBE, 0x62, 0x66, 0x1C, 0x80, 0x87, 0x3F, 0x91, 0x01, 0x6E, 0xBC, 0x87, 0x02,
  45. 0xD0, 0x2A, 0x3A, 0xC4, 0x65, 0x3C, 0x91, 0x35, 0xB5, 0xAE, 0x21, 0x21, 0xF5, 0x3F, 0xAC, 0x1F,
  46. 0xBE, 0x92, 0xA6, 0xF2, 0xA8, 0x42, 0x39, 0x8F, 0x41, 0x95, 0x91, 0xBD, 0x4C, 0xAD, 0x85, 0xC7,
  47. 0xB7, 0xD6, 0xAE, 0x1C, 0xE2, 0x62, 0xEB, 0xC2, 0x03, 0x5D, 0xD6, 0x4E, 0x7B, 0x59, 0x0F, 0xDD,
  48. 0xB7, 0x3E, 0x22, 0x55, 0x45, 0x91, 0x81, 0x71, 0x71, 0x9F, 0xE8, 0x6D, 0x67, 0x40, 0x8C, 0x43,
  49. 0x30, 0xAA, 0x43, 0x39, 0x3C, 0x35, 0x4E, 0xAF, 0x67, 0x50, 0xDA, 0xE5, 0xA3, 0xA8, 0x08, 0x9C,
  50. 0x59, 0x3E, 0xEB, 0xD0, 0x01, 0xFB, 0xE5, 0x15, 0x59, 0xFF, 0x76, 0xD7, 0x10, 0x39, 0x88, 0x41,
  51. 0x85, 0xE1, 0xF4, 0x43, 0xE3, 0x66, 0xFE, 0x29, 0x7E, 0x50, 0xD4, 0x82, 0x0F, 0x17, 0x38, 0x10,
  52. 0x45, 0x54, 0x3A, 0x53, 0xF8, 0x1C, 0xA1, 0x08, 0x5B, 0x60, 0x25, 0xCA, 0xF7, 0xE7, 0x35, 0x3F,
  53. 0xC3, 0xF9, 0x02, 0x58, 0x14, 0xE6, 0x71, 0x16, 0x03, 0x1C, 0x8E, 0x0F, 0x34, 0xFE, 0xF5, 0x0A,
  54. 0x31, 0x03, 0x49, 0x41, 0x07, 0xB3, 0x63, 0x21, 0xED, 0x5B, 0x40, 0xF2, 0xE2, 0x24, 0x14, 0x63,
  55. 0x8B, 0x45, 0x9D, 0xA0, 0x65, 0x7A, 0xCE, 0xDF, 0x90, 0xD6, 0xC5, 0x7B, 0x26, 0xE3, 0x38, 0xF1,
  56. 0x31, 0x62, 0xB9, 0x60, 0xE7, 0x02, 0x23, 0xEE, 0x10, 0x44, 0x2B, 0x1B, 0x46, 0x07, 0x87, 0x04,
  57. 0xD5, 0xB2, 0x33, 0x8B, 0x97, 0x75, 0xD7, 0x0F, 0x07, 0xB7, 0xBB, 0x83, 0xC8, 0x3E, 0xDA, 0xF4,
  58. 0x5C, 0x70, 0x4D, 0xDF, 0x70, 0x43, 0xF4, 0x15, 0x6D, 0x6C, 0xB2, 0x59, 0x77, 0xEA, 0xB5, 0x86,
  59. 0x4B, 0xF7, 0x95, 0x80, 0x2A, 0x74, 0x37, 0x04, 0x50, 0x94, 0xF4, 0x92, 0x6D, 0x45, 0x73, 0x49,
  60. 0x90, 0xA8, 0x22, 0x03, 0xB8, 0x0A, 0x22, 0x2D, 0xBB, 0xAD, 0xDF, 0x54, 0xB5, 0x3D, 0xB7, 0x8C,
  61. 0xDE, 0xE6, 0x2A, 0x7D, 0x31, 0xEB, 0x7E, 0x82, 0xFF, 0x1D, 0xFF, 0xF7, 0x70, 0xE6, 0x57, 0xAC,
  62. 0x34, 0x40, 0x55, 0xEC, 0x75, 0x77, 0x03, 0xF2, 0x29, 0xD5, 0x4C, 0x75, 0xB8, 0xF7, 0x5B, 0x91,
  63. 0x75, 0x8C, 0x54, 0xF3, 0xCB, 0x36, 0xBB, 0xA4, 0xF6, 0x83, 0xD4, 0x74, 0xE4, 0xA8, 0x57, 0xB0,
  64. 0x2B, 0x95, 0x5E, 0x18, 0xFE, 0x66, 0xC1, 0x11, 0xF6, 0xCE, 0xAE, 0xBB, 0x93, 0xE6, 0x8B, 0xAB,
  65. 0x61, 0xFC, 0x93, 0x56, 0xDA, 0x4F, 0x66, 0x12, 0xF1, 0x6A, 0x07, 0xDD, 0x6F, 0x6D, 0xBE, 0x76,
  66. 0xC9, 0xA3, 0xCB, 0xB9, 0x96, 0xB7, 0x57, 0x70, 0x09, 0x3C, 0xE1, 0x93, 0xE9, 0xD3, 0x54, 0x1C,
  67. 0xAA, 0xC4, 0xD1, 0x75, 0xC2, 0x99, 0x12, 0x12, 0xCA, 0x50, 0xB5, 0x32, 0xC7, 0x85, 0x75, 0x3E,
  68. 0xD3, 0x08, 0x75, 0xEF, 0x25, 0xF8, 0xB5, 0xED, 0xB1, 0xC0, 0xD7, 0x25, 0xFB, 0x8A, 0x23, 0xEB,
  69. 0xA0, 0xC1, 0x03, 0x0D, 0xFC, 0x1B, 0xAB, 0x89, 0xAA, 0x6B, 0x76, 0xC4, 0x31, 0x45, 0xA9, 0x1D,
  70. 0x65, 0x3F, 0xFD, 0x08, 0x69, 0x34, 0x15, 0x13, 0x16, 0x42, 0x03, 0x6E, 0x81, 0x36, 0x97, 0x5F,
  71. 0x93, 0x22, 0xFA, 0x50, 0x1F, 0x13, 0x82, 0x61, 0x78, 0xEA, 0x28, 0xD5, 0x68, 0x96, 0xA9, 0x63,
  72. 0x55, 0x98, 0x2F, 0x24, 0xFB, 0x42, 0x76, 0xF9, 0x1F, 0xBF, 0x79, 0x28, 0x22, 0xC7, 0xC1, 0x17,
  73. 0x36, 0x1D, 0xC0, 0xB5, 0x51, 0x42, 0x6D, 0x52, 0x3D, 0x56, 0x8C, 0x67, 0x25, 0xC8, 0x02, 0x04,
  74. 0x26, 0xE2, 0xBC, 0x47, 0xD1, 0x5A, 0xB7, 0x99, 0xC2, 0x8E, 0x01, 0x2D, 0xC2, 0xFE, 0xF0, 0x02,
  75. 0x4E, 0x94, 0x80, 0x14, 0x20, 0xF0, 0x55, 0xD4, 0x58, 0x93, 0x9E, 0x33, 0x5B, 0xA5, 0xE6, 0xC6,
  76. 0x88};

  77. #define ENCRYPTION_START 0x10000
  78. #define P_SIZE 64                                        // packet size
  79. #define FIRST_P_ROUND 50
  80. #define FIRST_P_OFFSET 0x10

  81. int dec(FILE *in, FILE *out, int i, int j, int length) {
  82.   int x, val;
  83.   
  84.   //printf("i = %2i j = %2i length = %2i\n", i, j, length);
  85.   for(x = 0; x < length; x++) {
  86.     if((val = fgetc(in)) == EOF)
  87.           return x;
  88.        
  89.         fputc(val ^ crypt1[i + x] ^ crypt2[j + x], out);
  90.   }
  91.   
  92.   return x;
  93. }

  94. int main(int argc, char *argv[])
  95. {
  96.   FILE *in, *out;
  97.   int i = 0, j = 0, rc = FIRST_P_ROUND, bc;
  98.   int decstart = ENCRYPTION_START + FIRST_P_OFFSET;

  99.   if (argc != 3) {
  100.     printf("Usage: dhf10 inputfile outfile\n");
  101.     return -1;
  102.   }

  103.   if ((in = fopen(argv[1], "rb")) == NULL) {
  104.     printf("Cant't open file name %s\n", argv[1]);
  105.     return -1;
  106.   }

  107.   if ((out = fopen(argv[2], "wb")) == NULL) {
  108.     printf("Cant't open file name %s\n", argv[2]);
  109.     fclose(in);
  110.     return -1;
  111.   }
  112.   
  113.   while(decstart-- > 0)
  114.     fputc(fgetc(in), out);

  115.   // decrypt first packet
  116.   dec(in, out, 0 + FIRST_P_OFFSET, P_SIZE - rc + FIRST_P_OFFSET, rc + 1 - FIRST_P_OFFSET);
  117.   rc++;
  118.   
  119.   // decrypt other packets
  120.   do {
  121.     bc = dec(in, out, rc, 0, P_SIZE - rc);
  122.         bc += dec(in, out, 0, P_SIZE - rc, rc + 1);
  123.         rc = (rc + 1) % P_SIZE;
  124.         //printf("rc: %5i bc: %5i\n", rc, bc);
  125.   } while(bc != 0);
  126.   
  127.   fclose(out);
  128.   fclose(in);
  129. }
复制代码

dhf10.c

7.65 KB, 下载次数: 379

dhv30.c

8.25 KB, 下载次数: 365

dhv30.exe

23.31 KB, 下载次数: 478

hf10x.au3

10.92 KB, 下载次数: 376

hf10x.exe

273.26 KB, 下载次数: 509

HF10 Bitmap Viewer.exe

29.5 KB, 下载次数: 482

routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-11-21 21:16 , Processed in 0.135017 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表