diff --git a/README.md b/README.md index 35a3b56..8d8ab66 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ ``` go >= 1.21.4 -MingW64 - make/x86_64-w64-mingw32-gcc[g++,ar] +MingW64 - make/x86_64-w64-mingw32-gcc[g++,gcc-ar] Garble - https://github.com/burrowers/garble ``` +## 预览 + 图片 图片 diff --git a/apps/ui/main.go b/apps/ui/main.go index bfef2be..e1b628a 100644 --- a/apps/ui/main.go +++ b/apps/ui/main.go @@ -85,6 +85,10 @@ func (c *Config) appRun() { dialog.ShowError(err, win) return } + + if reader == nil { + return + } defer reader.Close() file := reader.URI().Path() @@ -101,9 +105,11 @@ func (c *Config) appRun() { if runtime.GOOS == "windows" { suffix = ".exe" } - path, _ := os.Executable() - path = filepath.Join(filepath.Dir(path)) - avDirSrv := filepath.Join(path, "anti-av") + runPath, _ := os.Executable() + runPath = filepath.Join(filepath.Dir(runPath)) + cache := filepath.Join(runPath, "cache") + os.Mkdir(cache, 0755) + avDirSrv := filepath.Join(cache, "anti-av") avDirSrvAppAv := filepath.Join(avDirSrv, "apps", "av") avSrv := "git clone https://github.com/b1gcat/anti-av.git" avDirOut := filepath.Join(avDirSrv, "dist") @@ -175,11 +181,11 @@ func (c *Config) appRun() { } } if selectEntry.Text == "远程加载" { - os.Rename(filepath.Join(avDirOut, "payload.raw"), filepath.Join(path, "payload.raw")) - logrus.Infof("输出文件: %s", filepath.Join(path, "payload.raw")) + os.Rename(filepath.Join(avDirOut, "payload.raw"), filepath.Join(runPath, "payload.raw")) + logrus.Infof("输出文件: %s", filepath.Join(runPath, "payload.raw")) } - os.Rename(filepath.Join(avDirOut, output), filepath.Join(path, output)) - logrus.Infof("输出文件: %s", filepath.Join(path, output)) + os.Rename(filepath.Join(avDirOut, output), filepath.Join(runPath, output)) + logrus.Infof("输出文件: %s", filepath.Join(runPath, output)) os.RemoveAll(avDirOut) logrus.Info("完成") }