Auto detect debug symbols for host kernels
This commit is contained in:
parent
fc50808893
commit
3064dc3a27
@ -170,6 +170,9 @@ type KernelInfo struct {
|
|||||||
KernelPath string
|
KernelPath string
|
||||||
InitrdPath string
|
InitrdPath string
|
||||||
RootFS string
|
RootFS string
|
||||||
|
|
||||||
|
// Debug symbols
|
||||||
|
VmlinuxPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
type KernelConfig struct {
|
type KernelConfig struct {
|
||||||
|
4
debug.go
4
debug.go
@ -114,7 +114,7 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
|
|||||||
return aurora.BgGreen(aurora.Black(name))
|
return aurora.BgGreen(aurora.Black(name))
|
||||||
}
|
}
|
||||||
|
|
||||||
return aurora.BgRed(aurora.Gray(aurora.Bold(name)))
|
return aurora.BgRed(aurora.Gray(name))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("[*] %s %s %s\n", redgreen("KASLR", kaslr),
|
fmt.Printf("[*] %s %s %s\n", redgreen("KASLR", kaslr),
|
||||||
@ -156,7 +156,7 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
|
|||||||
fmt.Printf("[*] build result copied to %s\n", coloredRemoteFile)
|
fmt.Printf("[*] build result copied to %s\n", coloredRemoteFile)
|
||||||
|
|
||||||
fmt.Printf("\n%s\n", q.GetSshCommand())
|
fmt.Printf("\n%s\n", q.GetSshCommand())
|
||||||
fmt.Printf("gdb -ex 'target remote %s'\n\n", gdb)
|
fmt.Printf("gdb %s -ex 'target remote %s'\n\n", ki.VmlinuxPath, gdb)
|
||||||
|
|
||||||
err = interactive(q)
|
err = interactive(q)
|
||||||
return
|
return
|
||||||
|
@ -348,6 +348,13 @@ func genHostKernels() (kcfg config.KernelConfig, err error) {
|
|||||||
InitrdPath: kernelsBase + genInitrdPath(files, k),
|
InitrdPath: kernelsBase + genInitrdPath(files, k),
|
||||||
RootFS: genRootfsImage(dii),
|
RootFS: genRootfsImage(dii),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vmlinux := "/usr/lib/debug/boot/vmlinux-" + k
|
||||||
|
log.Println("vmlinux", vmlinux)
|
||||||
|
if exists(vmlinux) {
|
||||||
|
ki.VmlinuxPath = vmlinux
|
||||||
|
}
|
||||||
|
|
||||||
kcfg.Kernels = append(kcfg.Kernels, ki)
|
kcfg.Kernels = append(kcfg.Kernels, ki)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user