A method for displaying a method call relation graph when a java byte code is checked
A java bytecode and display method technology, which is applied in the field of code logic analysis, can solve problems such as trouble reading instruction bytecode, inability to decompile java source code in class files, and inability to generate function call diagrams, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0034] A method for displaying a method call diagram when viewing java bytecodes, comprising the following steps: 1. decompressing a jar file, disassembling a class file therein, and generating a corresponding code text file;
[0035] Step 2, perform text analysis on the code text file, parse out all methods in all classes, and set each method as a node in a topology;
[0036] Step 3: Analyze the method call code in each method, find the called method, and establish an association in the topology diagram;
[0037] Step 4. According to the topology diagram, draw each node in the image with a unified graphic, and connect the nodes with line segments with arrows. Because there can be multiple places in the method to call other methods, so how many arrows can a node connect to other node;
[0038] Step 5. Add a mouse click trigger event processing function for each node graph in the image. When the user clicks the graph, the processing function automatically opens the file where ...
Embodiment 2
[0040] Compared with Embodiment 1, this embodiment differs in that in step 1, the jar file is decompressed, the class file therein is disassembled, and a corresponding code text file is generated. The specific method is as follows:
[0041] a. Use the open source Zip library in the program to decompress the decompiled jar file and put the content into a directory;
[0042] b. Realize all java bytecode files with the suffix name class in the file scanning directory;
[0043] c. Use the javap command to disassemble each bytecode class file in turn to generate assembly code and save the code to the location of the class file and take a unified file suffix name.
Embodiment 3
[0045] Compared with Embodiment 2, this embodiment differs in step 2, performing text analysis on the code text file, parsing out all methods in all classes, and setting each method as a node in a topology structure, as follows:
[0046] a. Open the code text files generated by the assembly in sequence, and perform text analysis according to a specific template;
[0047] b. Take each method name, method signature, and method implementation in each class in each file as a data record, and abstract it into a node of the topology.
[0048] As a preferred solution of Embodiment 3, the method name and method signature are combined into a unique identifier for each node.
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap