Skip to content

Mimoja/amdfw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 31, 2019
2218359 · Oct 31, 2019

History

13 Commits
Oct 29, 2019
Oct 31, 2019
Jun 26, 2019
Jun 18, 2019
Jun 18, 2019
Jun 19, 2019
Jun 18, 2019
Jun 18, 2019
Jun 18, 2019
Oct 23, 2019
Jun 26, 2019
Jun 18, 2019
Jun 18, 2019
Jun 18, 2019
Jun 18, 2019
Jun 18, 2019
Jun 18, 2019

Repository files navigation

amdfw

Golang library for reading and writing AMD firmware components

Credit goes to @cwerling for his psptool

amddump

cmd/amddump is a small tool, that dumps all informations known to this library on a specfic image.

amddump ryzeimage.rom

Current Limitations

  • Always assumes valid FirmwareEntryTable.
    • Some AM1 CPUs are not using it.
    • Older FETs might be parsed wrong
  • Non Directory-Based Firmware (IMC, GEC, XHCI) cannot be extracted
  • All Offsets are treated as absolute. Partial Images often can't be read.

Usage

See cmd/amddump.go for read-only example code.

func main() {

	imageBytes, err := ioutil.ReadFile(os.Args[1])

	if err != nil {
		log.Fatal("Could not read file: ", err)
	}

	image, err := amdfw.ParseImage(imageBytes)

	if err != nil {
		log.Println("Error while parse Image: ", err.Error())
	}

	targetAddress := uint32(0x1C1000)
	image.FET.ImcRomBase = &targetAddress

	image.FET.Write(imageBytes, image.FET.Location)

	ioutil.WriteFile(os.Args[1], imageBytes, 666)
}

About

golang library to parse AMD Firmware Structures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages