(pid uint32)
| 149 | } |
| 150 | |
| 151 | func getModuleBaseAddress(pid uint32) (uintptr, error) { |
| 152 | var moduleHandles [1024]windows.Handle |
| 153 | var cbNeeded uint32 |
| 154 | proc, err := windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION|windows.PROCESS_VM_READ, false, pid) |
| 155 | if err != nil { |
| 156 | return 0, err |
| 157 | } |
| 158 | if err := windows.EnumProcessModulesEx(proc, &moduleHandles[0], 1024, &cbNeeded, windows.LIST_MODULES_ALL); err != nil { |
| 159 | return 0, err |
| 160 | } |
| 161 | moduleHandle := moduleHandles[0] |
| 162 | return uintptr(moduleHandle), nil |
| 163 | } |
no outgoing calls
no test coverage detected