MCPcopy Index your code
hub / github.com/SummerSec/SPATool

github.com/SummerSec/SPATool @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
119 symbols 280 edges 40 files 37 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SPATool

静态程序分析工具 主要生成方法的CFG和.java文件的AST

<a href="https://github.com/SummerSec/SPATool"></a>
<a href="https://github.com/SummerSec/SPATool"><img alt="template" src="https://img.shields.io/badge/SPATool-green"></a>
<a href="https://github.com/SummerSec/SPATool"><img alt="Forks" src="https://img.shields.io/github/forks/SummerSec/SPATool"></a>
 <a href="https://github.com/SummerSec/SPATool"><img alt="Release" src="https://img.shields.io/github/release/SummerSec/SPATool.svg"></a>

Stars Follower Visitor SecSummers

📝 TODO

  • [ ] Class文件生成IR
  • [ ] IR文件生成CFG
  • [ ] 命令行模式

🐉 来龙去脉

未来这段时间可能会在静态分析领域上继续研究,这是但新手小白会面对CFG(Control-Flow-Graph控制流图)和AST(Abstract Syntax Tree抽象语法树)怎么看都不知道的问题,导致无从下手。以此这是这款工具诞生的契机,目前工具使用的是Soot生成CFG,使用JavaParser生成AST。


⚡下载安装

  • 第一步必须下载安装Graphviz,并配置环境变量。

​ 下载地址:https://graphviz.org/download/,参考配置如下。

image-20220214201824399

检测是否配置成功,执行命令dot -h

image-20220214201909412


🎬 使用方法

效果页面

image-20220214154214904

GUI使用说明

Cli使用说明


🅱️ 免责声明

该工具仅用于安全自查检测

由于传播、利用此工具所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,作者不为此承担任何责任。

本人拥有对此工具的修改和解释权。未经网络安全部门及相关部门允许,不得善自使用本工具进行任何攻击活动,不得以任何方式将其用于商业目的。

该工具只授权于企业内部进行问题排查,请勿用于非法用途,请遵守网络安全法,否则后果作者概不负责


as

Extension points exported contracts — how you extend this code

Template (Interface)
@ClassName: template @Description: TODO @Author: Summer @Date: 2022/2/7 13:13 @Version: v1.0.0 @Description: [2 implementers]
src/main/java/com/sumsec/core/cfg/core/Template.java

Core symbols most depended-on inside this repo

parse
called by 9
src/main/java/com/sumsec/core/ast/Parser.java
findFiles
called by 7
src/main/java/com/sumsec/core/cfg/uitls/FindFiles.java
Save
called by 4
src/main/java/com/sumsec/util/SaveFile.java
main
called by 3
src/main/java/com/sumsec/core/cfg/core/CFGViewerOver.java
copyFile
called by 3
src/main/java/com/sumsec/core/cfg/uitls/CopyFile.java
ReadJavaContent
called by 2
src/main/java/com/sumsec/core/ast/util/JavaContent.java
DotG
called by 2
src/main/java/com/sumsec/core/cfg/Generate.java
genMethod
called by 2
src/main/java/com/sumsec/core/cfg/core/TMethod.java

Shape

Method 79
Class 39
Interface 1

Languages

Java100%

Modules by API surface

src/main/java/com/sumsec/ui/mainController.java14 symbols
src/main/java/com/sumsec/util/DFS.java5 symbols
src/main/java/com/sumsec/ui/main.java4 symbols
src/main/java/com/sumsec/core/cfg/uitls/OSUtil.java4 symbols
src/main/java/com/sumsec/core/cfg/uitls/ImageComponent.java4 symbols
src/main/java/com/sumsec/core/cfg/core/CFGViewerOver.java4 symbols
src/main/java/com/sumsec/core/cfg/ImageUtil.java4 symbols
src/test/java/cfg/demo.java3 symbols
src/test/java/cfg/cfgdemo.java3 symbols
src/test/java/cfg/FizzBuzz.java3 symbols
src/test/java/cfg/Env.java3 symbols
src/main/java/com/sumsec/core/cfg/uitls/SelectC.java3 symbols

For agents

$ claude mcp add SPATool \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact