Electronics and Electrical Engineering and Control

Tracing method from embedded processor P2020 machine code program to C language source program

  • XIE Wenguang ,
  • LI Qi ,
  • MA Chunyan ,
  • WANG Kenian ,
  • YIN Wei ,
  • ZHANG Tao
Expand
  • 1. Key Laboratory of Civil Aircraft Airworthiness Technology, College of Airworthiness, Civil Aviation University of China, Tianjin 300300, China;
    2. AVIC Radio Electronics Research Institute, Shanghai 200241, China;
    3. School of Software, Northwestern Polytechnical University, Xi'an 710072, China

Received date: 2020-12-29

  Revised date: 2021-01-31

  Online published: 2021-04-27

Supported by

National Natural Science Foundation of China (61601468); Aeronautical Science Foundation of China (20185853038,2015ZD53055)

Abstract

The processor PowerPC P2020 is widely used in aeronautical embedded systems. To satisfy the airworthiness requirements of the A-level software in RTCA/DO-178C, a method of tracing from the PowerPC P2020 machine code program to the C language source program is proposed on three levels of codes:file, function declaration, and function body. On the basis of obtaining the C language source and the PowerPC P2020 machine code program file name list, the traceability of the PowerPC P2020 machine code file name is realized. By traverse the C source program abstract syntax tree and PowerPC P2020 machine code to get the list of function names, traceability of the PowerPC P2020 machine code function declaration is realized. By defining the abstract syntax tree node of the C language program to generate the expected assembly instruction sequence rules, traceability of the PowerPC P2020 machine code function body is realized. By designing 245 C language source program files and 345 PowerPC P2020 machine code program files, 1 111 C language function declarations and 1 273 PowerPC P2020 machine code function declarations, as well as 460 test cases covering 23 types of syntax structures of C language programs, effectiveness of the automatic tracing method from the PowerPC P2020 machine code program to the C language source program is verified. The results show that the traceability matching rate of document traceability and function declaration traceability reaches 100%, and the average traceability matching rate of the PowerPC P2020 function body and the C language source program function body code reaches 97.22%. The traceability matching results can check whether exception codes are inserted into the P2020 machine code program during the compilation process, so as to prevent potential safety hazards and ensure the safety and reliability of the embedded safety critical software object codes used in aerospace.

Cite this article

XIE Wenguang , LI Qi , MA Chunyan , WANG Kenian , YIN Wei , ZHANG Tao . Tracing method from embedded processor P2020 machine code program to C language source program[J]. ACTA AERONAUTICAET ASTRONAUTICA SINICA, 2021 , 42(9) : 325177 -325177 . DOI: 10.7527/S1000-6893.2021.25177

References

[1] MATELESS R, REJABEK D, MARGALIT O, et al. Decompiled APK based malicious code classification[J]. Future Generation Computer Systems, 2020, 110:135-147.
[2] Radio Technical Commission for Aeronautics. Software considerations in airborne systems and equipment certification:RTCA DO-178C[S]. 2017.
[3] 夏航, 汪溢. 基于多核处理器P2020的综合数据处理模块设计及应用[J]. 航空电子技术, 2012, 43(3):30-35. XIA H, WANG Y. Design and application of integrated data processing module based on multi-core processor P2020[J]. Avionics Technology, 2012, 43(3):30-35(in Chinese).
[4] EDELSOHN D, GELLERICH W, HAGOG M, et al. Contributions to the GNU compiler collection[J]. IBM Systems Journal, 44(2):259-278.
[5] 徐丙凤, 黄志球, 胡军, 等. 面向适航认证的模型驱动机载软件构件的安全性验证[J]. 航空学报, 2012, 33(5):796-808. XU B F, HUANG Z Q, HU J, et al. Model-driven safety dependence verification for component-based airborne software supporting airworthiness certification[J]. Acta Aeronautica et Astronautica Sinica, 2012, 33(5):796-808(in Chinese).
[6] BRAUER J, DAHLWEID M, PANKRATH T, et al. Source-code-to-object-code traceability analysis for avionics software:Don't trust your compiler[C]//International Conference on Computer Safety, Reliability, and Security. Berlin,Heidelberg:Springer International Publishing, 2015.
[7] BOCCARDO D R, NASCIMENTO T M, MACHADO R C, et al. Traceability of executable codes using neural networks[M]//Lecture Notes in Computer Science. Berlin, Heidelberg:Springer, 2011:241-253.
[8] CROCKER D. Making formal methods popular through automated verification[C]//International Joint Conference on Automated Reasoning, 2001.
[9] RapiCoverZero. Zero-footprint coverage analysis for critical software[EB/OL]. https://www.rapitasystems.com/products/rapicoverzero.
[10] Effective source-to-object code (STO) analysis for safety-critical software[EB/OL]. https://www.rapitasystems.com/products/rapicoverzero 2020.08
[11] 童岳威, 刘建方. 民用飞机A级别机载软件项目源代码到目标代码追溯性分析研究[J]. 科技视界, 2016(20):3-4. TONG Y W, LIU J F. A traceability analysis of civil aircraft class A airborne software project from source code to object code[J]. Science & Technology Vision, 2016(20):3-4(in Chinese).
[12] 左振雷, 熊波, 张文娴, 等. 一种航空机载软件中源代码与目标代码一致性的分析方法:中国, CN107391368A[P]. 2017-11-24. ZUO Z L, XIONG B, ZHANG W X, et al. A method for analyzing the consistency between source code and object code in airborne software, application for patent:China, CN107391368A[P]. 2017-11-24(in Chinese).
[13] 陈涵泊, 吴越, 邹福泰. 基于Asm2Vec的恶意代码同源判定方法[J]. 通信技术, 2019, 52(12):3010-3015. CHEN H B, WU Y, ZOU F T. Malware homology identification method based on ASM2VEC[J]. Communications Technology, 2019, 52(12):3010-3015(in Chinese).
[14] 宋文纳, 彭国军, 傅建明, 等. 恶意代码演化与溯源技术研究[J]. 软件学报, 2019, 30(8):2229-2267. SONG W N, PENG G J, FU J M, et al. Research on malicious code evolution and traceability technology[J]. Journal of Software, 2019, 30(8):2229-2267(in Chinese).
[15] DOR L, WOLF L. Learning to align the source code to the compiled object code[C]//International Conference on Machine Learning, 2017:2043-2051.
[16] SUBRAMANIAN S, COOK J V. Automatic verification of object code against source code[C]//Proceedings of 11th Annual Conference on Computer Assurance. COMPASS'96. Piscataway:IEEE Press, 1996:46-55.
[17] BOYER R S, YU Y. Automated proofs of object code for a widely used microprocessor[J]. Journal of the ACM, 1996, 43(1):166-192.
[18] 俞甲子. GCC编译器安全验证方法研究[D]. 杭州:浙江大学, 2008. YU J Z. Research on GCC compiler security verification methods[D]. Hangzhou:Zhejiang University, 2008(in Chinese).
[19] ISALKAR A, DESHMUKH H. Basics of computer and C programming[M].LAP LAMBERT Academic Publishing, 2018.
[20] 王相懂, 张毅坤. 基于GCC的抽象语法树对C++源程序结构的分析[J]. 计算机工程与应用, 2006, 42(23):97-99, 105. WANG X D, ZHANG Y K. Analysis of the C++ source program structure based on GCC abstract syntax tree[J]. Computer Engineering and Applications, 2006, 42(23):97-99, 105(in Chinese).
Outlines

/