<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">tuzsut</journal-id><journal-title-group><journal-title xml:lang="ru">Труды учебных заведений связи</journal-title><trans-title-group xml:lang="en"><trans-title>Proceedings of Telecommunication Universities</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1813-324X</issn><issn pub-type="epub">2712-8830</issn><publisher><publisher-name>СПбГУТ</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.31854/1813-324X-2024-10-5-118-128</article-id><article-id custom-type="edn" pub-id-type="custom">KARAVM</article-id><article-id custom-type="elpub" pub-id-type="custom">tuzsut-632</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ И ТЕЛЕКОММУНИКАЦИИ</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>INFORMATION TECHNOLOGIES AND TELECOMMUNICATION</subject></subj-group></article-categories><title-group><article-title>Исследование распределения константных значений в исходном коде программ на языке C</article-title><trans-title-group xml:lang="en"><trans-title>Constant Values Distribution Investigation in the C Programs Source Code</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-9412-5693</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Израилов</surname><given-names>К. Е.</given-names></name><name name-style="western" xml:lang="en"><surname>Izrailov</surname><given-names>K. E.</given-names></name></name-alternatives><bio xml:lang="ru"><p>кандидат технических наук, доцент, старший научный сотрудник лаборатории проблем компьютерной безопасности Санкт-Петербургского Федерального исследовательского центра Российской академии наук</p></bio><email xlink:type="simple">konstantin.izrailov@mail.ru</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru">Санкт-Петербургский Федеральный исследовательский центр Российской академии наук<country>Россия</country></aff><aff xml:lang="en">Saint-Petersburg Federal Research Center of the Russian Academy of Sciences<country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2024</year></pub-date><pub-date pub-type="epub"><day>07</day><month>11</month><year>2024</year></pub-date><volume>10</volume><issue>5</issue><fpage>119</fpage><lpage>129</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Израилов К.Е., 2024</copyright-statement><copyright-year>2024</copyright-year><copyright-holder xml:lang="ru">Израилов К.Е.</copyright-holder><copyright-holder xml:lang="en">Izrailov K.E.</copyright-holder><license license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://tuzs.sut.ru/jour/article/view/632">https://tuzs.sut.ru/jour/article/view/632</self-uri><abstract><p>В настоящее время ключевую роль в разработке программного обеспечения играет программная инженерия, одним из критерия развитости которой является изучение ее фактологии и различных научно-практических закономерностей. Важным аспектом данной области является логика выполнения программ, оперирующая внутренними данными, и, в частности – константными значениями, выявление закономерностей в которых и актуализирует данное исследование. В качестве основных применений данной закономерности можно отметить такие, как получение фундаментальных знаний об алгоритмах, создание новых и расширение существующих метрик оценки и сравнения программного кода, развитие методов его оптимизации, применение в генетическом программировании и др.</p><p>Целью настоящей статьи получение частотного распределения константных значений в исходном коде программ на языке программирования C.</p><p>Сущность представленного подхода заключается в создании метода статистического анализа текста исходных кодов программ, содержащихся в датасете ExeBench (который состоит из огромного количества исходного кода функций на языке программирования C, их ассемблерного кода для различных процессорных архитектур, ошибок компиляции и другой информации).</p><p>Предложенный метод базируется на применении алгоритмов лексического и синтаксического разбора функций исходного кода, семантического определения типов констант, преобразования записи символов языка программирования в соответствующие числовые или строковые значения.</p><p>Метод имеет реализацию в виде программного средства на языке программирования Python, приведенного в виде интуитивно понятного псевдокода.</p><p>Эксперименты с применением данного прототипа позволили получить искомое распределение константных значений для исходного кода программ на языке программирования C. Анализ полученных результатов позволил сделать ряд важных теоретико-практических выводов касательно наиболее часто используемых констант, соответствия полученного распределения закону Ципфа и близость к показательной функции, аномального появления ряда констант в Топ-50 и др.</p><p>Научная новизна предложенного подхода заключается в том, что распределение константных значений для исходного кода программ на языке программирования C получено впервые.</p><p>Теоретическая значимость состоит в получении новых фундаментальных знаний касательно особенностей и закономерностей конструкций исходного кода, которые могут быть расширены и на другие языки программирования.</p><p>Практическая значимость заключается в применении распределения для большого спектра задач, включая авторский генетический реверс-инжиниринг, который сам по себе является качественно новым направлением.</p></abstract><trans-abstract xml:lang="en"><p>Currently, software engineering plays a key role in software development, one of the criteria for the development of which is the investigation of its factology and various scientific and practical patterns. An important aspect of this area is the logic of program execution, operating with internal data, and, in particular, constant values, the identification of patterns in which actualizes this research. The main applications of this pattern include obtaining fundamental knowledge about algorithms, creating new and expanding existing metrics for evaluating and comparing program code, developing methods for its optimization, using it in genetic programming, etc.</p><p>The purpose of this article is to obtain the frequency distribution of constant values in the source code of programs in the C programming language.</p><p>The essence of the presented approach is to create a method for statistical analysis of the text of the source codes of programs contained in the ExeBench dataset (which consists of a huge amount of source code of functions in the C programming language, their assembler code for various processor architectures, compilation errors and other information).</p><p>The proposed method is based on the use of algorithms for lexical and syntactic analysis of source code functions, semantic definition of constant types, and conversion of the recording of programming language symbols into the corresponding numeric or string values.</p><p>The method has an implementation in the form of a software tool in the Python programming language, given in the form of an intuitive pseudocode. Experiments using this prototype allowed us to obtain the desired distribution of constant values for the source code of programs in the C programming language. Analysis of the obtained results allowed us to make a number of important theoretical and practical conclusions regarding the most frequently used constants, the correspondence of the obtained distribution to the Zipf law and its proximity to the exponential function, the anomalous appearance of a number of constants in the Top 50, etc.</p><p>The scientific novelty of the proposed approach lies in the fact that the distribution of constant values for the source code of programs in the C programming language is obtained for the first time.</p><p>The theoretical significance consists in obtaining new fundamental knowledge regarding the features and patterns of source code constructions, which can be extended to other programming languages.</p><p>The practical significance consists in applying the distribution to a wide range of tasks, including the author's genetic reverse engineering, which in itself is a qualitatively new direction.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>исходный код</kwd><kwd>константные значения</kwd><kwd>распределение</kwd><kwd>метод</kwd><kwd>прототип</kwd><kwd>эксперимент</kwd><kwd>генетический реверс-инжиниринг</kwd></kwd-group><kwd-group xml:lang="en"><kwd>source code</kwd><kwd>constant values</kwd><kwd>distribution</kwd><kwd>method</kwd><kwd>prototype</kwd><kwd>experiment</kwd><kwd>genetic reverse engineering</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Касторнов А.Ф., Касторнова В.А. Языки программирования и их роль в становлении предметной области "Информатика" // Педагогическая информатика. 2016. № 1. С. 59‒68. EDN:VUUFHV</mixed-citation><mixed-citation xml:lang="en">Kastornov A.F.1, Kastornova V.A. Programming languages and their role in formation of subject domain of "Information Scientist. Pedagogical Informatics. 2016;1:59‒68. (in Russ.) EDN:VUUFHV</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Коновалов Г.Г. Измерение качества чистого кода: метрики и инструменты анализа // Тенденции развития науки и образования. 2023. № 102-5. С. 25‒28. DOI:10.18411/trnio-10-2023-244. EDN:GDPWLC</mixed-citation><mixed-citation xml:lang="en">Konovalov G.G. Measuring the quality of clean code: Metrics and analysis tools. Tendentsii razvitiia nauki i obrazovaniia. 2023;102-5:25-28. (in Russ.) DOI:10.18411/trnio-10-2023-244. EDN:GDPWLC</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Хлыстов И.С., Жарова О.Ю. Генетическое программирование // Электронный журнал: наука, техника и образование. 2016. № 4(9). С. 62‒67. EDN:XHJVHH</mixed-citation><mixed-citation xml:lang="en">Hlystov I.S., Zharova O.Y. Genetic programming. Electronic Journal: Science, Technology and Education. 2016;4(9):62‒67. (in Russ.) EDN:XHJVHH</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Израилов К.Е. Концепция генетической декомпиляции машинного кода телекоммуникационных устройств // Труды учебных заведений связи. 2021. Т. 7. № 4. С. 10‒17. DOI:10.31854/1813-324X-2021-7-4-95-109. EDN:AIOFPM</mixed-citation><mixed-citation xml:lang="en">Izrailov K. The Genetic Decompilation Concept of the Telecommunication Devices Machine Code. Proceedings of Telecommunication Universities. 2021;7(4):95‒109. (in Russ.) DOI:10.31854/1813-324X-2021-7-4-95-109. EDN:AIOFPM</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Kotenko I., Izrailov K., Buinevich M. Analytical Modeling for Identification of the Machine Code Architecture of Cyberphysical Devices in Smart Homes // Sensors. 2022. Vol. 22. Iss. 3. PP. 1017. DOI:10.3390/s22031017</mixed-citation><mixed-citation xml:lang="en">Kotenko I., Izrailov K., Buinevich M. Analytical Modeling for Identification of the Machine Code Architecture of Cyberphysical Devices in Smart Homes. Sensors. 2022;22.(3):1017. DOI:10.3390/s22031017</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Буйневич М.В., Израилов К.Е. Способ классификации файлов на базе технологии машинного обучения // Вестник Санкт-Петербургского государственного университета технологии и дизайна. Серия 1: Естественные и технические науки. 2020. № 1. С. 34‒41. DOI:10.46418/2079-8199_2020_1_6. EDN:MDPYTW</mixed-citation><mixed-citation xml:lang="en">Buynevich M.V., Izrailov K.E. Method for classification of files on the basis of machine training technology. Vestnik of St. Petersburg State University of Technology and Design. Series 1. Natural and technical sciences. 2020;1:34‒41. (in Russ.) DOI:10.46418/2079-8199_2020_1_6. EDN:MDPYTW</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Израилов К.Е. Прогнозирование размера исходного кода бинарной программы в интересах ее интеллектуального реверс-инжиниринга // Вопросы кибербезопасности. 2024. № 4(62). С. 13‒25. DOI:10.21681/2311-3456-2024-4-13-25. EDN:NRFCND</mixed-citation><mixed-citation xml:lang="en">Izrailov K.E. Predicting the size of the source code of a binary program in the interests of its intellectual reverse engineering. Voprosy kiberbezopasnosti. 2024;4(62):13‒25. (in Russ.) DOI:10.21681/2311-3456-2024-4-13-25. EDN:NRFCND</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Кучерова С.В. Закон Ципфа и его приложения в области лингвистики // Некоторые вопросы анализа, алгебры, геометрии и математического образования. 2020. № 10. С. 107‒108. EDN:QRNCOY</mixed-citation><mixed-citation xml:lang="en">Kucherova S.V. Zipf's law and its applications in the field of linguistics. Nekotorye voprosy analiza algebry geometrii i matematicheskogo obrazovaniia. 2020;10:107‒108. (in Russ.) EDN:QRNCOY</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Leonov N., Buinevich M., Chechulin A. Top-20 Weakest from Cybersecurity Elements of the Industry Production and Technology Platform 4.0 Information Systems // Proceedings of the International Russian Smart Industry Conference (SmartIndustryCon, Sochi, Russian, 25‒29 March 2024). IEEE, 2024. PP. 668‒675. DOI:10.1109/SmartIndustryCon61328.2024.10515678</mixed-citation><mixed-citation xml:lang="en">Leonov N., Buinevich M., Chechulin A. Top-20 Weakest from Cybersecurity Elements of the Industry Production and Technology Platform 4.0 Information Systems. Proceedings of the International Russian Smart Industry Conference, SmartIndustryCon, 25‒29 March 2024, Sochi, Russian. IEEE; 2024. p.668‒675. DOI:10.1109/SmartIndustryCon61328.2024.10515678</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Фомин А.И. Оценка сложности исследования дизассемблированного кода исполняемых программ // Естественные и технические науки. 2021. № 7(158). С. 210‒211. EDN:UBNPCY</mixed-citation><mixed-citation xml:lang="en">Fomin A.I. Estimation of the difficulty of the disassembled code of the executed programs. Natural and technical sciences. 2021;7(158):210‒211. (in Russ.) EDN:UBNPCY</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Ормонова Э.М. Определение качества программного продукта на основе теории графов // Наука. Образование. Техника. 2021. № 1(70). С. 37‒44. EDN:ITSANI</mixed-citation><mixed-citation xml:lang="en">Ormonova E.M. Determining the quality of the software product based on the theory of graphs. Science. Education. Technology. 2021;1(70):37‒44. (in Russ.) EDN:ITSANI</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">Лебедев В.В. Деобфускация control flow flattening средствами символьного исполнения // Прикладная дискретная математика. Приложение. 2021. № 14. С. 134‒138. DOI:10.17223/2226308X/14/29. EDN:ITNATQ</mixed-citation><mixed-citation xml:lang="en">Lebedev V.V. Control flow flattening deobfuscation using symbolic execution. Applied Discrete Mathematics. Supplement. 2021;14:134‒138. (in Russ.) DOI:10.17223/2226308X/14/29. EDN:ITNATQ</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">Королев В.Ю., Смелянский Р.Л., Смелянский Т.Р., Шалимов А.В. Об оценивании частоты выполнения фрагментов кода последовательной программы // Известия Российской академии наук. Теория и системы управления. 2015. № 4. С. 39. DOI:10.7868/S0002338815040095. EDN:RXZZRT</mixed-citation><mixed-citation xml:lang="en">Korolev V.Y., Smelyanskii R.L., Smelyanskii T.R., Shalimov A.V. On the estimation of the execution frequency of sequential program code snippets. Journal of Computer and Systems Sciences International. 2015;54(4):540‒545. DOI:10.1134/S10 6230715040097. EDN:UFCQZB</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">Armengol-Estapé J., Woodruff J., Brauckmann A., Magalhães J.W.S., O'Boyle M.F.P. ExeBench: an ML-scale dataset of executable C functions // Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming (New York, USA, 13 June 2022). ACM, 2022. PP. 50–59. DOI:10.1145/3520312.3534867</mixed-citation><mixed-citation xml:lang="en">Armengol-Estapé J., Woodruff J., Brauckmann A., Magalhães J.W.S., O'Boyle M.F.P. ExeBench: an ML-scale dataset of executable C functions. Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming, 13 June 2022, New York, USA. ACM; 2022. p.50–59. DOI:10.1145/3520312.3534867</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">Toomey W. Ctcompare: Code clone detection using hashed token sequences // Proceedings of the 6th International Workshop on Software Clones (IWSC, Zurich, Switzerland, 04 June 2012). IEEE, 2012. PP. 92‒93. DOI:10.1109/IWSC.2012.6227881</mixed-citation><mixed-citation xml:lang="en">Toomey W. Ctcompare: Code clone detection using hashed token sequences. Proceedings of the 6th International Workshop on Software Clones, IWSC, 04 June 2012, Zurich, Switzerland. IEEE; 2012. p.92‒93. DOI:10.1109/IWSC.2012.6227881</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">Samuelsson C. Comparative evaluation of the stochastic simplex bisection algorithm and the SciPy.Optimize module // Proceedings of the Federated Conference on Computer Science and Information Systems (FedCSIS, Lodz, Poland, 13‒16 September 2015). IEEE, 2015. PP. 573‒578. DOI:10.15439/2015F47</mixed-citation><mixed-citation xml:lang="en">Samuelsson C. Comparative evaluation of the stochastic simplex bisection algorithm and the SciPy.Optimize module. Proceedings of the Federated Conference on Computer Science and Information Systems, FedCSIS, 13‒16 September 2015, Lodz, Poland. IEEE; 2015. p.573‒578. DOI:10.15439/2015F47</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">Барляева Е.А. Мыслительная деятельность человека в метафорах и сравнениях // Вестник Воронежского государственного университета. Серия: Лингвистика и межкультурная коммуникация. 2016. № 3. С. 15‒18. EDN:WKNUBD</mixed-citation><mixed-citation xml:lang="en">Barlyaeva E.A. Human mental activity in metaphors and similies. Proceedings of Voronezh State University. Series: Linguistics and intercultural communication. 2016;3:15‒18. (in Russ.) EDN:WKNUBD</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
