Source Byte Code Similarity Determination Using Feature Extraction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods struggle to calculate similarity between byte code and source code when they have different data formats, making it difficult to determine if a program was generated using specific source code, especially with fragmentary source code that lacks necessary compilation information.
Innovation Solution
A determination apparatus and method that extracts feature information from both byte code and source code, including function definitions and calling orders, and calculates similarity using algorithms like edit distance and longest common sequence, regardless of data format, to determine if a program was generated using specific source code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If source code is compiled into byte code to calculate similarity, then measurement precision is improved, but device complexity increases due to requiring same data format and compilation process
Solution Approach 1:
The patent introduces an intermediary conversion process that translates source code into a standardized representation format that can be directly compared with byte code without requiring full compilation. This intermediary step bridges the gap between different data formats while maintaining measurement precision.
Solution Approach 2:
The patent changes the parameters of comparison by extracting and comparing specific features (function definitions, variable declarations, control structures) from both source code and byte code, rather than comparing the entire data structures. This allows for accurate similarity calculation without requiring identical data formats.
2Ease of operation
If fragmentary source code is used, then ease of operation is improved, but manufacturing precision deteriorates due to missing compilation information
Solution Approach 1:
The patent applies partial action by comparing only the essential features that are present in fragmentary source code (function definitions, variable declarations, control structures) rather than requiring complete compilation information. This allows similarity calculation to proceed with incomplete code while maintaining sufficient precision for detection purposes.
Solution Approach 2:
The patent performs preliminary extraction and normalization of code features before comparison, preparing the fragmentary source code in advance to compensate for missing information. This preliminary processing enables the system to work with incomplete code while achieving accurate similarity measurements.
3Measurement precision
If complete source code compilation is required, then measurement precision is improved, but loss of time increases due to enormous human labor
Solution Approach 1:
The patent extracts only the necessary features (function definitions, variable declarations, control structures) from source code without performing complete compilation. This extraction approach maintains measurement precision by focusing on critical code elements while eliminating time-consuming compilation steps.
Solution Approach 2:
The patent replaces the mechanical compilation process with an automated feature extraction and comparison system that uses algorithms to analyze code structure and semantics directly, eliminating the need for human labor and lengthy compilation processes while maintaining accuracy.
Data Source
Figure 1
Figure 2(a)~2(b)
Figure 3(a)~3(b)
AI summary
A determination apparatus (10) includes: a feature information extraction unit (151) configured to extract, as feature information, function definition information as information for defining a function and function calling order information in which function names to be executed in the function are written in execution order from each of an input source code and a byte code of a program; and a similarity calculation unit (154) configured to calculate a similarity between a function in the source code and a function in the byte code by using the feature information extracted by the feature information extraction unit (151).