Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在window系统运行时遇到[生成图片失败]的问题 #1

Closed
tt5753 opened this issue Feb 19, 2022 · 10 comments
Closed

在window系统运行时遇到[生成图片失败]的问题 #1

tt5753 opened this issue Feb 19, 2022 · 10 comments

Comments

@tt5753
Copy link

tt5753 commented Feb 19, 2022

可以将方法签名中的空格改为短横(-)
ToCebBank-void-sendOneMail(java.lang.String,java.lang.String,java.lang.String).dot

2022.02.19 at 12:31:11 CST INFO com.sumsec.core.cfg.uitls.OSUtil 55 RunCmd - 正在执行命令 [cmd.exe, /c, dot, -Tpng, E:\Users\admin\Downloads\datas\sootOutput\500216241354900\ToCebBank void sendOneMail(java.lang.String,java.lang.String,java.lang.String).dot, -o, E:\Users\admin\Downloads\datas\result\cfg\500216241351000\ToCebBank void sendOneMail(java.lang.String,java.lang.String,java.lang.String).png] 2022.02.19 at 12:31:12 CST ERROR com.sumsec.core.cfg.uitls.OSUtil 72 RunCmd - 生成图片失败 E:\Users\admin\Downloads\datas\sootOutput\500216241354900\ToCebBank void sendOneMail(java.lang.String,java.lang.String,java.lang.String).dot

@SummerSec
Copy link
Owner

麻烦提供测试代码,如果是class文件,也麻烦提供一下。

@SummerSec
Copy link
Owner

邮件回复,我这边是看不到附件的。麻烦在GitHub上传一下。谢谢

@SummerSec
Copy link
Owner

或者提供一个下载链接也行。

@SummerSec
Copy link
Owner

image

image
我这测试通过了呀,第一步必须下载安装[Graphviz](https://graphviz.org/download/),并配置环境变量。这步做了吗?

@SummerSec
Copy link
Owner

请在命令执行环境中下执行,dot -h查看是否存在环境。

@tt5753
Copy link
Author

tt5753 commented Feb 19, 2022

拉了源码, 调试了下, 不是dot命令的问题, 是在我的机器里面
执行Runtime.getRuntime().exec(cmd).getInputStream(); 后获得的这个 steam的 大小是0, 见图, 我改了下, 就正常了
image
image
image

@SummerSec
Copy link
Owner

拉了源码, 调试了下, 不是dot命令的问题, 是在我的机器里面 执行Runtime.getRuntime().exec(cmd).getInputStream(); 后获得的这个 steam的 大小是0, 见图, 我改了下, 就正常了 image image image

感谢!我的机器上不是0,后续改变一下逻辑。执行命令之后判断是否图片是否存在,如果没有在报错。

@tt5753
Copy link
Author

tt5753 commented Feb 19, 2022

还发现个小问题 com.sumsec.core.ast.Parser 这个类的java文件 parser.java p是小写的, 好像会编译错误

@SummerSec
Copy link
Owner

还发现个小问题 com.sumsec.core.ast.Parser 这个类的java文件 parser.java p是小写的, 好像会编译错误

是的,一开始小写,后面改成大写了。但git是忽略文件名大小写。我一直忽视了这个问题,下一个版本也会修复的。

@tt5753 tt5753 changed the title 在window系统运行时生成的dot和png文件名包含空格导致失败 在window系统运行时遇到[生成图片失败]的问题 Feb 19, 2022
@SummerSec
Copy link
Owner

这个问题在正式版本被修复了,采用先判断图片是否存在。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants