Constant Values Distribution Investigation in the C Programs Source Code

Cover Page

Cite item

Full Text

Abstract

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.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.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).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.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.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.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.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.

About the authors

K. E. Izrailov

Saint-Petersburg Federal Research Center of the Russian Academy of Sciences

Email: konstantin.izrailov@mail.ru
ORCID iD: 0000-0002-9412-5693
SPIN-code: 5109-3499

References

  1. Касторнов А.Ф., Касторнова В.А. Языки программирования и их роль в становлении предметной области "Информатика" // Педагогическая информатика. 2016. № 1. С. 59‒68. EDN:VUUFHV
  2. Коновалов Г.Г. Измерение качества чистого кода: метрики и инструменты анализа // Тенденции развития науки и образования. 2023. № 102-5. С. 25‒28. doi: 10.18411/trnio-10-2023-244. EDN:GDPWLC
  3. Хлыстов И.С., Жарова О.Ю. Генетическое программирование // Электронный журнал: наука, техника и образование. 2016. № 4(9). С. 62‒67. EDN:XHJVHH
  4. Израилов К.Е. Концепция генетической декомпиляции машинного кода телекоммуникационных устройств // Труды учебных заведений связи. 2021. Т. 7. № 4. С. 10‒17. doi: 10.31854/1813-324X-2021-7-4-95-109. EDN:AIOFPM
  5. 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
  6. Буйневич М.В., Израилов К.Е. Способ классификации файлов на базе технологии машинного обучения // Вестник Санкт-Петербургского государственного университета технологии и дизайна. Серия 1: Естественные и технические науки. 2020. № 1. С. 34‒41. doi: 10.46418/2079-8199_2020_1_6. EDN:MDPYTW
  7. Израилов К.Е. Прогнозирование размера исходного кода бинарной программы в интересах ее интеллектуального реверс-инжиниринга // Вопросы кибербезопасности. 2024. № 4(62). С. 13‒25. doi: 10.21681/2311-3456-2024-4-13-25. EDN:NRFCND
  8. Кучерова С.В. Закон Ципфа и его приложения в области лингвистики // Некоторые вопросы анализа, алгебры, геометрии и математического образования. 2020. № 10. С. 107‒108. EDN:QRNCOY
  9. 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
  10. Фомин А.И. Оценка сложности исследования дизассемблированного кода исполняемых программ // Естественные и технические науки. 2021. № 7(158). С. 210‒211. EDN:UBNPCY
  11. Ормонова Э.М. Определение качества программного продукта на основе теории графов // Наука. Образование. Техника. 2021. № 1(70). С. 37‒44. EDN:ITSANI
  12. Лебедев В.В. Деобфускация control flow flattening средствами символьного исполнения // Прикладная дискретная математика. Приложение. 2021. № 14. С. 134‒138. doi: 10.17223/2226308X/14/29. EDN:ITNATQ
  13. Королев В.Ю., Смелянский Р.Л., Смелянский Т.Р., Шалимов А.В. Об оценивании частоты выполнения фрагментов кода последовательной программы // Известия Российской академии наук. Теория и системы управления. 2015. № 4. С. 39. doi: 10.7868/S0002338815040095. EDN:RXZZRT
  14. 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
  15. 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
  16. 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
  17. Барляева Е.А. Мыслительная деятельность человека в метафорах и сравнениях // Вестник Воронежского государственного университета. Серия: Лингвистика и межкультурная коммуникация. 2016. № 3. С. 15‒18. EDN:WKNUBD

Supplementary files

Supplementary Files
Action
1. JATS XML


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Согласие на обработку персональных данных

 

Используя сайт https://journals.rcsi.science, я (далее – «Пользователь» или «Субъект персональных данных») даю согласие на обработку персональных данных на этом сайте (текст Согласия) и на обработку персональных данных с помощью сервиса «Яндекс.Метрика» (текст Согласия).