go-extract-vmlinux

command module
v0.0.0-...-3112f42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

go-extract-vmlinux

A tool to extract vmlinux/vmlinuz in golang

Inspired from the official script from linux extract-vmlinux

How to use

package main

import (
  "log"
  extract "github.com/rawdaGastan/go-extract-vmlinux"
)

func main() {
  kernelImagePath := "<Enter your compressed kernel path>"

  // decompress kernel
  err := extract.TryDecompressKernel(kernelImagePath, kernelImagePath+"-decompressed")
  if err != nil {
    log.Fatal(err)
  }

  // compressed kernel
  err = extract.IsValidELFKernel(kernelImagePath + "-decompressed")
  if err != nil {
    log.Fatal(err)
  }
}

How to test

make test

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL