The Design and Implementation of Preprocessor of C/C++ Program Safety Checker

Author
JiangChao
Advisor
LiuJian
School
Xi'an University of Electronic Science and Technology
Major
Computer Software and Theory
Classification
TP312.1 Programming language ALGOL
Degree
Master's thesis
Year
2008
Downloads
65
Citations
1

Request the full text

Abstract

In this paper, based on analysis of the safety inspection tool framework of C / C program , according to the special needs of the security check tool is given a pre- processor the analyzer automatically generated tool the ANTLR structure C / C safety inspection tool , and this method is applied to the actual development process . Preprocessor use this method constructed by analyzing C / C source code for the backend security checks completed pretreated intermediate files and security checks required special information , and the completion of the pre-processing stage security vulnerability checks . This article uses ANTLR generated lexer , parser framework , focused on the C / C pretreatment standards and its safety , Design and Implementation of the preprocessor , and pretreatment security check module design and realization . The practice shows that the pre- processor to meet the needs of the security check tool .

Table of contents

Abstract 3-4 Abstract 4-7 The first chapter 7-11 1.1 Background 7-8 1.2 C / C program security check Tool Overview 8-9 1.3 This work and content organization 9-11 Chapter C / C pretreatment 11-15 2.1 C / C preprocessor and preprocessor directives 11-12 2.2 C / C pre-processor application security checking tool 12 2.3 Pretreatment security vulnerabilities 12-15 Chapter ANTLR and C / C pre-processor application security checking tool 15-23 3.1 parser tools automatically generate ANTLR 15-20 3.1.1 parser 15-17 3.1.2 Automatic generation tool ANTLR parser features 17-20 3.2 using ANTLR design preprocessor 20-23 3.2.1 C / C pre-processor application security checking tool 20-21 3.2.2 ANTLR preprocessor in the constructor's role 21-23 Chapter C / C pre-processor safety inspection tool design and implementation 23-45 4.1 preprocessor overall structure 23-24 4.2 main data structure design and implementation 24-27 4.2.1 macro definitions stored in the data structure 24-25 4.2.2 macro substitution data structure 25-26 4.2.3 lexical and syntax analyzer data structures 26-27 4.3 Analysis and Implementation of preprocessing directives 27-40 4.3.1 preprocessor directives kind 27-28 4.3.2 macro definitions related preprocessor directives 28-31 4.3.2.1 # define directive 28-30 4.3.2.2 # undef directive 30-31 4.3.3 Conditional compilation related preprocessor directives 31-37 4.3.3.1 # if, # elif, # else, # endif directive 31-36 4.3.3.2 # ifdef, # ifndef directive 36-37 4.3.4 files contain preprocessor directives 37-38 4.3.4.1 # include directive 37-38 4.3.5 Other preprocessing directives 38-40 4.3.5.1 # line directives 38-39 4.3.5.2 # error directive 39-40 4.4 security check module design 40-45 4.4.1 Pretreatment safety analysis 40 4.4.2 preprocessor security policy 40-42 4.4.3 preprocessor security module design 42-45 Chapter C / C pre-processor application security checking tool constructed key technology 45-55 5.1 preprocessing operator 45-48 5.1.1 string of operator (#) 45-47 5.1.2 linguistic symbols paste operator (# #) 47-48 5.2 macro expands to the special circumstances 48-53 5.2.1 Multiple macro expansion 49-51 5.2.2 recursive macro call processing 51-52 5.2.3 variadic macro processing 52-53 5.3 file and line information retention 53-54 5.3.1 C / C inspection tool requirements 53-54 5.3.2 each case file and line information processing 54 5.4 blank handle a variety of situations 54-55 Chapter VI Conclusion 55-56 Thanks 56-57 References 57-59 during school research 59-60 Appendix A simple calculator complete implementation 60-63

Related dissertations

  1. With the Design and Implementation of Deyang City Police Fire Brigade Fire Supervision and Management System
  2. Production of Chicken Antibodies Against Canine Parvovirus Variant CPV-2a and the Toxicological Assessment
    WeiShengNan ·Sichuan Agricultural University ·2013 ·Master's thesis
  3. Sensor design for safety testing of flammable liquids
    ShiJunQiao ·Heilongjiang University ·2012 ·Master's thesis
  4. The Analysis and Design of the Network Security Management Platform with Security Check and Situation Awareness Capability
  5. Research and Application of File Simplification Technology in Static Analysis
  6. The Study and Construction of Java Front-end for Security Checker
  7. The Design and Implementation of the Abstract Synatax Tree in Safety Verifying Tool
  8. Research of Intelligent Dispatching Operation Order Expert System
    LiuZuo ·Agricultural University of Hebei ·2013 ·Master's thesis
  9. Research on Automatic Conversion from Chemical Scripting Languages to UDLC
    XieJiaJun ·Lanzhou University ·2012 ·Master's thesis
  10. The Construction of a Stability Monitor System for Beijing Synchrotron Radiation Facility and the Research on the Biological Macromolecules by Using Small-angle x-ray Scattering
    DongShuQiang ·Lanzhou University ·2008 ·Doctoral dissertation
  11. Research on Transmission and Detection Technology for TDR-IDMA Signal
  12. Design and Implementation of an IDE for WSN Nodes
    ZuoXing ·Zhejiang University ·2008 ·Master's thesis
  13. The Research of a Distributed Data Mining System Based on Web Services
    FanBin ·Wuhan University of Technology ·2004 ·Master's thesis
  14. The Comparison of Construction Safe Management System between Chinese and Foreign
    JiangHong ·Zhejiang University ·2003 ·Master's thesis
  15. Port State Control based Web ship security checks auxiliary of system development
    WenJianPing ·Shanghai Maritime University ·2001 ·Master's thesis
  16. Research on the Clock Recovery Chips in 10Gbit/s SDH/SONET and 10-Gigabit Ethernet
    LiJing ·Southeast University ·2006 ·Master's thesis
  17. Study on Code Generation Technology and Its Applications on Telecom Add-Value Services
    ZhangTeng ·Chongqing University ·2005 ·Master's thesis
  18. The Design and Implementation of TMN Performance Management System Based on OVPI
  19. Hydroacoustic target system design and implementation pretreatment machine
    XuWei ·Harbin Engineering University ·2005 ·Master's thesis
  20. The Application of Terahertz Radiation in the Field of Identify of Chinese Traditional Medicines and Security Inspection
    ShaLin ·Capital Normal University ·2005 ·Master's thesis