Skip to content

Commit

Permalink
remove SetDllDirectory,because we load driver not dll
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Jul 3, 2024
1 parent e24d28d commit f287208
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion libhyperdbg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions libhyperdbg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ func TestSdk(t *testing.T) {
})
}

func AddCurrentDirToPath() {
currentPath := mylog.Check2(filepath.Abs("."))
pathEnv := os.Getenv("PATH")
newPath := strings.Join([]string{currentPath, pathEnv}, string(os.PathListSeparator))
mylog.Check(os.Setenv("PATH", newPath))
}

func Test2(t *testing.T) {
//Dependencies := []string{
// "C:\\Windows\\System32\\drivers\\hyperhv.dll",
Expand Down
4 changes: 2 additions & 2 deletions sdk.gen/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ type GuestExtraRegisters = GuestExtraRegisters`,
b.Replace("package libhyperdbg", "package main", 1)
b.Replace("\nSizeT = uint64", "", 1)
b.Replace("\nBool = int32", "", 1)
b.Replace(`__imp_ScriptEngineParse = GengoLibrary.ImportNow("ScriptEngineParse")`, ` return
__imp_ScriptEngineParse = GengoLibrary.ImportNow("ScriptEngineParse")`, 1)
b.Replace(`__imp_hyperdbg_u_continue_debuggee = GengoLibrary.ImportNow("hyperdbg_u_continue_debuggee")`, ` return
__imp_hyperdbg_u_continue_debuggee = GengoLibrary.ImportNow("hyperdbg_u_continue_debuggee")`, 1)
b.Replace(` Bool = int32
Long = int64
SizeT = uint64`, ` Long = int64`, 1)
Expand Down
10 changes: 10 additions & 0 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package main

import (
"github.com/stretchr/testify/assert"
"os"
"path/filepath"
"strings"
"syscall"
"testing"

Expand Down Expand Up @@ -49,3 +52,10 @@ func DeviceName() string { return "HyperdbgHypervisorDevice" }
func LinkName() (*uint16, error) {
return syscall.UTF16PtrFromString("\\\\\\\\.\\\\" + DeviceName())
}

func AddCurrentDirToPath() {
currentPath := mylog.Check2(filepath.Abs("."))
pathEnv := os.Getenv("PATH")
newPath := strings.Join([]string{currentPath, pathEnv}, string(os.PathListSeparator))
mylog.Check(os.Setenv("PATH", newPath))
}

0 comments on commit f287208

Please sign in to comment.