• Система автоматизации с открытым исходным кодом на базе esp8266/esp32 микроконтроллеров и приложения IoT Manager. Наша группа в Telegram

Как преобразовать защищенный исходный код веб-страницы в библиотеках?

FlipWho

New member
Привет всем, не очень понимаю, как внести изменения в веб-странички некоторых библиотек (ESPconnect, ElegantOTA и стандартная ESP8266WebServer\FSBrowser), содержимое которых выглядит так:

Код под спойлерами пришлось обрезать, а то движок форума ругался.
Скачать файл FSBrowser
Скачать файл ESPConnect

Код:
// WARNING: Auto-generated file. Please do not modify by hand.
// This file is an embeddable version of the gzipped index.htm file.
// To update it, please rerun the `reduce_index.sh` script located in the `extras` subfolder
// then recompile the sketch after each change to the `index.html` file.
unsigned char index_htm_gz[] = {
  0x1f, 0x8b, 0x08, 0x08, 0x96, 0xc9, 0xa8, 0x5e, 0x00, 0x03, 0x69, 0x6e,
  0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x00, 0xdc, 0x3b, 0x89, 0x7b,
  0xda, 0xb8, 0x97, 0xff, 0x8a, 0xe3, 0xee, 0x24, 0xf6, 0x02, 0x06, 0x92,
  0xe6, 0x28, 0xc4, 0xc9, 0xe4, 0x4e, 0x9a, 0xb3, 0xb9, 0xd3, 0x6e, 0xf7,
  0xfb, 0x04, 0x16, 0xa0, 0xc4, 0xd8, 0xae, 0x2d, 0x07, 0x48, 0xca, 0xfe,
  0xed, 0xfb, 0x9e, 0xe4, 0x13, 0x4c, 0x32, 0xdd, 0x9d, 0xf9, 0xcd, 0xec,
  0xb6, 0xf3, 0x15, 0x5b, 0x96, 0x9e, 0xde, 0x7d, 0x49, 0xb3, 0x3e, 0xb7,
  0x7b, 0xbe, 0x73, 0xfd, 0x70, 0xb1, 0xa7, 0xf4, 0x78, 0xdf, 0x56, 0x2e,
  0x6e, 0xb6, 0x4f, 0x8e, 0x76, 0x14, 0xb5, 0x52, 0xad, 0xde, 0x2d, 0xed,
  0x54, 0xab, 0xbb, 0xd7, 0xbb, 0xca, 0xfd, 0xe1, 0xf5, 0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x9f, 0x98, 0xa5,
  0x7c, 0xf8, 0xf8, 0xf1, 0x63, 0xb3, 0x45, 0xda, 0x4f, 0x5d, 0xdf, 0x0d,
  0x1d, 0xab, 0xd2, 0x76, 0x6d, 0xd7, 0x6f, 0x7c, 0xe8, 0x2c, 0xe3, 0xdf,
  0xa6, 0xc5, 0x02, 0xcf, 0x26, 0xa3, 0x86, 0xe3, 0x3a, 0x14, 0xd6, 0x0e,
  0x2b, 0x41, 0x8f, 0x58, 0xee, 0xa0, 0x51, 0x53, 0x6a, 0x4a, 0xbd, 0x06,
  0x40, 0xfc, 0x6e, 0x8b, 0x68, 0xb5, 0x32, 0xfe, 0x35, 0x3e, 0xea, 0xcd,
  0x0c, 0x19, 0xf5, 0x98, 0x8c, 0x01, 0x65, 0xdd, 0x1e, 0x6f, 0xac, 0xd6,
 

};
unsigned int index_htm_gz_len = 6261;

Код:
#ifndef _espconnect_webpage_h
#define _espconnect_webpage_h

const uint32_t ESPCONNECT_HTML_SIZE = 8422;
const uint8_t ESPCONNECT_HTML[] PROGMEM = {
31,139,8,0,0,0,0,0,2,3,196,90,231,126,131,56,18,255,124,251,20,172,183,36,217,5,7,176,141,29,
156,228,122,239,189,23,25,132,209,69,148,19,34,78,150,31,239,126,146,16,177,198,96,179,125,83,108,52,243,159,
97,26,66,26,184,127,247,7,191,254,254,31,254,250,155,31,90,41,207,232,227,59,247,242,203,162,40,223,63,204,
112,62,147,4,140,226,199,119,190,117,159,97,142,172,40,69,172,194,252,225,170,230,137,179,185,122,163,231,40,195,
15,87,207,4,31,202,130,241,43,43,42,114,142,115,129,59,144,152,167,15,49,126,38,17,118,212,192,38,57,225,
4,81,167,138,16,197,15,158,80,34,180,112,194,41,126,252,225,239,127,243,253,34,207,113,196,239,111,59,138,96,
85,252,85,30,88,226,231,35,251,163,16,37,28,51,241,189,195,73,193,112,179,43,94,156,138,124,66,242,125,72,
242,20,51,194,91,233,130,73,223,21,44,198,204,17,148,109,34,236,146,100,28,6,254,124,245,65,187,43,226,215,
38,42,104,193,194,247,124,215,95,248,235,14,146,160,140,208,215,112,246,187,98,87,240,98,102,91,179,159,96,250,
140,57,137,144,245,43,92,99,64,145,131,239,50,225,146,56,168,80,94,57,149,48,35,49,206,229,205,3,156,117,
227,3,38,251,148,135,11,215,221,82,204,185,48,171,42,81,36,173,116,231,174,39,80,148,228,216,73,59,148,144,
107,119,180,136,158,254,87,23,28,55,218,15,138,19,46,208,11,134,51,171,42,40,137,173,247,98,79,254,110,51,
196,246,36,215,128,126,196,164,42,49,44,81,28,203,243,120,82,206,155,175,196,151,161,220,250,40,164,168,226,78,
148,18,26,55,90,84,248,206,139,44,116,219,249,174,22,71,185,173,191,72,94,214,252,239,252,181,196,15,29,229,
159,38,137,225,10,115,64,169,234,93,70,248,63,155,29,138,158,246,172,168,243,216,209,49,95,172,22,104,233,109,
59,207,132,83,158,225,20,224,57,12,197,164,174,4,100,41,32,91,45,158,36,201,54,170,89,37,142,203,130,228,
28,179,109,76,170,146,162,87,81,12,42,146,202,67,144,10,143,157,228,98,45,114,145,234,180,204,55,130,59,204,
140,146,81,250,32,176,143,169,107,45,228,144,227,23,238,32,74,246,121,24,97,105,77,71,137,113,84,48,196,73,
145,135,121,145,227,142,200,153,168,20,81,193,89,88,151,37,102,17,170,240,246,144,18,142,213,105,177,64,30,24,
42,251,200,135,73,17,213,149,221,143,210,226,25,51,27,176,0,103,152,32,141,26,50,134,18,42,127,64,0,208,
1,222,200,46,16,0,12,37,1,146,15,46,56,157,96,72,52,18,92,212,92,134,254,88,134,127,23,57,70,59,
138,227,127,218,3,194,208,65,200,132,206,64,30,176,219,100,54,186,198,98,156,160,154,242,109,33,11,131,191,138,
194,88,13,109,2,169,50,232,32,105,3,248,56,122,212,29,40,121,25,50,158,220,139,74,6,136,241,132,95,80,
2,32,64,203,212,12,0,137,125,108,245,151,163,11,193,30,167,14,227,48,68,64,39,199,0,192,129,1,98,104,
191,186,140,75,196,112,206,183,159,198,120,80,29,3,166,89,34,227,130,23,228,166,35,160,117,76,227,198,203,102,
92,221,36,236,108,1,77,170,131,56,168,239,98,42,198,231,20,48,58,147,159,65,81,79,193,64,206,38,148,77,
162,38,243,56,174,247,179,72,76,228,118,242,20,211,2,159,54,223,147,243,199,228,57,26,144,230,110,249,55,113,
25,70,20,35,102,15,105,151,162,14,249,48,0,144,13,140,7,252,79,95,174,128,49,237,11,44,83,200,2,165,
57,20,26,227,76,148,32,144,159,66,77,148,26,80,53,1,154,40,41,160,106,10,37,117,125,193,124,192,41,4,
168,31,84,245,4,72,231,104,90,209,4,102,42,111,227,58,167,241,211,211,198,164,250,105,248,167,203,239,228,132,
49,161,191,129,87,83,84,196,230,13,93,44,54,151,201,42,9,70,55,28,198,14,98,19,124,160,183,86,161,107,
185,115,31,236,3,212,80,80,87,146,58,178,156,47,217,165,83,130,157,29,216,4,73,243,19,90,28,156,215,48,
37,113,140,115,169,233,177,243,0,154,251,182,1,234,118,62,195,93,31,180,75,168,105,83,166,149,8,105,173,141,
23,37,220,141,105,75,123,207,149,137,110,107,36,64,197,22,44,163,99,196,241,128,192,73,54,78,116,132,185,136,
2,22,206,16,129,148,76,100,33,5,148,188,206,118,24,158,183,68,85,117,16,110,0,98,133,17,139,160,40,199,
244,100,252,194,1,161,102,16,112,192,248,73,19,68,62,249,181,162,254,243,198,150,130,136,97,100,87,152,226,136,
55,206,1,239,158,8,119,80,89,98,196,80,30,225,110,223,55,49,229,128,45,48,216,215,143,86,164,106,112,164,
40,46,14,90,251,160,17,178,61,179,89,157,7,170,24,186,74,93,75,150,106,204,132,158,235,126,48,72,169,113,
173,129,196,2,50,76,239,144,5,147,108,0,64,170,13,58,72,56,160,131,180,3,6,72,62,96,129,18,24,50,
56,134,167,54,202,97,72,174,25,0,27,165,1,200,102,129,104,122,95,38,221,80,23,75,55,104,198,182,63,198,
198,183,195,154,51,135,48,227,250,42,70,28,133,36,67,123,124,91,61,239,63,126,201,232,182,230,201,198,190,23,
35,75,140,242,234,97,150,114,94,134,183,183,135,195,97,126,88,204,11,182,191,245,93,215,149,248,153,37,251,117,
223,43,94,30,102,174,229,90,11,215,218,204,172,174,95,55,91,184,179,199,251,18,241,212,74,8,165,15,179,15,
252,69,87,139,51,43,126,152,253,210,181,93,26,216,27,26,56,155,217,237,227,189,212,246,120,117,99,117,77,15,
75,117,156,172,188,112,24,46,49,226,125,225,57,138,174,166,142,22,56,111,92,23,202,153,111,192,57,21,241,139,
206,105,147,255,158,213,148,147,146,98,179,155,213,93,128,250,106,67,53,47,218,62,215,77,70,114,71,51,130,174,
 

CodeNameHawk

Moderator
Команда форума
Так написано, что где то лежит не сжатый файл.
// then recompile the sketch after each change to the `index.html` file.
А так, по идее, можете собрать все байты в файл и потом его разжать.
Есть такой полезный сайт http://tomeko.net/online_tools/hex_to_file.php?lang=en
Задайте расширение файла типа .gz и его сможет открыть winrar.
 

FlipWho

New member
Так написано, что где то лежит не сжатый файл.
Конкретно с той библиотекой рядом лежал .html файл, где можно вносить правки и .sh файл для сжатия до конечного вида.

А так, по идее, можете собрать все байты в файл и потом его разжать.
Есть такой полезный сайт http://tomeko.net/online_tools/hex_to_file.php?lang=en
Задайте расширение файла типа .gz и его сможет открыть winrar.
То что надо! Из FSBrowser получилось с первого раза получить архив, а вот это что за сущность (ESPConnect ):

Код:
const uint8_t ESPCONNECT_HTML[] PROGMEM = {

31,139,8,0,0,0,0,0,2,3,196,90,231,126,131,56,18,255,124,251,20,172,183,36,217,5,7,176,141,29,

156,228,122,239,189,23,25,132,209,69,148,19,34,78,150,31,239,126,146,16,177,198,96,179,125,83,108,52,243,159,

97,26,66,26,184,127,247,7,191,254,254,31,254,250,155,31,90,41,207,232,227,59,247,242,203,162,40,223,63,204,

112,62,147,4,140,226,199,119,190,117,159,97,142,172,40,69,172,194,252,225,170,230,137,179,185,122,163,231,40,195,

15,87,207,4,31,202,130,241,43,43,42,114,142,115,129,59,144,152,167,15,49,126,38,17,118,212,192,38,57,225,

4,81,167,138,16,197,15,158,80,34,180,112,194,41,126,252,225,239,127,243,253,34,207,113,196,239,111,59,138,96,

85,252,85,30,88,226,231,35,251,163,16,37,28,51,241,189,195,73,193,112,179,43,94,156,138,124,66,242,125,72,

242,20,51,194,91,233,130,73,223,21,44,198,204,17,148,109,34,236,146,100,28,6,254,124,245,65,187,43,226,215,

38,42,104,193,194,247,124,215,95,248,235,14,146,160,140,208,215,112,246,187,98,87,240,98,102,91,179,159,96,250,

140,57,137,144,245,43,92,99,64,145,131,239,50,225,146,56,168,80,94,57,149,48,35,49,206,229,205,3,156,117,

227,3,38,251,148,135,11,215,221,82,204,185,48,171,42,81,36,173,116,231,174,39,80,148,228,216,73,59,148,144,

107,119,180,136,158,254,87,23,28,55,218,15,138,19,46,208,11,134,51,171,42,40,137,173,247,98,79,254,110,51,

196,246,36,215,128,126,196,164,42,49,44,81,28,203,243,120,82,206,155,175,196,151,161,220,250,40,164,168,226,78,

148,18,26,55,90,84,248,206,139,44,116,219,249,174,22,71,185,173,191,72,94,214,252,239,252,181,196,15,29,229,

159,38,137,225,10,115,64,169,234,93,70,248,63,155,29,138,158,246,172,168,243,216,209,49,95,172,22,104,233,109,

59,207,132,83,158,225,20,224,57,12,197,164,174,4,100,41,32,91,45,158,36,201,54,170,89,37,142,203,130,228,

28,179,109,76,170,146,162,87,81,12,42,146,202,67,144,10,143,157,228,98,45,114,145,234,180,204,55,130,59,204,

140,146,81,250,32,176,143,169,107,45,228,144,227,23,238,32,74,246,121,24,97,105,77,71,137,113,84,48,196,73,

145,135,121,145,227,142,200,153,168,20,81,193,89,88,151,37,102,17,170,240,246,144,18,142,213,105,177,64,30,24,

42,251,200,135,73,17,213,149,221,143,210,226,25,51,27,176,0,103,152,32,141,26,50,134,18,42,127,64,0,208,

1,222,200,46,16,0,12,37,1,146,15,46,56,157,96,72,52,18,92,212,92,134,254,88,134,127,23,57,70,59,

138,227,127,218,3,194,208,65,200,132,206,64,30,176,219,100,54,186,198,98,156,160,154,242,109,33,11,131,191,138,

194,88,13,109,2,169,50,232,32,105,3,248,56,122,212,29,40,121,25,50,158,220,139,74,6,136,241,132,95,80,

2,32,64,203,212,12,0,137,125,108,245,151,163,11,193,30,167,14,227,48,68,64,39,199,0,192,129,1,98,104,

191,186,140,75,196,112,206,183,159,198,120,80,29,3,166,89,34,227,130,23,228,166,35,160,117,76,227,198,203,102,

92,221,36,236,108,1,77,170,131,56,168,239,98,42,198,231,20,48,58,147,159,65,81,79,193,64,206,38,148,77,

162,38,243,56,174,247,179,72,76,228,118,242,20,211,2,159,54,223,147,243,199,228,57,26,144,230,110,249,55,113,

25,70,20,35,102,15,105,151,162,14,249,48,0,144,13,140,7,252,79,95,174,128,49,237,11,44,83,200,2,165,

57,20,26,227,76,148,32,144,159,66,77,148,26,80,53,1,154,40,41,160,106,10,37,117,125,193,124,192,41,4,

168,31,84,245,4,72,231,104,90,209,4,102,42,111,227,58,167,241,211,211,198,164,250,105,248,167,203,239,228,132,

49,161,191,129,87,83,84,196,230,13,93,44,54,151,201,42,9,70,55,28,198,14,98,19,124,160,183,86,161,107,

185,115,31,236,3,212,80,80,87,146,58,178,156,47,217,165,83,130,157,29,216,4,73,243,19,90,28,156,215,48,

37,113,140,115,169,233,177,243,0,154,251,182,1,234,118,62,195,93,31,180,75,168,105,83,166,149,8,105,173,141,

23,37,220,141,105,75,123,207,149,137,110,107,36,64,197,22,44,163,99,196,241,128,192,73,54,78,116,132,185,136,

2,22,206,16,129,148,76,100,33,5,148,188,206,118,24,158,183,68,85,117,16,110,0,98,133,17,139,160,40,199,

244,100,252,194,1,161,102,16,112,192,248,73,19,68,62,249,181,162,254,243,198,150,130,136,97,100,87,152,226,136,

55,206,1,239,158,8,119,80,89,98,196,80,30,225,110,223,55,49,229,128,45,48,216,215,143,86,164,106,112,164,

40,46,14,90,251,160,17,178,61,179,89,157,7,170,24,186,74,93,75,150,106,204,132,158,235,126,48,72,169,113,

173,129,196,2,50,76,239,144,5,147,108,0,64,170,13,58,72,56,160,131,180,3,6,72,62,96,129,18,24,50,

56,134,167,54,202,97,72,174,25,0,27,165,1,200,102,129,104,122,95,38,221,80,23,75,55,104,198,182,63,198,

198,183,195,154,51,135,48,227,250,42,70,28,133,36,67,123,124,91,61,239,63,126,201,232,182,230,201,198,190,23,

35,75,140,242,234,97,150,114,94,134,183,183,135,195,97,126,88,204,11,182,191,245,93,215,149,248,153,37,251,117,

223,43,94,30,102,174,229,90,11,215,218,204,172,174,95,55,91,184,179,199,251,18,241,212,74,8,165,15,179,15,

252,69,87,139,51,43,126,152,253,210,181,93,26,216,27,26,56,155,217,237,227,189,212,246,120,117,99,117,77,15,

75,117,156,172,188,112,24,46,49,226,125,225,57,138,174,166,142,22,56,111,92,23,202,153,111,192,57,21,241,139,

206,105,147,255,158,213,148,147,146,98,179,155,213,93,128,250,106,67,53,47,218,62,215,77,70,114,71,51,130,174,
 

CodeNameHawk

Moderator
Команда форума
а вот это что за сущность (ESPConnect ):
Практически тоже самое, только данные в десятичном формате.

Запустите прошивку в есп, откройте нужный вам файл в браузере, а там можно поглядеть техт в режиме разработчика.
 

enjoynering

Well-known member
Имхо все эти преобразования http, js в двойные форматы и запихивание их в заголовки - лютые костыли. Что мешает поместить html в gzip и читать с файловой системы как это у всех сделанно?
 

CodeNameHawk

Moderator
Команда форума
Что мешает поместить html в gzip и читать с файловой системы как это у всех сделанно?
Не у всех так. Удобно подсовывать данные для отображения на странице.
Нет файловой системы - нет проблем по работе с ней.
Если файл маленький, то и сжимать не надо, удобно подправил и с прошивкой залил.
 

enjoynering

Well-known member
Файлы упрощают реюзинг, облегчают поддержку преемственности версий, апгрейды и даунгрейды. Файлы освобождают от хлопот с планированием размещения во флэш и разруливанием конфликтов размещения, особенно если приложение модульное и модули разрабатываются отдельно.
ну и не надо каждый раз перекомпилировать проект при изменении одной строчки в файле.
 
Сверху Снизу