Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Nov 9, 2024
1 parent b34d6fb commit be6a126
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// RtlGenRandom
func main() {
// testSdkCommands()
sdk.SysPath = "testdata/asm.exe"
sdk.TargetFilePath = "testdata/asm.exe"
ux.Run()
// testDisassembly()
// testParsePe()
Expand Down
6 changes: 3 additions & 3 deletions sdk/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import (
//go:embed bin/*
var data embed.FS

var SysPath = ""
var TargetFilePath = ""

func init() {
runtime.LockOSThread()
m := stream.ReadEmbedFileMap(data, "bin")
sha := sha256.Sum256(m.Get("libhyperdbg.dll"))
dir := filepath.Join(mylog.Check2(os.UserCacheDir()), "hyperdbg", "cache", base64.RawURLEncoding.EncodeToString(sha[:]))
mylog.Check(windows.SetDllDirectory(dir))
SysPath = filepath.Join(dir, "hyperkd.sys")
mylog.Trace("sysPath", SysPath)
TargetFilePath = filepath.Join(dir, "hyperkd.sys")
mylog.Trace("sysPath", TargetFilePath)
if !stream.IsDir(dir) {
stream.CreatDirectory(dir)
m.Range(func(k string, v []byte) bool {
Expand Down
2 changes: 1 addition & 1 deletion sdk/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestSdk(t *testing.T) {

mylog.Call(func() {
assert.True(t, VmxSupportDetection())
assert.True(t, SetCustomDriverPathEx(SysPath))
assert.True(t, SetCustomDriverPathEx(TargetFilePath))
mylog.Trace("InstallVmmDriver", InstallVmmDriver())

// ConnectLocalDebugger()
Expand Down
2 changes: 1 addition & 1 deletion ux/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ var testHexDat = []byte{
0xEB, 0x03, 0x48, 0x8B, 0xC8, 0x66, 0x2B, 0x4C, 0x24, 0x38, 0x66, 0x89, 0x4E, 0x26, 0x33, 0xC0,
}

var TargetExePath = sdk.SysPath
var TargetExePath = sdk.TargetFilePath

/*
0019ECEC 77715BFE /CALL 到 DeviceIoControl 来自 77715BF8
Expand Down
2 changes: 1 addition & 1 deletion ux/ux.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func newToolbar() *toolbar {

newPanel.AddChild(widget.NewButton("Install Driver", func() {
mylog.Check(sdk.VmxSupportDetection())
mylog.Check(sdk.SetCustomDriverPathEx(sdk.SysPath))
mylog.Check(sdk.SetCustomDriverPathEx(sdk.TargetFilePath))

mylog.Trace("Install Driver", sdk.InstallVmmDriver())
}))
Expand Down

0 comments on commit be6a126

Please sign in to comment.