Skip to content

Commit f22a25e

Browse files
committed
fix(myph): retrieving dependencies for API hashing
1 parent 39619a0 commit f22a25e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

cli/parser.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,20 @@ func GetParser(opts *Options) *cobra.Command {
143143
os.Exit(1)
144144
}
145145

146+
if opts.UseAPIHashing {
147+
fmt.Printf("[+] Retrieving dependencies to use API Hashing...\n")
148+
149+
execGoGetCmd := exec.Command("go", "get", "github.com/Binject/debug/pe")
150+
execGoGetCmd.Dir = MYPH_TMP_DIR
151+
_, _ = execGoGetCmd.Output()
152+
153+
// this should stay to cmepw addr
154+
execGoGetCmd = exec.Command("go", "get", "github.com/cmepw/myph/internals")
155+
execGoGetCmd.Dir = MYPH_TMP_DIR
156+
_, _ = execGoGetCmd.Output()
157+
158+
}
159+
146160
/* reading the shellcode as a series of bytes */
147161
shellcode, err := tools.ReadFile(opts.ShellcodePath)
148162
if err != nil {
@@ -274,11 +288,6 @@ func GetParser(opts *Options) *cobra.Command {
274288

275289
fmt.Printf("\n[+] Template (%s) written to tmp directory. Compiling...\n", opts.Technique)
276290

277-
if opts.UseAPIHashing {
278-
execGoGetCmd := exec.Command("go", "get", "github.com/Binject/debug/pe")
279-
execGoGetCmd.Dir = MYPH_TMP_DIR
280-
_, _ = execGoGetCmd.Output()
281-
}
282291

283292
execCmd := BuildLoader(opts)
284293
execCmd.Dir = MYPH_TMP_DIR

0 commit comments

Comments
 (0)