The invention relates to the field of computers, and provides a
software security detection method and
system based on code lines, and the method comprises the steps: obtaining a binary file of to-be-detected
software, and carrying out the preprocessing of the binary file, and obtaining a corresponding
pseudo code; performing multi-level
code line generation on each function in the
pseudo code to obtain a
code line vector of each function; based on the
code line vector of each function, performing similarity retrieval in a preset code line
library, and performing
risk assessment and attribution analysis on the binary file of the to-be-detected
software according to a
retrieval result; and generating a security detection report of the to-be-detected software based on the
evaluation result and the analysis result. According to the method, the binary file of the to-be-detected software is converted into the
pseudo code, deep analysis can be performed on the pseudo code, and multi-level code line generation is performed on each function in the pseudo code, so that similarity retrieval can be performed in the preset code line
library on the basis of the generated code line vector; therefore, the accuracy, efficiency and comprehensiveness of software security detection are improved.