aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/driver/memmod/memmod_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'driver/memmod/memmod_windows.go')
-rw-r--r--driver/memmod/memmod_windows.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/driver/memmod/memmod_windows.go b/driver/memmod/memmod_windows.go
index 5ded40ea..424e98b9 100644
--- a/driver/memmod/memmod_windows.go
+++ b/driver/memmod/memmod_windows.go
@@ -164,14 +164,13 @@ func (module *Module) finalizeSection(sectionData *sectionFinalizeData) error {
return nil
}
-var rtlAddFunctionTable = windows.NewLazySystemDLL("ntdll.dll").NewProc("RtlAddFunctionTable")
-
func (module *Module) registerExceptionHandlers() {
directory := module.headerDirectory(IMAGE_DIRECTORY_ENTRY_EXCEPTION)
if directory.Size == 0 || directory.VirtualAddress == 0 {
return
}
- rtlAddFunctionTable.Call(module.codeBase+uintptr(directory.VirtualAddress), uintptr(directory.Size)/unsafe.Sizeof(IMAGE_RUNTIME_FUNCTION_ENTRY{}), module.codeBase)
+ runtimeFuncs := (*windows.RUNTIME_FUNCTION)(unsafe.Pointer(module.codeBase+uintptr(directory.VirtualAddress)))
+ windows.RtlAddFunctionTable(runtimeFuncs, uint32(uintptr(directory.Size)/unsafe.Sizeof(*runtimeFuncs)), module.codeBase)
}
func (module *Module) finalizeSections() error {